aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2018-01-12 16:58:04 +1030
committerAlan Modra <amodra@gmail.com>2018-01-12 21:13:11 +1030
commit87e79a6515951fece72ee08871dd6e112b1042ba (patch)
tree5eb6fdaf187b68aaefffc2d705c9ba307c269751 /ld
parent58807c48a5a317ad3e2d39a8755168a3d4d5fdf8 (diff)
downloadgdb-87e79a6515951fece72ee08871dd6e112b1042ba.zip
gdb-87e79a6515951fece72ee08871dd6e112b1042ba.tar.gz
gdb-87e79a6515951fece72ee08871dd6e112b1042ba.tar.bz2
Fixes for "Ignore dynamic references on forced local symbols"
PowerPC64 has its own mark_dynamic_ref, which needs the same change as made by d664fd41e1 to the generic ELF version. Some other targets discard more than just .data, so allow for that too in expected ld messages. bfd/ PR ld/22649 * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Ignore dynamic references on forced local symbols. ld/ PR ld/22649 * testsuite/ld-elf/pr22649.msg: Allow other messages. * testsuite/ld-elf/shared.exp: Check that --gc-sections is supported before running ld/22649 tests.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog7
-rw-r--r--ld/testsuite/ld-elf/pr22649.msg2
-rw-r--r--ld/testsuite/ld-elf/shared.exp77
3 files changed, 50 insertions, 36 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index a2c13c8..39f79fe 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,10 @@
+2018-01-12 Alan Modra <amodra@gmail.com>
+
+ PR ld/22649
+ * testsuite/ld-elf/pr22649.msg: Allow other messages.
+ * testsuite/ld-elf/shared.exp: Check that --gc-sections is
+ supported before running ld/22649 tests.
+
2018-01-12 Nick Clifton <nickc@redhat.com>
* emultempl/elf32.em (_handle_option): Add support for "-z undefs"
diff --git a/ld/testsuite/ld-elf/pr22649.msg b/ld/testsuite/ld-elf/pr22649.msg
index b4e45bd..66b5f25 100644
--- a/ld/testsuite/ld-elf/pr22649.msg
+++ b/ld/testsuite/ld-elf/pr22649.msg
@@ -1 +1,3 @@
+#...
.*: Removing unused section '\.data' in file 'tmpdir/pr22649-2.*\.o'
+#pass
diff --git a/ld/testsuite/ld-elf/shared.exp b/ld/testsuite/ld-elf/shared.exp
index 1247fd2..5c4d78a 100644
--- a/ld/testsuite/ld-elf/shared.exp
+++ b/ld/testsuite/ld-elf/shared.exp
@@ -90,44 +90,49 @@ run_ld_link_tests [list \
{} \
"pr22649-1.so" \
] \
- [list \
- "Build pr22649-2a.so" \
- "$LFLAGS -shared -gc-sections -print-gc-sections" \
- "" \
- "$AFLAGS_PIC" \
- {pr22649-2a.s} \
- {{ld pr22649.msg}} \
- "pr22649-2a.so" \
- ] \
- [list \
- "Build pr22649-2b.so" \
- "$LFLAGS -shared -gc-sections -print-gc-sections" \
- "tmpdir/pr22649-1.so" \
- "$AFLAGS_PIC" \
- {pr22649-2a.s} \
- {{ld pr22649.msg}} \
- "pr22649-2b.so" \
- ] \
- [list \
- "Build pr22649-2c.so" \
- "$LFLAGS -shared -gc-sections -print-gc-sections" \
- "" \
- "$AFLAGS_PIC" \
- {pr22649-2b.s} \
- {} \
- "pr22649-2b.so" \
- ] \
- [list \
- "Build pr22649-2d.so" \
- "$LFLAGS -shared -gc-sections -print-gc-sections" \
- "tmpdir/pr22649-1.so" \
- "$AFLAGS_PIC" \
- {pr22649-2b.s} \
- {} \
- "pr22649-2b.so" \
- ] \
]
+if { [check_gc_sections_available] } {
+ run_ld_link_tests [list \
+ [list \
+ "Build pr22649-2a.so" \
+ "$LFLAGS -shared -gc-sections -print-gc-sections" \
+ "" \
+ "$AFLAGS_PIC" \
+ {pr22649-2a.s} \
+ {{ld pr22649.msg}} \
+ "pr22649-2a.so" \
+ ] \
+ [list \
+ "Build pr22649-2b.so" \
+ "$LFLAGS -shared -gc-sections -print-gc-sections" \
+ "tmpdir/pr22649-1.so" \
+ "$AFLAGS_PIC" \
+ {pr22649-2a.s} \
+ {{ld pr22649.msg}} \
+ "pr22649-2b.so" \
+ ] \
+ [list \
+ "Build pr22649-2c.so" \
+ "$LFLAGS -shared -gc-sections -print-gc-sections" \
+ "" \
+ "$AFLAGS_PIC" \
+ {pr22649-2b.s} \
+ {} \
+ "pr22649-2b.so" \
+ ] \
+ [list \
+ "Build pr22649-2d.so" \
+ "$LFLAGS -shared -gc-sections -print-gc-sections" \
+ "tmpdir/pr22649-1.so" \
+ "$AFLAGS_PIC" \
+ {pr22649-2b.s} \
+ {} \
+ "pr22649-2b.so" \
+ ] \
+ ]
+}
+
run_ld_link_tests [list \
[list \
"DT_TEXTREL in shared lib" \