diff options
author | kib <kib@FreeBSD.org> | 2017-02-23 07:39:01 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2017-02-23 07:39:01 +0000 |
commit | dadb35ee28e46d231d3c982dc5550f248df985e1 (patch) | |
tree | 36c276889e779a971b18e8145c41f1aa0a717f27 /libexec | |
parent | d3b239c0afe28ddedf42333b6f8c87c343c23bf3 (diff) | |
download | FreeBSD-src-dadb35ee28e46d231d3c982dc5550f248df985e1.zip FreeBSD-src-dadb35ee28e46d231d3c982dc5550f248df985e1.tar.gz |
MFC r313494:
Handle protected symbols in rtld.
Diffstat (limited to 'libexec')
-rw-r--r-- | libexec/rtld-elf/rtld.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index f75bcad..4828ec6 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -3952,15 +3952,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); |