about summary refs log tree commit diff
path: root/src/ldso
diff options
context:
space:
mode:
Diffstat (limited to 'src/ldso')
-rw-r--r--src/ldso/dynlink.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ldso/dynlink.c b/src/ldso/dynlink.c
index 55c2bbe4..263593ab 100644
--- a/src/ldso/dynlink.c
+++ b/src/ldso/dynlink.c
@@ -766,7 +766,9 @@ static void *do_dlsym(struct dso *p, const char *s, void *ra)
 	if (p == RTLD_NEXT) {
 		for (p=head; p && (unsigned char *)ra-p->map>p->map_len; p=p->next);
 		if (!p) p=head;
-		p=p->next;
+		void *res = find_sym(p->next, s, 0);
+		if (!res) goto failed;
+		return res;
 	}
 	if (p == head || p == RTLD_DEFAULT) {
 		void *res = find_sym(head, s, 0);