unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: "Fāng-ruì Sòng via Libc-alpha" <libc-alpha@sourceware.org>
To: Siddhesh Poyarekar <siddhesh@gotplt.org>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH] csu: Skip ARCH_SETUP_IREL if _dl_relocate_static_pie applied IRELATIVE relocations [BZ #27164]
Date: Sun, 5 Sep 2021 23:30:25 -0700	[thread overview]
Message-ID: <CAFP8O3Kij_cwt+9CZWmA-TFBtYb4UP5UASUOzstkcQLJrht6vQ@mail.gmail.com> (raw)
In-Reply-To: <d3d115cb-ac1c-dd1c-d7b2-35b0414a7201@gotplt.org>

On Tue, Jul 13, 2021 at 7:15 PM Siddhesh Poyarekar <siddhesh@gotplt.org> wrote:
>
> On 7/14/21 4:36 AM, Fangrui Song wrote:
> > Please see the sentence from the first message
> > "In addition, this enables a future simplification to GNU ld: we can
> > drop a linker script difference between -no-pie and -pie."
> >
> > This is the only difference other than image base difference.
>
> I did see the first message and indeed, all messages in the thread
> before asking that question.  Perhaps my wording wasn't specific enough:
> what is the benefit to *users* of having those symbols in dynamic
> binaries?  If the only reason what you mentioned in your first email,
> then this patch proposes to add runtime overhead to make what is
> essentially a cosmetic difference to GNU ld.  That doesn't make sense.
>
> In that context, lld behaviour needs to be changed since it adds symbols
> specifically meant to enable ifunc resolution in non-pie static binaries
> to all generated binaries without any known benefit to end user
> applications.
>
> Siddhesh

Circling back... Finally I conceded and changed LLD 13.0.0 to not
define __rela_iplt_start/__rela_iplt_end for -pie, for the sake of
users.

For the record, Android bionic uses the same IRELATIVE code path for
both static non-pie and static pie.
They had to adapt to undefined __rela_iplt_start for static pie:
https://r.android.com/1809796

I described this issue in detail in a chapter of
https://maskray.me/blog/2021-09-05-build-glibc-with-lld

      reply	other threads:[~2021-09-06  6:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-08 22:10 [PATCH] csu: Skip ARCH_SETUP_IREL if _dl_relocate_static_pie applied IRELATIVE relocations [BZ #27164] Fangrui Song via Libc-alpha
2021-07-08 23:27 ` H.J. Lu via Libc-alpha
2021-07-12 14:08 ` Carlos O'Donell via Libc-alpha
2021-07-13  8:06   ` Fangrui Song via Libc-alpha
2021-07-13  8:33     ` Siddhesh Poyarekar
2021-07-13 23:06       ` Fangrui Song via Libc-alpha
2021-07-13 23:20         ` H.J. Lu via Libc-alpha
2021-07-13 23:31           ` Fāng-ruì Sòng via Libc-alpha
2021-07-13 23:47             ` H.J. Lu via Libc-alpha
2021-07-13 23:57               ` Fāng-ruì Sòng via Libc-alpha
2021-07-14  1:17                 ` H.J. Lu via Libc-alpha
2021-07-14  2:15         ` Siddhesh Poyarekar
2021-09-06  6:30           ` Fāng-ruì Sòng via Libc-alpha [this message]

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

  List information: https://www.gnu.org/software/libc/involved.html

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

  git send-email \
    --in-reply-to=CAFP8O3Kij_cwt+9CZWmA-TFBtYb4UP5UASUOzstkcQLJrht6vQ@mail.gmail.com \
    --to=libc-alpha@sourceware.org \
    --cc=maskray@google.com \
    --cc=siddhesh@gotplt.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).