HomeFreeBSD

rtld: Support DT_RELR relative relocation format

Description

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

Details

Provenance
fbsd-phab_maskray.meAuthored on Oct 16 2021, 9:34 PM
kibCommitted on Oct 16 2021, 11:37 PM
Differential Revision
D32524: rtld: Support DT_RELR relative relocation format
Parents
rG1cf06333160a: sys: Add definitions for RELR relative relocation format
Branches
Unknown
Tags
Unknown