# 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
}
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"
# 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
}
# 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
}
# 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} }
}
# 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" \
"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"