ld testsuite fixes for alpha
[deliverable/binutils-gdb.git] / ld / testsuite / ld-ifunc / ifunc.exp
index 5fee56d3bf60a6e3cfcd4edeaaa91fc98d0aa5a2..08cc87875c740fabb3e09e6737131832f6a9b7e5 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-2020 Free Software Foundation, Inc.
 #   Contributed by Red Hat.
 #
 # This file is part of the GNU Binutils.
 # Written by Nick Clifton <nickc@redhat.com>
 
 
-# IFUNC support has only been implemented for the ix86, x86_64, powerpc,
-# aarch64, sparc, and S/390 so far.
-if {!(([istarget "i?86-*-*"]
-       || [istarget "x86_64-*-*"]
-       || [istarget "powerpc*-*-*"]
-       || [istarget "aarch64*-*-*"]
-       || [istarget "sparc*-*-*"]
-       || [istarget "s390*-*-*"])
-      && ([istarget "*-*-elf*"]
-         || [istarget "*-*-nacl*"]
-         || [istarget "*-*-linux*"]
-         || [istarget "*-*-gnu*"])) } {
+if { ![is_elf_format] || ![supports_gnu_osabi]
+     || [istarget alpha-*-*]
+     || [istarget arc*-*-*]
+     || [istarget am33*-*-*]
+     || [istarget bfin-*-*]
+     || [istarget cris*-*-*]
+     || [istarget frv-*-*]
+     || [istarget lm32-*-*]
+     || [istarget m32r-*-*]
+     || [istarget m68k-*-*]
+     || [istarget microblaze-*-*]
+     || [istarget mips*-*-*]
+     || [istarget mn10300-*-*]
+     || [istarget nds32*-*-*]
+     || [istarget nios2-*-*]
+     || [istarget or1k-*-*]
+     || [istarget riscv*-*-*]
+     || [istarget score*-*-*]
+     || [istarget sh*-*-*]
+     || [istarget tic6x-*-*]
+     || [istarget tile*-*-*]
+     || [istarget vax-*-*] } {
     verbose "IFUNC tests not run - target does not support IFUNC"
     return
 }
@@ -45,6 +55,11 @@ if ![check_shared_lib_support] {
     return
 }
 
+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"
 
@@ -57,7 +72,7 @@ foreach t $test_list {
 
 # We need a working compiler.  (Strictly speaking this is
 # not true, we could use target specific assembler files).
-if { [which $CC] == 0 } {
+if { ![check_compiler_available] } {
     verbose "IFUNC tests not run - no compiler available"
     return
 }
@@ -133,7 +148,7 @@ proc contains_irelative_reloc { binary_file } {
     #    080496f4  0000002a R_386_IRELATIVE
 
 
-    if { ![regexp "\[0-9a-f\]+\[ \]+\[0-9a-f\]+\[ \]+R_\[_0-9A-Z\]+_IREL(|ATIVE)\[ \]*\[0-9a-f\]*\n" [file_contents readelf.out]] } {
+    if { ![regexp "\[0-9a-f\]+\[ \]+\[0-9a-f\]+\[ \]+R_(\[_0-9A-Z\]+_IREL(|ATIVE)|PARISC_IPLT)\[ \]*\[0-9a-f\]*\n" [file_contents readelf.out]] } {
        return 0
     }
 
@@ -262,8 +277,8 @@ if { $fails == 0 } {
 # ifunc should have an OSABI field of GNU.  The linked non-ifunc using
 # executable should have an OSABI field of NONE (aka System V).
 
-case $target_triplet in {
-    { hppa*-*-linux* } { set expected_none {UNIX - GNU} }
+switch -glob $target_triplet {
+    hppa*-*-linux* { set expected_none {UNIX - GNU} }
     default { set expected_none {UNIX - System V} }
 }
 
@@ -713,7 +728,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 "aarch64*-*-*"]) } {
+     && !([istarget "powerpc-*-*"]
+           || [istarget "aarch64*-*-*"]
+           || [istarget "sparc*-*-*"]) } {
 run_ld_link_exec_tests [list \
     [list \
        "Run pr23169a" \
@@ -769,4 +786,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.02537 seconds and 4 git commands to generate.