Subject: Re: BFD/ld lossage on MIPS with NEW_TOOLCHAIN
To: Charles M. Hannum <abuse@spamalicious.com>
From: Rafal Boni <rafal@mediaone.net>
List: tech-toolchain
Date: 10/08/2001 06:48:37
In message <1002521531.1278.1.camel@trinity.ihack.net>, you write:
-> > Index: symbol.c
-> > ===================================================================
-> > RCS file: /cvsroot/basesrc/libexec/ld.elf_so/symbol.c,v
-> > retrieving revision 1.10
-> > diff -b -u -r1.10 symbol.c
-> > --- symbol.c 2000/10/11 20:46:08 1.10
-> > +++ symbol.c 2001/10/07 03:22:47
-> > @@ -163,7 +163,7 @@
-> > bool in_plt;
-> > {
-> > Elf_Addr symnum = ELF_R_SYM(r_info);
-> > - const Elf_Sym *ref = NULL;
-> > + const Elf_Sym *ref;
-> > const Elf_Sym *def;
-> > const Elf_Sym *symp;
-> > const Obj_Entry *obj;
-> > @@ -171,10 +171,10 @@
-> > const Objlist_Entry *elm;
-> > unsigned long hash;
-> >
-> > - if (name == NULL) {
-> > ref = refobj->symtab + symnum;
-> > + if (name == NULL)
-> > name = refobj->strtab + ref->st_name;
-> > - }
-> > +
-> > hash = _rtld_elf_hash(name);
-> > def = NULL;
-> > defobj = NULL;
-> > @@ -227,6 +227,7 @@
-> > * symbol as having the value zero.
-> > */
-> > if (def == NULL && ELF_ST_BIND(ref->st_info) == STB_WEAK) {
-> > + rdbg(1, (" returning _rtld_sym_zero@_rtld_objmain"));
-> > def = &_rtld_sym_zero;
-> > defobj = _rtld_objmain;
-> > }
->
-> If I read this correctly, "ref" was previously uninitialized here in the
-> name!=NULL case. Is that correct?
Yah. Turns out every other caller (but the MIPS code) passed in NULL, so
it didn't much matter.
--rafal
----
Rafal Boni rafal@mediaone.net