d89d55087f
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 |
||
---|---|---|
.. | ||
aarch64 | ||
amd64 | ||
arm | ||
i386 | ||
mips | ||
powerpc | ||
powerpc64 | ||
riscv | ||
rtld-libc | ||
tests | ||
debug.c | ||
debug.h | ||
libmap.c | ||
libmap.conf | ||
libmap.h | ||
Makefile | ||
Makefile.depend | ||
map_object.c | ||
paths.h | ||
rtld_lock.c | ||
rtld_lock.h | ||
rtld_malloc.c | ||
rtld_malloc.h | ||
rtld_printf.c | ||
rtld_printf.h | ||
rtld_tls.h | ||
rtld_utrace.h | ||
rtld.1 | ||
rtld.c | ||
rtld.h | ||
Symbol.map | ||
xmalloc.c |