From d8c85ab826fb402b3bb08f91f622e4e355f63b21 Mon Sep 17 00:00:00 2001 From: jdp Date: Mon, 30 Aug 1999 01:25:38 +0000 Subject: When honoring -Bsymbolic, still keep searching if only a weak definition was found in the referencing object. --- libexec/rtld-elf/rtld.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'libexec/rtld-elf') 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; -- cgit v1.1