mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-01 04:12:51 +00:00
c8da4f07d7
dlfunc() called dlsym() to do the work, and dlsym() determines the dso that originating the call by the return address. Due to this, dlfunc() operated as if the caller is always the libc. To fix this, move the dlfunc() to rtld, where it can call the internal implementation of dlsym, and still correctly fetch return address. Provide usual weak stub for the symbol from libc for static binaries. dlfunc is put to FBSD_1.0 symver namespace in the ld.so export to override dlfunc@FBSD_1.0 weak symbol, exported by libc. Reported, analyzed and tested by: Tijl Coosemans <tijl ulyssis org> PR: standards/133339 Reviewed by: kan
28 lines
359 B
Plaintext
28 lines
359 B
Plaintext
/*
|
|
* $FreeBSD$
|
|
*/
|
|
|
|
FBSD_1.0 {
|
|
_rtld_error;
|
|
dlclose;
|
|
dlerror;
|
|
dlopen;
|
|
dlsym;
|
|
dlfunc;
|
|
dlvsym;
|
|
dladdr;
|
|
dllockinit;
|
|
dlinfo;
|
|
dl_iterate_phdr;
|
|
r_debug_state;
|
|
__tls_get_addr;
|
|
};
|
|
|
|
FBSDprivate_1.0 {
|
|
_rtld_thread_init;
|
|
_rtld_allocate_tls;
|
|
_rtld_free_tls;
|
|
_rtld_atfork_pre;
|
|
_rtld_atfork_post;
|
|
};
|