ld: Add -static-pie tests
[deliverable/binutils-gdb.git] / ld / testsuite / ld-ifunc / ifunc.exp
index 612d91402fdd4e1e04d19fc57a1d4571da45dc22..e13b5615ff3e645a846f29ac4eab42eb981fa416 100644 (file)
@@ -1,6 +1,6 @@
 # Expect script for linker support of IFUNC symbols and relocations.
 #
-#   Copyright (C) 2009-2018 Free Software Foundation, Inc.
+#   Copyright (C) 2009-2019 Free Software Foundation, Inc.
 #   Contributed by Red Hat.
 #
 # This file is part of the GNU Binutils.
@@ -45,6 +45,12 @@ if ![check_shared_lib_support] {
     return
 }
 
+global ASFLAGS
+set saved_ASFLAGS "$ASFLAGS"
+if { [istarget "i?86-*-*"] || [istarget "x86_64-*-*"] } {
+    set ASFLAGS "$ASFLAGS -mx86-used-note=no"
+}
+
 # This test does not need a compiler...
 run_dump_test "ifuncmod5"
 
@@ -231,10 +237,10 @@ if ![string match "" $STATIC_LDFLAGS] {
        fail "Could not link a static executable"
        set fails [expr $fails + 1]
     }
-    if ![ld_link $ld "tmpdir/static_nonifunc_prog" "-static tmpdir/empty.o"] {
-       fail "Could not link a non-ifunc using static executable"
-       set fails [expr $fails + 1]
-    }
+}
+if ![ld_link $ld "tmpdir/static_nonifunc_prog" "-static tmpdir/empty.o"] {
+    fail "Could not link a non-ifunc using static executable"
+    set fails [expr $fails + 1]
 }
 if ![ld_link $CC "tmpdir/test-1" "-Wl,--no-as-needed,-rpath=./tmpdir tmpdir/test-1.o tmpdir/libshared_ifunc.so"] {
     fail "Could not link test-1"
@@ -713,7 +719,9 @@ run_ld_link_exec_tests [list \
 # 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-*-*"] } {
+     && !([istarget "powerpc-*-*"]
+           || [istarget "aarch64*-*-*"]
+           || [istarget "sparc*-*-*"]) } {
 run_ld_link_exec_tests [list \
     [list \
        "Run pr23169a" \
@@ -769,4 +777,20 @@ run_ld_link_exec_tests [list \
        "pass.out" \
        "-fPIE -O2 -g" \
     ] \
-]}
+]
+if { $STATIC_PIE_LDFLAGS != "" } then {
+    run_ld_link_exec_tests [list \
+       [list \
+           "Run pr23169g" \
+           "$STATIC_PIE_LDFLAGS" \
+           "" \
+           { pr23169a.c pr23169b.c pr23169c.c } \
+           "pr23169g" \
+           "pass.out" \
+           "-fPIE -O2 -g" \
+       ] \
+]
+}
+}
+
+set ASFLAGS "$saved_ASFLAGS"
This page took 0.024831 seconds and 4 git commands to generate.