[PATCH 3/7] Add GLIBC_ABI_DT_RELR for DT_RELR support

Joseph Myers joseph@codesourcery.com
Fri Feb 4 23:58:05 GMT 2022


On Fri, 4 Feb 2022, H.J. Lu via Libc-alpha wrote:

> On Fri, Feb 4, 2022 at 1:01 PM Joseph Myers <joseph@codesourcery.com> wrote:
> >
> > On Fri, 4 Feb 2022, H.J. Lu via Libc-alpha wrote:
> >
> > > Good point.  How about "enable DT_RELR only if SUPPORT_DT_RELR is
> > > defined?  Currently, only x86 defines SUPPORT_DT_RELR.
> >
> > My preference would be:
> >
> > 1. Support user executables and shared libraries with RELR relocations
> > across all platforms, unconditionally.
> 
> RELR is kind of like static PIE.  Not all architectures support it.

My understanding is that analogy only applies to the static linker, not to 
glibc itself - that the static linker needs architecture-specific code, 
but glibc doesn't (as evidenced by the lack of any architecture-specific 
non-configure changes in this patch series).

> RELR should be enabled only if there is a linker which supports
> -z pack-relative-relocs.

(a) That should only apply to "enabled" in the sense of "glibc itself uses 
RELR relocations", not "glibc supports loading executables and shared 
libraries with such relocations".

(b) The configure test for that should be architecture-independent, with 
no architecture-specific configure changes needed at all.

-- 
Joseph S. Myers
joseph@codesourcery.com


More information about the Libc-alpha mailing list