summaryrefslogtreecommitdiffstats
path: root/main/libc0.9.32/uclibc-rtld_next-fix.patch
blob: f952641f47979e131407e0be7888fcd25f81edf8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
--- a/ldso/libdl/libdl.c
+++ b/ldso/libdl/libdl.c
@@ -671,7 +671,7 @@
 {
 	struct elf_resolve *tpnt, *tfrom;
 	struct dyn_elf *handle;
-	ElfW(Addr) from;
+	ElfW(Addr) from = 0;
 	struct dyn_elf *rpnt;
 	void *ret;
 	struct symbol_ref sym_ref = { NULL, NULL };
@@ -729,7 +729,13 @@
 	tpnt = NULL;
 	if (handle == _dl_symbol_tables)
 		tpnt = handle->dyn; /* Only search RTLD_GLOBAL objs if global object */
-	ret = _dl_find_hash(name2, &handle->dyn->symbol_scope, tpnt, ELF_RTYPE_CLASS_DLSYM, &sym_ref);
+
+	do {
+		ret = _dl_find_hash(name2, &handle->dyn->symbol_scope, tpnt, ELF_RTYPE_CLASS_DLSYM, &sym_ref);
+		if (ret != NULL)
+			break;
+		handle = handle->next;
+	} while (from && handle);
 
 #if defined(USE_TLS) && USE_TLS && defined SHARED
 	if (sym_ref.sym && (ELF_ST_TYPE(sym_ref.sym->st_info) == STT_TLS) && (sym_ref.tpnt)) {