]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
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>
Sat, 17 Aug 2019 08:46:53 +0000 (18:16 +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.

(cherry picked from commit 7df6aecc97b96843da080d54414052b1c954ddca)

ld/ChangeLog
ld/emultempl/ppc32elf.em

index 0704764dd29941788531bd8ef910f1ae7eb9ec4b..a05684b00dab286152ab7f83e35eceb156a7709e 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-07-25  Srinath Parvathaneni  <srinath.parvathaneni@arm.com>
 
        Backport from mainline
index 77143e753e5bb825b9bb2e26a0fe28c99a21dcbf..2e79175a1cef41db7033b594435091b40233ecce 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)