]> git.ipfire.org Git - thirdparty/glibc.git/commit
elf: Support DT_RELR relative relocation format [BZ #27924] maskray/relr
authorFangrui Song <maskray@google.com>
Wed, 9 Mar 2022 01:17:05 +0000 (17:17 -0800)
committerFangrui Song <maskray@google.com>
Wed, 9 Mar 2022 01:17:05 +0000 (17:17 -0800)
commit1c6cc29baf9a4c7129ab2e94b0d4022bfa4f3299
tree008312335cd84ecfcc73c38b72ba836d06e3ca2f
parentedc696a73a7cb07b1aa68792a845a98d036ee7eb
elf: Support DT_RELR relative relocation format [BZ #27924]

PIE and shared objects usually have many relative relocations. In
2017/2018, SHT_RELR/DT_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.

This patch adds ELF_DYNAMIC_DO_RELR to ELF_DYNAMIC_RELOCATE.
ELF_DYNAMIC_DO_RELR is ordered before ELF_DYNAMIC_DO_REL[A] so that ifunc
resolvers that require relocated got entries have them relocated. This is
needed for ppc64 according to Alan Modra.
configure
configure.ac
elf/Makefile
elf/dynamic-link.h
elf/elf.h
elf/get-dynamic-info.h
elf/tst-relr-no-pie.c [new file with mode: 0644]
elf/tst-relr.c [new file with mode: 0644]