ld.so: Add support of DT_RELR relocation format.
commit395f920c0a29dd565a66b268ea00fc444ae64086
authorDmitry Chestnykh <dm.chestnykh@gmail.com>
Tue, 6 Feb 2024 06:13:41 +0000 (6 09:13 +0300)
committerWaldemar Brodkorb <wbx@openadk.org>
Wed, 7 Feb 2024 12:47:28 +0000 (7 13:47 +0100)
tree78e0c6905d3f98b1e53c5c562dea9f99c4e69983
parent0fef8e7e0661daa17a9ca17b087f55dcb752b378
ld.so: Add support of DT_RELR relocation format.

Nowadays modern libcs like Glibc and musl currently
support processing of RELATIVE relocations compressed
with DT_RELR format. However I have noticed that uClibc-ng
doesn't support this feature and if the source will be linked with
`-Wl,-z,pack-relative-relos` (bfd) or `-Wl,--pack-dyn-relocs=relr`
(lld) then ld.so cannot properly load the produced DSO.
This patch is intended to fix this issue and adds applying
of DT_RELR relative relocation.

Signed-off-by: Dmitry Chestnykh <dm.chestnykh@gmail.com>
include/elf.h
ldso/include/dl-elf.h
ldso/ldso/dl-elf.c
ldso/ldso/dl-startup.c
libc/misc/internals/reloc_static_pie.c