aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2017-11-14 18:47:34 +1030
committerAlan Modra <amodra@gmail.com>2017-11-14 20:43:55 +1030
commit06bcf5416feae129e239476ab1408e038bba171d (patch)
treeff1edac4b7a7e7e90a232d550aef6b5f9cd6f7c6 /ld
parent640d0ed874167d73b11dfbf5e838c65cc43e6a63 (diff)
downloadfsf-binutils-gdb-06bcf5416feae129e239476ab1408e038bba171d.zip
fsf-binutils-gdb-06bcf5416feae129e239476ab1408e038bba171d.tar.gz
fsf-binutils-gdb-06bcf5416feae129e239476ab1408e038bba171d.tar.bz2
PR22431, powerpc64 ld segfault when .plt discarded
The fix for the PR is to not use input_section->output_section->owner to get to the output bfd, but use the output bfd directly since it is available nowadays in struct bfd_link_info. I thought it worth warning when non-empty dynamic sections are discarded too, which meant a tweak to one of the ld tests to avoid the warning. bfd/ PR 22431 * elf64-ppc.c (ppc64_elf_size_dynamic_sections): Warn on discarding non-empty dynamic section. (ppc_build_one_stub): Take elf_gp from output bfd, not output section owner. (ppc_size_one_stub, ppc64_elf_next_toc_section): Likewise. ld/ * testsuite/ld-elf/note-3.t: Don't discard .got.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog4
-rw-r--r--ld/testsuite/ld-elf/note-3.t1
2 files changed, 5 insertions, 0 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 634c990..fe8603c 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,5 +1,9 @@
2017-11-14 Alan Modra <amodra@gmail.com>
+ * testsuite/ld-elf/note-3.t: Don't discard .got.
+
+2017-11-14 Alan Modra <amodra@gmail.com>
+
* testsuite/ld-ifunc/ifunc.exp: Ensure non-PIC tests are really
not PIE by default gcc options.
diff --git a/ld/testsuite/ld-elf/note-3.t b/ld/testsuite/ld-elf/note-3.t
index 47f3fe1..30ce59f 100644
--- a/ld/testsuite/ld-elf/note-3.t
+++ b/ld/testsuite/ld-elf/note-3.t
@@ -18,6 +18,7 @@ SECTIONS
.dynstr : { *(.dynstr) }
.dynsym : { *(.dynsym) }
+ .got : { *(.got .toc) *(.igot) }
.got.plt : { *(.got.plt) *(.igot.plt) }
/DISCARD/ : { *(*) }
}