PR23169 bogus test

Alan Modra amodra@gmail.com
Tue Jun 26 11:55:00 GMT 2018


The testcase isn't valid.  If it happens to run on your target, you're
lucky.  I think PR23169 should have been closed as invalid rather than
HJ trying to fix it..

On powerpc we see segfaults due to attempting to go via the executable
PLT before it has been set up, and zero returned from resolve_func due
to the executable GOT not being relocated.  So disable the test for
powerpc.  It's likely that the test should be disabled on other
architectures too.

	PR 23169
	* testsuite/ld-ifunc/ifunc.exp: Don't run pr23169 tests on
	powerpc.  Comment.

diff --git a/ld/testsuite/ld-ifunc/ifunc.exp b/ld/testsuite/ld-ifunc/ifunc.exp
index dd3abd475a..612d91402f 100644
--- a/ld/testsuite/ld-ifunc/ifunc.exp
+++ b/ld/testsuite/ld-ifunc/ifunc.exp
@@ -702,6 +702,19 @@ run_ld_link_exec_tests [list \
 	"pr18841cn" \
 	"pr18841.out" \
     ] \
+]
+
+# The pr23169 testcase is not valid.  In general, you can't call ifunc
+# resolvers in another binary unless you know what you're doing.  In
+# particular you must ensure that the binary containing the resolver
+# is relocated before the resolver is called (for example, the
+# function addresses returned by the resolver may be loaded from the
+# GOT).
+# That does not happen for the pr23169 testcase where the resolver is
+# in the executable (which is relocated last by ld.so).
+if { [isnative]
+     && ![istarget "powerpc-*-*"] } {
+run_ld_link_exec_tests [list \
     [list \
 	"Run pr23169a" \
 	"$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/libpr23169a.so" \
@@ -756,4 +769,4 @@ run_ld_link_exec_tests [list \
 	"pass.out" \
 	"-fPIE -O2 -g" \
     ] \
-]
+]}

-- 
Alan Modra
Australia Development Lab, IBM



More information about the Binutils mailing list