This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PR22263 testcase


A number of targets need dynamic relocs in PIEs for reasons other than
relocating thread variables.  The PR is about text relocations, and,
reading between the lines, unnecessary dynamic tprel relocations.
Change the test to check for those conditions rather than no dynamic
relocations

This patch fixes fails on powerpc-linux and powerpc64-linux.

	PR ld/22263
	* testsuite/ld-elf/tls.exp: Link with -z text.
	* testsuite/ld-elf/pr22263-1.rd: Test for tprel relocs.

diff --git a/ld/testsuite/ld-elf/pr22263-1.rd b/ld/testsuite/ld-elf/pr22263-1.rd
index 9a583fb..f29f7fe 100644
--- a/ld/testsuite/ld-elf/pr22263-1.rd
+++ b/ld/testsuite/ld-elf/pr22263-1.rd
@@ -1,2 +1,5 @@
-
-There are no relocations in this file.
+# tprel relocs are not needed in a PIE
+#failif
+#...
+.* R_.*_TP.*
+#pass
diff --git a/ld/testsuite/ld-elf/tls.exp b/ld/testsuite/ld-elf/tls.exp
index 9d64d6c..dd24071 100644
--- a/ld/testsuite/ld-elf/tls.exp
+++ b/ld/testsuite/ld-elf/tls.exp
@@ -40,7 +40,7 @@ if { [which $CC] == 0 } {
 run_ld_link_tests [list \
     [list \
 	"Build pr22263-1" \
-	"-pie -e _start" \
+	"-pie -e _start -z text" \
 	"" \
 	"" \
 	{ pr22263-1a.c pr22263-1b.c } \

-- 
Alan Modra
Australia Development Lab, IBM


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]