public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* PR28827 - [2.38 Regression] ld hits assertion building LLVM 9 on powerpc64le-linux-gnu
@ 2022-02-04 11:06 Alan Modra
  2022-02-04 14:36 ` H.J. Lu
  0 siblings, 1 reply; 2+ messages in thread
From: Alan Modra @ 2022-02-04 11:06 UTC (permalink / raw)
  To: Nick Clifton, H.J. Lu, binutils

Hi Nick, HJ,
I've spent most of today debugging a build of libclang-cpp.so.9 using
the binutils 2.38 release branch.  The problem occurs after only a few
iterations of stub sizing, so all the patches I already committed for
potential bugs when we hit 20 iteration don't so anything as far as
actually linking the real object files.

The problem is caused by the new relro code introducing a gap at the
end of the relro segment.  On powerpc64 that means between the .got
and .plt section.  That gap changes when .eh_frame shrinks after
consolidating CIEs and garbage collecting unused FDEs, which happens
after the stub sizing passes are run from ldemul_after_allocation.
Unfortunately, if the .got/.plt gap increases, plt call stubs may need
to be larger to access addresses in the PLT from the toc pointer reg
and thus not fit in space allocated for them.

Please revert the relro patches on the branch.  I'm now certain that
PR28827 is directly caused by them.

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: PR28827 - [2.38 Regression] ld hits assertion building LLVM 9 on powerpc64le-linux-gnu
  2022-02-04 11:06 PR28827 - [2.38 Regression] ld hits assertion building LLVM 9 on powerpc64le-linux-gnu Alan Modra
@ 2022-02-04 14:36 ` H.J. Lu
  0 siblings, 0 replies; 2+ messages in thread
From: H.J. Lu @ 2022-02-04 14:36 UTC (permalink / raw)
  To: Alan Modra; +Cc: Nick Clifton, Binutils

On Fri, Feb 4, 2022 at 3:06 AM Alan Modra <amodra@gmail.com> wrote:
>
> Hi Nick, HJ,
> I've spent most of today debugging a build of libclang-cpp.so.9 using
> the binutils 2.38 release branch.  The problem occurs after only a few
> iterations of stub sizing, so all the patches I already committed for
> potential bugs when we hit 20 iteration don't so anything as far as
> actually linking the real object files.
>
> The problem is caused by the new relro code introducing a gap at the
> end of the relro segment.  On powerpc64 that means between the .got
> and .plt section.  That gap changes when .eh_frame shrinks after
> consolidating CIEs and garbage collecting unused FDEs, which happens
> after the stub sizing passes are run from ldemul_after_allocation.
> Unfortunately, if the .got/.plt gap increases, plt call stubs may need
> to be larger to access addresses in the PLT from the toc pointer reg
> and thus not fit in space allocated for them.

I ran into similar issues when I was implementing DT_RELR on x86.
I added size_relative_relocs and finish_relative_relocs hooks to
resolve them.

> Please revert the relro patches on the branch.  I'm now certain that
> PR28827 is directly caused by them.

I submit a patch to remove the 1-page gap only for x86:

https://sourceware.org/pipermail/binutils/2022-February/119625.html

-- 
H.J.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-02-04 14:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-04 11:06 PR28827 - [2.38 Regression] ld hits assertion building LLVM 9 on powerpc64le-linux-gnu Alan Modra
2022-02-04 14:36 ` H.J. Lu

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).