Skip to content
Commit da683b1f authored by Fangrui Song's avatar Fangrui Song
Browse files

elf: Support DT_RELR relative relocation format

Adapted from
https://sourceware.org/pipermail/libc-alpha/2022-April/138085.html
([PATCH v11 0/7] Support DT_RELR relative relocation format),
which is expected to be included in glibc 2.36.

glibc 2.35 has a fair amount of rtld changes to avoid nested functions
(https://sourceware.org/PR27220). This patch is carefully crafted to
make the minimal changes.

Notebly, this commit

* works around b/208156916 by not bumping DT_NUM. DT_RELR and DT_RELRSZ
  take the l_info slots at DT_VERSYM+1 and DT_VERSYM+2.
* avoids changes to include/link.h
* removes the time travel compatibility check (error if DT_RELR is used
  without GLIBC_ABI_DT_RELR version need). This needs link.h change and
  the detected case cannot happen if we correctly use
  -Wl,-z,pack-relative-relocs.
parent d3c732cb
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment