aboutsummaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2017-02-09 23:33:06 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2017-02-09 23:33:06 +0000
commit6d20836aa7f6ac73c95f2fd895a586b3376a5de6 (patch)
tree2e6a1e678bf8a46ae26f25a470e0a840f1432907 /libexec
parent148ed9d8c1581c3030249e0d1b5fd49b0fdd2f6c (diff)
Notes
Diffstat (limited to 'libexec')
-rw-r--r--libexec/rtld-elf/rtld.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c
index 12e59b263cd0..a7c61b2d13f2 100644
--- a/libexec/rtld-elf/rtld.c
+++ b/libexec/rtld-elf/rtld.c
@@ -3957,15 +3957,19 @@ symlook_default(SymLook *req, const Obj_Entry *refobj)
donelist_init(&donelist);
symlook_init_from_req(&req1, req);
- /* Look first in the referencing object if linked symbolically. */
- if (refobj->symbolic && !donelist_check(&donelist, refobj)) {
- res = symlook_obj(&req1, refobj);
- if (res == 0) {
- req->sym_out = req1.sym_out;
- req->defobj_out = req1.defobj_out;
- assert(req->defobj_out != NULL);
- }
+ /*
+ * Look first in the referencing object if linked symbolically,
+ * and similarly handle protected symbols.
+ */
+ res = symlook_obj(&req1, refobj);
+ if (res == 0 && (refobj->symbolic ||
+ ELF_ST_VISIBILITY(req1.sym_out->st_other) == STV_PROTECTED)) {
+ req->sym_out = req1.sym_out;
+ req->defobj_out = req1.defobj_out;
+ assert(req->defobj_out != NULL);
}
+ if (refobj->symbolic || req->defobj_out != NULL)
+ donelist_check(&donelist, refobj);
symlook_global(req, &donelist);