[PATCH 0/7] Support DT_RELR relative relocation format

Joseph Myers joseph@codesourcery.com
Fri Feb 4 20:00:33 GMT 2022


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).

-- 
Joseph S. Myers
joseph@codesourcery.com


More information about the Libc-alpha mailing list