[PATCH 3/7] Add GLIBC_ABI_DT_RELR for DT_RELR support
H.J. Lu
hjl.tools@gmail.com
Fri Feb 4 21:08:41 GMT 2022
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.
RELR should be enabled only if there is a linker which supports
-z pack-relative-relocs. That is the main reason why RELR is
enabled in glibc 2.35.
> 2. Build glibc to use RELR relocations in its own executables and shared
> libraries based on an architecture-independent configure test for whether
> linker support is present.
This is implemented in
commit 486531c29b0fa48287b29ea20e805bee1ec19a67
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Sat Jan 22 05:44:45 2022 -0800
Add --disable-default-dt-relr
which is similar to --disable-default-pie.
> And avoid any architecture-specific conditional relating to RELR support
> in glibc completely.
>
> *If* it turns out to be hard to have a fully reliable
> architecture-independent configure test for linker support, and the
> architecture-independent test reports linker support to be present (in an
> actual binutils release, not just the development mainline) for an
> architecture where that support is in fact buggy and incomplete, then we
> might consider adding an architecture-specific test on that architecture
> to disable building glibc to use RELR relocations with the buggy linker
> version. That is, architecture-specific tests would only be to disable
> building glibc to use RELR relocations, not to enable it, and only when
> the bugs in linker support on that architecture can't readily be detected
> by an architecture-independent test. The default for all existing and
> future architectures would be to follow the results of the
> architecture-independent configure test.
--
H.J.
More information about the Libc-alpha
mailing list