public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@linux-m68k.org>
To: Fangrui Song <maskray@google.com>
Cc: libc-alpha@sourceware.org,
	 Adhemerval Zanella <adhemerval.zanella@linaro.org>
Subject: Re: [PATCH] elf: Move post-relocation code of _dl_start into _dl_start_final
Date: Mon, 25 Apr 2022 17:14:12 +0200	[thread overview]
Message-ID: <87a6c95h6j.fsf@igel.home> (raw)
In-Reply-To: <20220424014529.347497-1-maskray@google.com> (Fangrui Song's message of "Sat, 23 Apr 2022 18:45:29 -0700")

On Apr 23 2022, Fangrui Song wrote:

> On non-PI_STATIC_AND_HIDDEN architectures, getting the address of
> _rtld_local_ro (for GLRO (dl_final_object)) goes through a GOT entry.
> The GOT load may be reordered before self relocation, leading to an
> unrelocated/incorrect _rtld_local_ro address.
>
> 84e02af1ebc9988126eebe60bf19226cea835623 tickled GCC powerpc32 to
> reorder the GOT load before relative relocations, leading to ld.so
> crash. This is similar to the m68k issue fixed by
> a8e9b5b8079d18116ca69c9797e77804ecf2ee7e.
>
> Move code after self relocation into _dl_start_final to avoid the
> reordering. This fixes powerpc32 and may help other architectures when
> ELF_DYNAMIC_RELOCATE is simplified in the future.

Ok.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

      reply	other threads:[~2022-04-25 15:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-24  1:45 Fangrui Song
2022-04-25 15:14 ` Andreas Schwab [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

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

  git send-email \
    --in-reply-to=87a6c95h6j.fsf@igel.home \
    --to=schwab@linux-m68k.org \
    --cc=adhemerval.zanella@linaro.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).