freebsd-dev/libexec/rtld-elf
Fangrui Song a7d137fcbc rtld: Support DT_RELR relative relocation format
PIE and shared objects usually have many relative relocations. In
2017/2018, a compact relative relocation format RELR was proposed on
https://groups.google.com/g/generic-abi/c/bX460iggiKg/m/GxjM0L-PBAAJ
("Proposal for a new section type SHT_RELR") and is a pre-standard.
RELR usually takes 3% or smaller space than R_*_RELATIVE relocations.
The virtual memory size of a mostly statically linked PIE is typically
5~10% smaller.

ld.lld --pack-dyn-relocs=relr emits RELR relocations. DT_RELR has been
adopted by Android bionic, Linux kernel's arm64 port, Chrome OS (patched
glibc).

This patch adds DT_RELR support to FreeBSD rtld-elf.

MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D32524
2021-10-17 02:37:13 +03:00
..
aarch64 rtld: Remove calculate_tls_end 2021-08-16 13:55:35 +03:00
amd64 rtld: Remove calculate_tls_end 2021-08-16 13:55:35 +03:00
arm rtld: rework how environment variables are named 2021-08-17 15:05:46 +03:00
i386 rtld: Remove calculate_tls_end 2021-08-16 13:55:35 +03:00
mips rtld: Remove calculate_tls_end 2021-08-16 13:55:35 +03:00
powerpc rtld: Remove calculate_tls_end 2021-08-16 13:55:35 +03:00
powerpc64 rtld: Remove calculate_tls_end 2021-08-16 13:55:35 +03:00
riscv rtld: Remove calculate_tls_end 2021-08-16 13:55:35 +03:00
rtld-libc rtld: provide private getenv(3) 2021-08-17 15:05:47 +03:00
tests rtld/tests: Avoid function name conflict with libc opendir() 2021-07-06 10:51:57 +01: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 rtld: constify most variables holding references to the environment values 2021-08-17 15:06:08 +03:00
libmap.conf Move libmap.conf to libexec/rtld-elf/ 2018-09-18 00:25:00 +00:00
libmap.h rtld: constify most variables holding references to the environment values 2021-08-17 15:06:08 +03:00
Makefile rtld: Do not install libmap.conf when installing the COMPAT32 version 2021-10-13 14:42:08 +02:00
Makefile.depend new depends 2015-06-16 23:37:19 +00:00
map_object.c rtld: Round down relro_size 2021-08-13 12:58:53 +03: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 rtld: initialize default dlerror_seen_val as true 2021-05-13 02:31:29 +03:00
rtld_lock.h rtld_lock.h: add some comments about versioning of struct RtldLockInfo 2021-04-11 11:16:13 +03:00
rtld_malloc.c crt_malloc: Be more persistent when handling mmap() failure 2021-10-13 02:37:09 +03: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 rtld direct exec: add -d option 2021-10-13 03:41:48 +03:00
rtld.c rtld: Support DT_RELR relative relocation format 2021-10-17 02:37:13 +03:00
rtld.h rtld: Support DT_RELR relative relocation format 2021-10-17 02:37:13 +03:00
Symbol.map rtld dl_iterate_phdr(): dlpi_tls_data is wrong 2021-04-06 03:23:08 +03:00
xmalloc.c Make p_vaddr % p_align == p_offset % p_align for (some) TLS segments. 2020-04-04 22:37:50 +00:00