aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-ifunc/ifunc.exp
diff options
context:
space:
mode:
Diffstat (limited to 'ld/testsuite/ld-ifunc/ifunc.exp')
-rw-r--r--ld/testsuite/ld-ifunc/ifunc.exp20
1 files changed, 13 insertions, 7 deletions
diff --git a/ld/testsuite/ld-ifunc/ifunc.exp b/ld/testsuite/ld-ifunc/ifunc.exp
index f67808c..63ab18d 100644
--- a/ld/testsuite/ld-ifunc/ifunc.exp
+++ b/ld/testsuite/ld-ifunc/ifunc.exp
@@ -182,24 +182,30 @@ proc contains_ifunc_reloc { binary_file } {
set fails 0
+# Disable LTO for these tests.
+set cc_cmd "$CC"
+if {[check_lto_available]} {
+ append cc_cmd " -fno-lto"
+}
+
# Create the object files, libraries and executables.
-if ![ld_compile "$CC -c -fPIC" "$srcdir/$subdir/prog.c" "tmpdir/shared_prog.o"] {
+if ![ld_compile "$cc_cmd -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 $NOPIE_CFLAGS" "$srcdir/$subdir/prog.c" "tmpdir/static_prog.o"] {
+if ![ld_compile "$cc_cmd -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]
}
-if ![ld_compile "$CC -c -fPIC -DWITH_IFUNC" "$srcdir/$subdir/lib.c" "tmpdir/shared_ifunc.o"] {
+if ![ld_compile "$cc_cmd -c -fPIC -DWITH_IFUNC" "$srcdir/$subdir/lib.c" "tmpdir/shared_ifunc.o"] {
fail "Could not create a PIC object file containing an IFUNC symbol"
set fails [expr $fails + 1]
}
-if ![ld_compile "$CC -c $NOPIE_CFLAGS -DWITH_IFUNC" "$srcdir/$subdir/lib.c" "tmpdir/static_ifunc.o"] {
+if ![ld_compile "$cc_cmd -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]
}
-if ![ld_compile "$CC -c -DWITHOUT_IFUNC" "$srcdir/$subdir/lib.c" "tmpdir/static_noifunc.o"] {
+if ![ld_compile "$cc_cmd -c -DWITHOUT_IFUNC" "$srcdir/$subdir/lib.c" "tmpdir/static_noifunc.o"] {
fail "Could not create an ordinary non-PIC object file"
set fails [expr $fails + 1]
}
@@ -207,11 +213,11 @@ if ![ld_assemble $as "$srcdir/ld-elf/empty.s" "tmpdir/empty.o"] {
fail "Could not create an empty object file"
set fails [expr $fails + 1]
}
-if ![ld_compile "$CC -c" "$srcdir/$subdir/test-1.c" "tmpdir/test-1.o"] {
+if ![ld_compile "$cc_cmd -c" "$srcdir/$subdir/test-1.c" "tmpdir/test-1.o"] {
fail "Could not create test-1.o"
set fails [expr $fails + 1]
}
-if ![ld_compile "$CC -fPIC -c" "$srcdir/$subdir/test-2.c" "tmpdir/test-2.o"] {
+if ![ld_compile "$cc_cmd -fPIC -c" "$srcdir/$subdir/test-2.c" "tmpdir/test-2.o"] {
fail "Could not create test-2.o"
set fails [expr $fails + 1]
}