From 354bac403e9a19bbbfb676d854db5f11f0e84c27 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Fri, 13 Oct 2017 15:23:35 +1030 Subject: [PATCH] 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 PR ld/22263 * testsuite/ld-elf/tls.exp: Link with -z text. * testsuite/ld-elf/pr22263-1.rd: Test for tprel relocs. --- ld/ChangeLog | 6 ++++++ ld/testsuite/ld-elf/pr22263-1.rd | 7 +++++-- ld/testsuite/ld-elf/tls.exp | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ld/ChangeLog b/ld/ChangeLog index b0f7cd22569..47cc5a89b06 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,9 @@ +2017-10-13 Alan Modra + + PR ld/22263 + * testsuite/ld-elf/tls.exp: Link with -z text. + * testsuite/ld-elf/pr22263-1.rd: Test for tprel relocs. + 2017-10-12 H.J. Lu PR ld/22263 diff --git a/ld/testsuite/ld-elf/pr22263-1.rd b/ld/testsuite/ld-elf/pr22263-1.rd index 9a583fbfad4..f29f7fefd9e 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 9d64d6c19f4..dd240712627 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 } \ -- 2.30.2