ld-ifunc non-PIC tests
authorAlan Modra <amodra@gmail.com>
Sun, 12 Nov 2017 07:11:50 +0000 (17:41 +1030)
committerAlan Modra <amodra@gmail.com>
Tue, 14 Nov 2017 09:23:35 +0000 (19:53 +1030)
* testsuite/ld-ifunc/ifunc.exp: Ensure non-PIC tests are really
not PIE by default gcc options.

ld/ChangeLog
ld/testsuite/ld-ifunc/ifunc.exp

index 16786d7020c263218da7101e79b8a8ee48197bc4..634c9903c0714de2295709bea46e36c33f9453cd 100644 (file)
@@ -1,3 +1,8 @@
+2017-11-14  Alan Modra  <amodra@gmail.com>
+
+       * testsuite/ld-ifunc/ifunc.exp: Ensure non-PIC tests are really
+       not PIE by default gcc options.
+
 2017-11-13  H.J. Lu  <hongjiu.lu@intel.com>
 
        * emultempl/ppc32elf.em (ppc_before_allocation): Replace
index 9445f9f233325db61fefe6874b0226fb86269c45..4ef66edf2eadae9317ad2b15c23bdd3e3c3f0115 100644 (file)
@@ -164,7 +164,7 @@ if ![ld_compile "$CC -c -fPIC" "$srcdir/$subdir/prog.c" "tmpdir/shared_prog.o"]
     fail "Could not create a PIC object file"
     set fails [expr $fails + 1]
 }
-if ![ld_compile "$CC -c" "$srcdir/$subdir/prog.c" "tmpdir/static_prog.o"] {
+if ![ld_compile "$CC -c $NOPIE_CFLAGS" "$srcdir/$subdir/prog.c" "tmpdir/static_prog.o"] {
     fail "Could not create a non-PIC object file"
     set fails [expr $fails + 1]
 }
@@ -172,7 +172,7 @@ if ![ld_compile "$CC -c -fPIC -DWITH_IFUNC" "$srcdir/$subdir/lib.c" "tmpdir/shar
     fail "Could not create a PIC object file containing an IFUNC symbol"
     set fails [expr $fails + 1]
 }
-if ![ld_compile "$CC -c -DWITH_IFUNC" "$srcdir/$subdir/lib.c" "tmpdir/static_ifunc.o"] {
+if ![ld_compile "$CC -c $NOPIE_CFLAGS -DWITH_IFUNC" "$srcdir/$subdir/lib.c" "tmpdir/static_ifunc.o"] {
     fail "Could not create a non-PIC object file containing an IFUNC symbol"
     set fails [expr $fails + 1]
 }
@@ -214,7 +214,7 @@ if ![ld_link $CC "tmpdir/dynamic_prog" "-Wl,--no-as-needed,-rpath=./tmpdir,-Bdyn
     fail "Could not link a dynamic executable"
     set fails [expr $fails + 1]
 }
-if ![ld_link $CC "tmpdir/local_prog" "-Wl,--no-as-needed,-rpath=./tmpdir -Ltmpdir tmpdir/static_prog.o -lifunc"] {
+if ![ld_link $CC "tmpdir/local_prog" "$NOPIE_LDFLAGS -Wl,--no-as-needed,-rpath=./tmpdir -Ltmpdir tmpdir/static_prog.o -lifunc"] {
     fail "Could not link a dynamic executable using local ifunc"
     set fails [expr $fails + 1]
 }