public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: wschmidt@linux.ibm.com, Fangrui Song <maskray@google.com>,
	Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>,
	Alan Modra <amodra@gmail.com>,
	Nemanja Ivanovic <nemanjai@ca.ibm.com>
Cc: libc-alpha@sourceware.org
Subject: Re: lld status with powerpc64
Date: Mon, 8 Nov 2021 10:54:39 -0300	[thread overview]
Message-ID: <544b1d1d-e9d2-b03b-a882-ec60848ddc68@linaro.org> (raw)
In-Reply-To: <889a40d5-5bb7-c0cd-2ebe-849c80a2780b@linux.ibm.com>



On 08/11/2021 10:26, Bill Schmidt wrote:
> On 11/8/21 5:37 AM, Adhemerval Zanella wrote:
>>
>> On 07/11/2021 11:24, Bill Schmidt wrote:
>>> Please coordinate with Alan Modra and Nemanja Ivanovic on this topic.  There are ongoing discussions about bfd and lld linker support around @notoc that will be resolved soon, and Tulio is on vacation, so I don't want the community to make steps they'll have to undo later, or for people to engage in duplicate work.
>> For this specific issue I just sent a patch to fix it on glibc side [1].
>> However I think it would be good if lld also implements the ld.bfd
>> optimization to fallback to older stub generation if no pcrel relocation
>> is found (although it is debatable that @notoc should implicit generate
>> older ISA code depending of the resulting objects being linked against).
>>
>> [1] https://patchwork.sourceware.org/project/glibc/patch/20211108113316.8867-1-adhemerval.zanella@linaro.org/
> 
> Hi Adhemerval,
> 
> Current course and speed is that @notoc will imply pcrel stubs on P10 and later,
> but will not do so on P9 and earlier.  The relocation currently associated with
> @notoc actually came with ELFv2 on P8 and, although no compilers ever generated 
> @notoc, assembly routines using it prior to P10 are a valid case and should not be
> punished.  This can be handled by generating a different reloc for @notoc in the
> two cases.
> 
> If this solution holds up, then changes to glibc should be unnecessary.

The main problem is this imposes an extra burden for the linker, where it 
need to implement the ld.bfd optimization to not generate the power10 stubs 
if no pcrel is found.  And it seems that lld does not yet support this
yes and I guess it has not been an issue because @notoc in assembly
routines should be rare. 

It also means that stubs generation are subject to a combination of
relocation on different objects (@notoc on assembly does not necessary
generate power10 stub with default linker option).  I think it should
be ok, although I see this as really confusing since it took some time
to figure out what ld.lfd was doing.

  reply	other threads:[~2021-11-08 13:54 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-26 20:03 [PATCH 0/3] Improve lld support and current status Adhemerval Zanella
2021-10-26 20:03 ` [PATCH 1/3] elf: Disable ifuncmain{1,5,5pic,5pie} when using LLD Adhemerval Zanella
2021-10-29 19:49   ` Fangrui Song
2021-10-26 20:03 ` [PATCH 2/3] Fix LIBC_PROG_BINUTILS for -fuse-ld=lld Adhemerval Zanella
2021-10-26 20:48   ` Fangrui Song
2021-10-27 11:42     ` Adhemerval Zanella
2021-10-26 20:03 ` [PATCH 3/3] Check if linker also support -mtls-dialect=gnu2 Adhemerval Zanella
2021-10-27  2:04   ` Fāng-ruì Sòng
2021-10-29  0:56     ` Fāng-ruì Sòng
2021-10-26 20:33 ` [PATCH 0/3] Improve lld support and current status Fangrui Song
2021-10-27 13:11   ` Adhemerval Zanella
2021-10-28  1:06     ` Fangrui Song
2021-10-28  1:18       ` Fangrui Song
2021-10-28 17:40         ` Adhemerval Zanella
2021-10-28 11:48       ` Adhemerval Zanella
2021-10-27 22:39   ` Tulio Magno Quites Machado Filho
2021-10-27 22:50     ` Tulio Magno Quites Machado Filho
2021-11-05  7:23       ` lld status with powerpc64 Fangrui Song
2021-11-05  7:45         ` Fangrui Song
2021-11-05 13:58         ` Adhemerval Zanella
2021-11-05 19:32           ` Adhemerval Zanella
2021-11-05 19:38             ` H.J. Lu
2021-11-05 19:40               ` H.J. Lu
2021-11-05 19:50               ` Fāng-ruì Sòng
2021-11-07 14:24           ` Bill Schmidt
2021-11-08 11:37             ` Adhemerval Zanella
2021-11-08 13:26               ` Bill Schmidt
2021-11-08 13:54                 ` Adhemerval Zanella [this message]
2021-11-08 13:59                   ` Bill Schmidt
2021-11-08 14:11                     ` Adhemerval Zanella
2021-11-08 14:12                       ` Bill Schmidt
     [not found]                       ` <OFD215FC7A.323066CE-ON00258787.0051DA95-00258787.00532945@ibm.com>
2021-11-08 22:38                         ` Fangrui Song
2021-11-09 12:20                           ` Adhemerval Zanella
2021-10-27 23:37     ` [PATCH 0/3] Improve lld support and current status Fangrui Song
2021-10-28 17:27       ` Tulio Magno Quites Machado Filho

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=544b1d1d-e9d2-b03b-a882-ec60848ddc68@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=amodra@gmail.com \
    --cc=libc-alpha@sourceware.org \
    --cc=maskray@google.com \
    --cc=nemanjai@ca.ibm.com \
    --cc=tuliom@linux.ibm.com \
    --cc=wschmidt@linux.ibm.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).