From: "H.J. Lu" <hjl.tools@gmail.com>
To: Fangrui Song <maskray@google.com>,
Libc-stable Mailing List <libc-stable@sourceware.org>
Cc: GNU C Library <libc-alpha@sourceware.org>
Subject: Re: [PATCH] x86_64: Remove unneeded static PIE check for undefined weak diagnostic
Date: Thu, 8 Jul 2021 18:27:41 -0700 [thread overview]
Message-ID: <CAMe9rOrcsNFVdHd+_R9=0M+tZFJf8c-Cpq+tT5mNBz=dSrHf2g@mail.gmail.com> (raw)
In-Reply-To: <CAMe9rOq-PyTmudBofiuzgz+qTL1vo98H__1zMfsAgwL_K-Lt9A@mail.gmail.com>
On Thu, Jul 8, 2021 at 1:09 PM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> On Thu, Jul 8, 2021 at 12:51 PM Fangrui Song via Libc-alpha
> <libc-alpha@sourceware.org> wrote:
> >
> > https://sourceware.org/bugzilla/show_bug.cgi?id=21782 dropped an ld
> > diagnostic for R_X86_64_PC32 referencing an undefined weak symbol in
> > -pie links. Arguably keeping the diagnostic like other ports is more
> > correct, since statically resolving movl foo(%rip), %eax to the
> > link-time zero address produces a corrupted output.
> >
> > It turns out that --enable-static-pie builds do not depend on the ld
> > behavior. GCC generates GOT indirection for weak declarations for
> > -fPIE/-fPIC, so what ld does with the PC-relative relocation doesn't
> > really matter. I confirmed the argument with a --enable-static-pie build
> > with trunk LLD, whose -pie mode reports an error for `.weak foo; movl
> > foo(%rip), %eax`
> > (https://sourceware.org/bugzilla/show_bug.cgi?id=21782#c6
>
> I agree that
>
> https://sourceware.org/bugzilla/show_bug.cgi?id=21782
>
> was a false alarm for static PIE. This linker check isn't necessary.
>
> The patch is OK.
>
> Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
>
Please backlport it to release branches. Otherwise binutils 2.37 can't
build them.
Thanks.
--
H.J.
parent reply other threads:[~2021-07-09 1:28 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <CAMe9rOq-PyTmudBofiuzgz+qTL1vo98H__1zMfsAgwL_K-Lt9A@mail.gmail.com>]
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='CAMe9rOrcsNFVdHd+_R9=0M+tZFJf8c-Cpq+tT5mNBz=dSrHf2g@mail.gmail.com' \
--to=hjl.tools@gmail.com \
--cc=libc-alpha@sourceware.org \
--cc=libc-stable@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).