freebsd-dev/libexec/rtld-elf
Konstantin Belousov d89d55087f Add version indicators to rtld.
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
2020-05-26 19:22:46 +00:00
..
aarch64 Align initial-exec TLS segments to the p_vaddr % align. 2020-04-19 09:28:59 +00:00
amd64 Align initial-exec TLS segments to the p_vaddr % align. 2020-04-19 09:28:59 +00:00
arm Move ARM specific flags to arm/Makefile.inc 2020-04-29 16:05:50 +00:00
i386 Align initial-exec TLS segments to the p_vaddr % align. 2020-04-19 09:28:59 +00:00
mips Align initial-exec TLS segments to the p_vaddr % align. 2020-04-19 09:28:59 +00:00
powerpc Align initial-exec TLS segments to the p_vaddr % align. 2020-04-19 09:28:59 +00:00
powerpc64 Align initial-exec TLS segments to the p_vaddr % align. 2020-04-19 09:28:59 +00:00
riscv Align initial-exec TLS segments to the p_vaddr % align. 2020-04-19 09:28:59 +00:00
rtld-libc Remove sparc64 specific parts of rtld-elf. 2020-02-26 18:49:25 +00:00
tests Fix regression tests broken by r337067. 2018-08-02 11:55:16 +00:00
debug.c libexec: adoption of SPDX licensing ID tags. 2017-11-27 15:25:02 +00:00
debug.h Use rtld_putstr() instead of write() for the rtld msg() macro 2019-06-26 15:43:26 +00:00
libmap.c Reduce size of rtld by 22% by pulling in less code from libc 2019-06-30 11:49:58 +00:00
libmap.conf Move libmap.conf to libexec/rtld-elf/ 2018-09-18 00:25:00 +00:00
libmap.h rtld-elf: make it compile with WARNS=3 2018-10-29 21:08:11 +00:00
Makefile Remove tests for obsolete compilers in the build system 2020-05-12 15:22:40 +00:00
Makefile.depend new depends 2015-06-16 23:37:19 +00:00
map_object.c Make p_vaddr % p_align == p_offset % p_align for (some) TLS segments. 2020-04-04 22:37:50 +00:00
paths.h rtld-elf: compile with WANRS=4 warnings other than -Wcast-align 2018-10-29 21:08:19 +00:00
rtld_lock.c Use sigfastblock(2) in rtld. 2020-02-09 12:22:43 +00:00
rtld_lock.h libexec: adoption of SPDX licensing ID tags. 2017-11-27 15:25:02 +00:00
rtld_malloc.c Remove remnants of optimization for > pagesize allocations. 2019-09-02 08:03:29 +00:00
rtld_malloc.h Add header file missed in r343564. 2019-01-29 22:45:24 +00:00
rtld_printf.c Reduce size of rtld by 22% by pulling in less code from libc 2019-06-30 11:49:58 +00:00
rtld_printf.h Use rtld_putstr() instead of write() for the rtld msg() macro 2019-06-26 15:43:26 +00:00
rtld_tls.h Remove sparc64 specific parts of rtld-elf. 2020-02-26 18:49:25 +00:00
rtld_utrace.h Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
rtld.1 Add version indicators to rtld. 2020-05-26 19:22:46 +00:00
rtld.c Add version indicators to rtld. 2020-05-26 19:22:46 +00:00
rtld.h Implement RTLD_DEEPBIND. 2020-05-15 11:58:01 +00:00
Symbol.map Add version indicators to rtld. 2020-05-26 19:22:46 +00:00
xmalloc.c Make p_vaddr % p_align == p_offset % p_align for (some) TLS segments. 2020-04-04 22:37:50 +00:00