Dt_relr «VALIDATED»
Instead of storing a full record for every relocation, DT_RELR stores a base address and a bitmap. Each bit in the bitmap corresponds to a specific memory offset relative to that base.
: Google integrated DT_RELR support into the Bionic C library to improve application startup times and reduce APK sizes. dt_relr
: To run a binary with DT_RELR , the system's dynamic loader (e.g., glibc or musl ) must support it. In glibc , support was introduced to ensure binaries could be loaded on modern Linux distributions. Instead of storing a full record for every
DT_RELR is a masterclass in systems engineering. It identifies a specific pattern in data—high-density clustering—and applies a compression algorithm perfectly suited to it. By replacing a heavy, legacy data structure with an efficient bitmap, it solves one of the lingering inefficiencies of the ELF format. : To run a binary with DT_RELR ,
The dynamic linker’s job is memory-bound. Reading a 20MB relocation table from disk into memory takes time. With DT_RELR , that table might shrink to 2MB or less. The linker has to read less data, resulting in faster load times. Furthermore, the processing logic for a bitmap is computationally cheaper than iterating through a complex struct array, allowing the CPU to resolve symbols faster.
