mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-19 15:33:56 +00:00
When honoring -Bsymbolic, still keep searching if only a weak
definition was found in the referencing object.
This commit is contained in:
parent
6bd9374580
commit
7326e0b620
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=50607
@ -695,11 +695,17 @@ find_symdef(unsigned long symnum, const Obj_Entry *refobj,
|
||||
ref = refobj->symtab + symnum;
|
||||
name = refobj->strtab + ref->st_name;
|
||||
hash = elf_hash(name);
|
||||
def = NULL;
|
||||
defobj = NULL;
|
||||
|
||||
if (refobj->symbolic) { /* Look first in the referencing object */
|
||||
if ((symp = symlook_obj(name, hash, refobj, in_plt)) != NULL) {
|
||||
*defobj_out = refobj;
|
||||
return symp;
|
||||
def = symp;
|
||||
defobj = refobj;
|
||||
if (ELF_ST_BIND(def->st_info) != STB_WEAK) {
|
||||
*defobj_out = defobj;
|
||||
return def;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -710,8 +716,6 @@ find_symdef(unsigned long symnum, const Obj_Entry *refobj,
|
||||
* definition. If we find a strong definition we stop searching,
|
||||
* because there won't be anything better than that.
|
||||
*/
|
||||
def = NULL;
|
||||
defobj = NULL;
|
||||
for (obj = obj_list; obj != NULL; obj = obj->next) {
|
||||
if (obj == refobj && refobj->symbolic)
|
||||
continue;
|
||||
|
Loading…
Reference in New Issue
Block a user