[committed] Fix failure of --gc-sections with __start_SECTIONNAME on hppa*-*-linux*

Message ID b411f602-f27f-9679-272d-86404535bb77@bell.net
State New
Headers show
Series
  • [committed] Fix failure of --gc-sections with __start_SECTIONNAME on hppa*-*-linux*
Related show

Commit Message

John David Anglin Oct. 19, 2019, 5:25 p.m.
This test started to fail on hppa*-*-linux*.  The default now is not to inline $$dyncall
when doing an indirect call.

This fix was provided by Alan.  It avoids the undefined symbol error.

Tested on hppa*-*-linux*.

Committed to trunk.

2019-10-19  Alan Modra  <amodra@gmail.com>

	PR ld/25110
	* testsuite/ld-gc/gc.exp: Adjust LDFLAGS for pr19161 dump test on
	hppa*-*-linux*.

Patch

diff --git a/ld/testsuite/ld-gc/gc.exp b/ld/testsuite/ld-gc/gc.exp
index fe50f31cda..f7915936fd 100644
--- a/ld/testsuite/ld-gc/gc.exp
+++ b/ld/testsuite/ld-gc/gc.exp
@@ -154,7 +154,12 @@  if { [check_compiler_available] } {
 if { [check_compiler_available] } {
     ld_compile "$CC $CFLAGS $cflags -O0" $srcdir/$subdir/pr19161-1.c tmpdir/pr19161-1.o
     ld_compile "$CC $CFLAGS $cflags -O0" $srcdir/$subdir/pr19161-2.c tmpdir/pr19161-2.o
+    set saved_LDFLAGS "$LDFLAGS"
+    if [istarget hppa*-*-linux*] {
+	set LDFLAGS "$LDFLAGS --defsym '\$\$dyncall=0'"
+    }
     run_dump_test "pr19161"
+    set LDFLAGS "$saved_LDFLAGS"
 }

 if { [is_elf_format] && [check_shared_lib_support] \