[PATCH 0/7] Support DT_RELR relative relocation format

Fangrui Song maskray@google.com
Fri Feb 4 20:32:00 GMT 2022


On 2022-02-04, Joseph Myers wrote:
>On Thu, 3 Feb 2022, H.J. Lu via Libc-alpha wrote:
>
>> DT_RELR is enabled in glibc shared libraries and position independent
>> executables (PIE) automatically if linker supports -z pack-relative-relocs
>> nd the architecture defines SUPPORT_DT_RELR in config.h.  At the moment,
>> only x86 targets define SUPPORT_DT_RELR.
>
>The patch 1 description says "This patch is simpler than Chrome OS's glibc
>patch and makes ELF_DYNAMIC_DO_RELR available to all ports.".
>
>What exactly would other architectures need to add in glibc to provide
>RELR support, since I don't see any actual architecture-specific code in
>this patch series outside of configure scripts?  Please provide text you
>would propose to add to https://sourceware.org/glibc/wiki/PortStatus that
>gives an architecture maintainer all the information needed to add such
>support for their architecture.  If in fact no architecture-specific code
>should be needed, please remove the SUPPORT_DT_RELR handling and just
>allow glibc to support the feature for all architectures (while using RELR
>in glibc itself for architectures where the linker support is present, as
>detected by a configure test on the linker rather than hardcoding
>information about which architectures have that linker support at a given
>time).
>
>The default should be to support a feature for all architectures.  A patch
>series supporting a feature for only some architectures needs a positive
>reason for excluding other architectures (for example, that each
>architecture needs architecture-specific code, for which you provide
>suitable documentation to add to PortStatus to help architecture
>maintainers in writing such code).

The patch series mix two things.

"elf: Support DT_RELR relative relocation format [BZ #27924]" allows
user programs to use DT_RELR. This is the main benefit.

AIUI the other patches are to allow x86-64 libc.so.6 to be built with
DT_RELR. This is more for dogfooding purposes and helps binutils port
maintainers confirm their ld.bfd support handles some uncommon cases
(glibc shared objects).

The second part needs a https://sourceware.org/glibc/wiki/PortStatus
entry.

---

(Personally I'd prefer separate patches.
But with some frustration on
https://sourceware.org/pipermail/libc-alpha/2021-November/133009.html
I don't care in what form glibc will get DT_RELR support...
and I really appreciate that H.J contributed the ld.bfd support and
drives this glibc effort.
)


More information about the Libc-alpha mailing list