summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2004-06-19 21:38:41 +0000
committerEric Andersen <andersen@codepoet.org>2004-06-19 21:38:41 +0000
commit7503ff855821be5c37edfeac6464b310ce32ddec (patch)
tree551129c16480399972b44283b41b1698fd08fa0b
parent2cf407e3273e209d7fe558fe534cec07cffd6579 (diff)
Joakim Tjernlund writes:
Make old weak symbol handling work, if someone wants to enable it.
-rw-r--r--ldso/ldso/dl-hash.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/ldso/ldso/dl-hash.c b/ldso/ldso/dl-hash.c
index 68b2abd63..251ab6466 100644
--- a/ldso/ldso/dl-hash.c
+++ b/ldso/ldso/dl-hash.c
@@ -163,6 +163,7 @@ char *_dl_find_hash(const char *name, struct dyn_elf *rpnt1, int type_class)
unsigned long elf_hash_number, hn;
struct dyn_elf *rpnt;
const ElfW(Sym) *sym;
+ char *weak_result = NULL;
elf_hash_number = _dl_elf_hash(name);
@@ -226,11 +227,9 @@ char *_dl_find_hash(const char *name, struct dyn_elf *rpnt1, int type_class)
#if 0
/* Perhaps we should support old style weak symbol handling
* per what glibc does when you export LD_DYNAMIC_WEAK */
- if(_dl_symbol((char *)name)) {
- if (!weak_result)
- weak_result = (char *)tpnt->loadaddr + sym->st_value;
- break;
- }
+ if (!weak_result)
+ weak_result = (char *)tpnt->loadaddr + sym->st_value;
+ break;
#endif
case STB_GLOBAL:
return (char*)tpnt->loadaddr + sym->st_value;
@@ -240,5 +239,5 @@ char *_dl_find_hash(const char *name, struct dyn_elf *rpnt1, int type_class)
}
}
}
- return NULL;
+ return weak_result;
}