Don't allow RELATIVE relocs in pr22269 testcase

Message ID
State New
Headers show
  • Don't allow RELATIVE relocs in pr22269 testcase
Related show

Commit Message

Alan Modra Oct. 22, 2019, 1:20 a.m.
At least, not in the GOT.  R_PPC64_RELATIVE is fine for powerpc64 in
the .opd section.

For my selection of targets with cross-compilers installed, results in:
arm-linuxeabi  +FAIL: pr22269-1 (static pie undefined weak)
m68k-linux  +FAIL: pr22269-1 (static pie undefined weak)
nios2-linux  +FAIL: pr22269-1 (static pie undefined weak)
s390-linux  -FAIL: Build pr22269-1
s390-linux  +FAIL: pr22269-1 (static pie undefined weak)
tilepro-linux  -FAIL: Build pr22269-1
tilepro-linux  +FAIL: pr22269-1 (static pie undefined weak)

	PR 22269
	* testsuite/ld-elf/pr22269-1.rd: Look for GOT section NONE and
	RELATIVE relocs.
	* testsuite/ld-elf/shared.exp (pr22269-1): Give test a better
	name.  Use -z nocombreloc.

Alan Modra
Australia Development Lab, IBM


diff --git a/ld/testsuite/ld-elf/pr22269-1.rd b/ld/testsuite/ld-elf/pr22269-1.rd
index 9df3c38581..afad19cf81 100644
--- a/ld/testsuite/ld-elf/pr22269-1.rd
+++ b/ld/testsuite/ld-elf/pr22269-1.rd
@@ -1,5 +1,7 @@ 
-# NONE relocs are not needed in a PIE.
+# There should not be any NONE or RELATIVE relocs for foo
-[0-9a-f]+ +[0-9a-f]+ +R_.*_NONE.*
+Relocation section '\.rela?\.got' .*
+ Offset +Info +Type .*
+[0-9a-f]+ +[0-9a-f]+ +R_.*_(NONE|RELATIVE).*
diff --git a/ld/testsuite/ld-elf/shared.exp b/ld/testsuite/ld-elf/shared.exp
index 820570084a..02ec6f3a1b 100644
--- a/ld/testsuite/ld-elf/shared.exp
+++ b/ld/testsuite/ld-elf/shared.exp
@@ -781,8 +781,8 @@  run_cc_link_tests $build_tests
 run_ld_link_tests [list \
     [list \
-	"Build pr22269-1" \
-	"-pie -e _start --no-dynamic-linker -z text" \
+	"pr22269-1 (static pie undefined weak)" \
+	"-pie -e _start --no-dynamic-linker -z text -z nocombreloc " \
 	"" \
 	{ pr22269-1.c } \