public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Fangrui Song <maskray@sourceware.org>
To: glibc-cvs@sourceware.org
Subject: [glibc/maskray/grte] Revert "Add a workaround for lld placing the _GLOBAL_OFFSET_TABLE_ at an unexpected location"
Date: Fri, 27 Aug 2021 00:43:33 +0000 (GMT)	[thread overview]
Message-ID: <20210827004333.4B2DB385842B@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=81f61b22f0312af3d411fea7ea2d9b882952264c

commit 81f61b22f0312af3d411fea7ea2d9b882952264c
Author: Fangrui Song <i@maskray.me>
Date:   Thu Aug 26 17:35:02 2021 -0700

    Revert "Add a workaround for lld placing the _GLOBAL_OFFSET_TABLE_ at an unexpected location"
    
    This reverts commit 575707c22f901b0adcce2478cc32da62afff287e.
    
    The issue has been fixed by LLD patch https://reviews.llvm.org/D59594
    and fixed by glibc upstream as well.

Diff:
---
 elf/rtld.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/elf/rtld.c b/elf/rtld.c
index 9d951f2466..498d9f5861 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -519,16 +519,6 @@ _dl_start (void *arg)
 
   /* Read our own dynamic section and fill in the info array.  */
   bootstrap_map.l_ld = (void *) bootstrap_map.l_addr + elf_machine_dynamic ();
-  /* As a workaround for lld placing _GLOBAL_OFFSET_TABLE at an
-     unexpected location, detect when the bootstrap map base and
-     dynamic section have the same address, and patch the base value
-     back to something plausible.  This is probably x86_64-specific,
-     and should go away once lld does the right thing.  */
-#ifdef HAVE_EHDR_START
-  extern const ElfW(Ehdr) __ehdr_start __attribute__ ((visibility ("hidden")));
-  if (bootstrap_map.l_ld == ((void *) bootstrap_map.l_addr))
-    bootstrap_map.l_addr -= (((char *) bootstrap_map.l_addr) - ((char *) &__ehdr_start));
-#endif
   elf_get_dynamic_info (&bootstrap_map, NULL);
 
 #if NO_TLS_OFFSET != 0


                 reply	other threads:[~2021-08-27  0:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20210827004333.4B2DB385842B@sourceware.org \
    --to=maskray@sourceware.org \
    --cc=glibc-cvs@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).