6c255e9508
It is wrong to relate on __FreeBSD_version, either from include/param.h, kernel, or libc, to check for rtld features. Rtld might be from newer world than the running userspace. Add special private symbols exported by rtld itself, to indicate the changes in runtime behavior, and features that cannot be otherwise detected or deduced at runtime. Note that the symbols are not exported from libc, so they intentionally cannot be linked against, and exported from the private namespace from rtld. Consumers are required to use dlsym(3). For instance, for _rtld_version_laddr_offset, user should do ptr = dlsym(RTLD_DEFAULT, "_rtld_version_laddr_offset") or even ptr = dlvsym(RTLD_DEFAULT, "_rtld_version_laddr_offset", "FBSDprivate_1.0"); Non-null ptr means that the change is present. Also add _rtld_version__FreeBSD_version indicator to report the headers version used at time of the rtld build. Reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D24982
38 lines
548 B
Plaintext
38 lines
548 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;
|
|
};
|
|
|
|
FBSD_1.3 {
|
|
fdlopen;
|
|
};
|
|
|
|
FBSDprivate_1.0 {
|
|
_rtld_thread_init;
|
|
_rtld_allocate_tls;
|
|
_rtld_free_tls;
|
|
_rtld_atfork_pre;
|
|
_rtld_atfork_post;
|
|
_rtld_addr_phdr;
|
|
_rtld_get_stack_prot;
|
|
_rtld_is_dlopened;
|
|
_r_debug_postinit;
|
|
_rtld_version__FreeBSD_version;
|
|
_rtld_version_laddr_offset;
|
|
};
|