diff options
author | jdp <jdp@FreeBSD.org> | 1999-09-04 04:00:09 +0000 |
---|---|---|
committer | jdp <jdp@FreeBSD.org> | 1999-09-04 04:00:09 +0000 |
commit | 4564b4e6701b2ca8458d4d2dc33bd9d8e3e50864 (patch) | |
tree | 9a759be2e2934b17f2ae9f5d5c34a7bd6e8a7c80 /libexec/rtld-elf | |
parent | 199f72f333a7bbee882c3453d3def30c4ed50ad9 (diff) | |
download | FreeBSD-src-4564b4e6701b2ca8458d4d2dc33bd9d8e3e50864.zip FreeBSD-src-4564b4e6701b2ca8458d4d2dc33bd9d8e3e50864.tar.gz |
When looking up symbols, search the objects loaded at program start
up first -- before the dlopened DAGs containing the referencing
object.
This makes dynamically loaded perl modules work properly again.
Diffstat (limited to 'libexec/rtld-elf')
-rw-r--r-- | libexec/rtld-elf/rtld.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 1885383..9147277 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -743,11 +743,9 @@ find_symdef(unsigned long symnum, Obj_Entry *refobj, } } - /* Search all dlopened DAGs containing the referencing object. */ - STAILQ_FOREACH(elm, &refobj->dldags, link) { - if (def != NULL && ELF_ST_BIND(def->st_info) != STB_WEAK) - break; - symp = symlook_list(name, hash, &elm->obj->dagmembers, &obj, in_plt); + /* Search all objects loaded at program start up. */ + if (def == NULL || ELF_ST_BIND(def->st_info) == STB_WEAK) { + symp = symlook_list(name, hash, &list_main, &obj, in_plt); if (symp != NULL && (def == NULL || ELF_ST_BIND(symp->st_info) != STB_WEAK)) { def = symp; @@ -755,9 +753,11 @@ find_symdef(unsigned long symnum, Obj_Entry *refobj, } } - /* Search all objects loaded at program start up. */ - if (def == NULL || ELF_ST_BIND(def->st_info) == STB_WEAK) { - symp = symlook_list(name, hash, &list_main, &obj, in_plt); + /* Search all dlopened DAGs containing the referencing object. */ + STAILQ_FOREACH(elm, &refobj->dldags, link) { + if (def != NULL && ELF_ST_BIND(def->st_info) != STB_WEAK) + break; + symp = symlook_list(name, hash, &elm->obj->dagmembers, &obj, in_plt); if (symp != NULL && (def == NULL || ELF_ST_BIND(symp->st_info) != STB_WEAK)) { def = symp; |