diff options
author | jdp <jdp@FreeBSD.org> | 1999-08-30 01:25:38 +0000 |
---|---|---|
committer | jdp <jdp@FreeBSD.org> | 1999-08-30 01:25:38 +0000 |
commit | d8c85ab826fb402b3bb08f91f622e4e355f63b21 (patch) | |
tree | abe2eb69cef7de0ef6fe0f35ca0348c58c1e1047 /libexec | |
parent | 48598d755cf0f6a86a7d583797f1947d19dda65c (diff) | |
download | FreeBSD-src-d8c85ab826fb402b3bb08f91f622e4e355f63b21.zip FreeBSD-src-d8c85ab826fb402b3bb08f91f622e4e355f63b21.tar.gz |
When honoring -Bsymbolic, still keep searching if only a weak
definition was found in the referencing object.
Diffstat (limited to 'libexec')
-rw-r--r-- | libexec/rtld-elf/rtld.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 1204243..8662a29 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -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; |