public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: Fangrui Song <maskray@google.com>
Cc: GNU C Library <libc-alpha@sourceware.org>,
	Binutils <binutils@sourceware.org>
Subject: Re: [PATCH] elf: Support DT_RELR relative relocation format [BZ #27924]
Date: Fri, 8 Oct 2021 09:51:41 -0700	[thread overview]
Message-ID: <CAMe9rOpR+AevfRHEpu=iXcfQxsLQus6Cu25viR58D-utD=v5ng@mail.gmail.com> (raw)
In-Reply-To: <20211008065740.1485737-1-maskray@google.com>

On Thu, Oct 7, 2021 at 11:58 PM Fangrui Song via Binutils
<binutils@sourceware.org> wrote:
>
> PIC objects (especially PIE and symbolic shared objects) usually have many
> relative relocations. In 2017/2018, SHT_RELR/DT_RELR was proposed on
> https://groups.google.com/g/generic-abi/c/bX460iggiKg/m/GxjM0L-PBAAJ
> ("Proposal for a new section type SHT_RELR") and welcomed by many parties
> (including Solaris). This packed format can typically save 95% dynamic
> relocation section size for PIE. The vaddr size of a PIE can be 10% smaller.
>
> * Chrome OS folks have carried a local patch for a while (latest version:
>   https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/refs/heads/main/sys-libs/glibc/files/local/glibc-2.32).
>   I.e. this feature has been battle tested.
> * Android bionic supports DT_RELR.
> * The Linux kernel has supported CONFIG_RELR since 2019-08
>   (https://git.kernel.org/linus/5cf896fb6be3effd9aea455b22213e27be8bdb1d).
> * A musl patch (by me) exists but is not applied:
>   https://www.openwall.com/lists/musl/2019/03/06/3
>
> I believe upstream glibc should support DT_RELR to benefit all Linux
> distributions.
>
> As of linker support (to the best of my knowledge):
>
> * LLD support DT_RELR.
> * https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/refs/heads/main/sys-devel/binutils/files/
>   has a gold patch.
> * GNU ld feature request https://sourceware.org/bugzilla/show_bug.cgi?id=27923
>
> I wish that GNU ld and gold maintainers can implement the feature as well :)

This feature should be implemented in GNU linker first before getting
into glibc.


H.J.

  parent reply	other threads:[~2021-10-08 16:52 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-08  6:57 Fangrui Song
2021-10-08 15:39 ` Florian Weimer
2021-10-08 16:36   ` Fangrui Song
2021-10-08 19:41     ` Cary Coutant
2021-10-08 16:51 ` H.J. Lu [this message]
2021-10-08 17:37   ` Fangrui Song
2021-10-08 17:43     ` H.J. Lu
2021-10-08 18:46       ` Fangrui Song
2021-10-11  7:48 ` Jan Beulich
2021-10-11 18:43   ` Fāng-ruì Sòng
2021-10-11 22:08     ` Joseph Myers
2021-10-12  8:14       ` Jan Beulich
2021-10-12  8:18     ` Jan Beulich
2021-10-12 14:09       ` H.J. Lu
2021-10-12 16:07         ` Fāng-ruì Sòng
2021-10-13  6:00           ` Jan Beulich
2021-10-13  6:13             ` Fāng-ruì Sòng
2021-10-13  6:18               ` Fāng-ruì Sòng
2021-10-18  7:59                 ` Jan Beulich
2021-10-16 20:22   ` Fangrui Song
2021-10-26 23:28   ` Cary Coutant
2021-10-11 21:47 ` Joseph Myers

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='CAMe9rOpR+AevfRHEpu=iXcfQxsLQus6Cu25viR58D-utD=v5ng@mail.gmail.com' \
    --to=hjl.tools@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=libc-alpha@sourceware.org \
    --cc=maskray@google.com \
    /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).