summaryrefslogtreecommitdiffstats
path: root/libexec
diff options
context:
space:
mode:
authorjdp <jdp@FreeBSD.org>1999-08-30 01:25:38 +0000
committerjdp <jdp@FreeBSD.org>1999-08-30 01:25:38 +0000
commitd8c85ab826fb402b3bb08f91f622e4e355f63b21 (patch)
treeabe2eb69cef7de0ef6fe0f35ca0348c58c1e1047 /libexec
parent48598d755cf0f6a86a7d583797f1947d19dda65c (diff)
downloadFreeBSD-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.c12
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;
OpenPOWER on IntegriCloud