提交 d93e028c 编写于 作者: R Rich Felker

fix dlsym RTLD_NEXT support

previously this was being handled the same as a library-specific,
dependency-order lookup on the next library in the global chain, which
is likely to be utterly meaningless. instead the lookup needs to be in
the global namespace, but omitting the initial portion of the global
library chain up through the calling library.
上级 920baab8
...@@ -766,7 +766,9 @@ static void *do_dlsym(struct dso *p, const char *s, void *ra) ...@@ -766,7 +766,9 @@ static void *do_dlsym(struct dso *p, const char *s, void *ra)
if (p == RTLD_NEXT) { if (p == RTLD_NEXT) {
for (p=head; p && (unsigned char *)ra-p->map>p->map_len; p=p->next); for (p=head; p && (unsigned char *)ra-p->map>p->map_len; p=p->next);
if (!p) p=head; 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) { if (p == head || p == RTLD_DEFAULT) {
void *res = find_sym(head, s, 0); void *res = find_sym(head, s, 0);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册