PowerPC gcc bootstrap fail with bss-plt
authorAlan Modra <amodra@gmail.com>
Fri, 16 Aug 2019 03:50:28 +0000 (13:20 +0930)
committerAlan Modra <amodra@gmail.com>
Fri, 16 Aug 2019 04:08:11 +0000 (13:38 +0930)
git commit 3e04d7655b introduced a bug by sizing output sections
earlier in ppc_before_allocation.  That meant PLT (and GOT) sizes were
not included when calculating total executable section sizes.

* emultempl/ppc32elf.em (ppc_before_allocation): Force running
prelim_size_sections before deciding whether branch trampolines
might be needed.

ld/ChangeLog
ld/emultempl/ppc32elf.em

index 0366b833b7fbfbce95970a904f222b284f607b7b..de8e1b92e4f2c15c3f09e060ffb54059b54b4e04 100644 (file)
@@ -1,3 +1,9 @@
+2019-08-16  Alan Modra  <amodra@gmail.com>
+
+       * emultempl/ppc32elf.em (ppc_before_allocation): Force running
+       prelim_size_sections before deciding whether branch trampolines
+       might be needed.
+
 2019-08-15  Jim Wilson  <jimw@sifive.com>
 
        * testsuite/ld-riscv-elf/c-lui-2.d: New.
index 5387ef1a6c8c3c737212e591b26ca7340b600528..24a6368e174ea2b122c403be35f3c17b1f4840ce 100644 (file)
@@ -171,7 +171,12 @@ ppc_before_allocation (void)
       bfd_vma high = 0;
       asection *o;
 
-      /* Run lang_size_sections (if not already done).  */
+      /* Run lang_size_sections even if already done, so as to pick
+        up gld${EMULATION_NAME}_before_allocation sizing.  This
+        matters when we have an executable bss plt which will
+        typically be laid out near the end of the image, ie. worst
+        case for branches at the start of .text.  */
+      expld.phase = lang_first_phase_enum;
       prelim_size_sections ();
 
       for (o = link_info.output_bfd->sections; o != NULL; o = o->next)
This page took 0.025879 seconds and 4 git commands to generate.