public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: Joseph Myers <joseph@codesourcery.com>
Cc: GNU C Library <libc-alpha@sourceware.org>
Subject: Re: [PATCH 3/7] Add GLIBC_ABI_DT_RELR for DT_RELR support
Date: Fri, 4 Feb 2022 13:08:41 -0800	[thread overview]
Message-ID: <CAMe9rOrLHvH6zHSG499vq1VHiz8oTer7njcOR9OshA6HyT=RVQ@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2202042056310.244210@digraph.polyomino.org.uk>

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.

  reply	other threads:[~2022-02-04 21:09 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-03 18:09 [PATCH 0/7] Support DT_RELR relative relocation format H.J. Lu
2022-02-03 18:09 ` [PATCH 1/7] elf: Support DT_RELR relative relocation format [BZ #27924] H.J. Lu
2022-02-03 18:09 ` [PATCH 2/7] elf: Properly handle zero DT_RELA/DT_REL values H.J. Lu
2022-02-03 18:09 ` [PATCH 3/7] Add GLIBC_ABI_DT_RELR for DT_RELR support H.J. Lu
2022-02-04 19:53   ` Joseph Myers
2022-02-04 20:04     ` H.J. Lu
2022-02-04 20:10       ` Joseph Myers
2022-02-04 20:40         ` H.J. Lu
2022-02-04 21:01           ` Joseph Myers
2022-02-04 21:08             ` H.J. Lu [this message]
2022-02-04 23:58               ` Joseph Myers
2022-02-05 17:24                 ` H.J. Lu
2022-02-03 18:09 ` [PATCH 4/7] x86/configure.ac: Define PI_STATIC_AND_HIDDEN/SUPPORT_STATIC_PIE H.J. Lu
2022-02-03 18:09 ` [PATCH 5/7] x86: Define SUPPORT_DT_RELR H.J. Lu
2022-02-03 18:09 ` [PATCH 6/7] Add --disable-default-dt-relr H.J. Lu
2022-02-03 18:09 ` [PATCH 7/7] NEWS: Mention DT_RELR support H.J. Lu
2022-02-04 20:00 ` [PATCH 0/7] Support DT_RELR relative relocation format Joseph Myers
2022-02-04 20:08   ` H.J. Lu
2022-02-04 20:12     ` Joseph Myers
2022-02-04 20:32   ` Fangrui Song

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMe9rOrLHvH6zHSG499vq1VHiz8oTer7njcOR9OshA6HyT=RVQ@mail.gmail.com' \
    --to=hjl.tools@gmail.com \
    --cc=joseph@codesourcery.com \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).