# Expect script for ld-version tests
-# Copyright (C) 1997-2017 Free Software Foundation, Inc.
+# Copyright (C) 1997-2019 Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
#
#
-# This test can only be run if ld generates native executables.
-if ![isnative] then {return}
+# Check to see if the C compiler works
+if { ![check_compiler_available] } {
+ return
+}
# This test can only be run on a couple of ELF platforms.
# Square bracket expressions seem to confuse istarget.
return
}
-if { [istarget *-*-linux*aout*]
- || [istarget *-*-linux*oldld*] } {
- return
-}
-
if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
return
}
|| [string match "*option ignored*" $exec_output]
|| [string match "*unrecognized option*" $exec_output]
|| [string match "*passed to ld*" $exec_output] } {
- if [istarget *-*-sunos4*] {
- set picflag "-pic"
- } else {
- set picflag "-KPIC"
- }
+ set picflag "-KPIC"
}
}
set script_arg "$script $srcdir/$subdir/$mapfile"
}
- if {![ld_simple_link $ld $tmpdir/$libname.so "$shared $tmpdir/$libname.o $other_lib $script_arg $ldargs"]} {
+ if {![ld_link $ld $tmpdir/$libname.so "$shared $tmpdir/$libname.o $other_lib $script_arg $ldargs"]} {
fail "$test"
return
}
set script_arg "-Wl,$script $srcdir/$subdir/$mapfile"
}
- if {![ld_simple_link $CC $tmpdir/$execname "$tmpdir/$execname.o $other_lib $script_arg"]} {
+ if {![ld_link $CC $tmpdir/$execname "$tmpdir/$execname.o $other_lib $script_arg"]} {
pass "$test"
return
}
set solibname_lib $tmpdir/$solibname
}
- if {![ld_simple_link $CC $tmpdir/$execname "$flags $tmpdir/$execname.o $solibname_lib"]} {
+ if {![ld_link $CC $tmpdir/$execname "$flags $tmpdir/$execname.o $solibname_lib"]} {
fail "$test"
return
}
# Test a weak versioned symbol.
build_vers_lib_pic "vers17" vers17.c vers17 "" vers17.map vers17.ver vers17.dsym ""
build_vers_lib_pic "vers18" vers18.c vers18 vers17.so vers18.map vers18.ver vers18.dsym vers18.sym
-build_exec "vers19" vers19.c vers19 "-Wl,-rpath,. -Wl,-rpath-link,--no-as-needed" vers18.so vers19.ver vers19.dsym ""
+build_exec "vers19" vers19.c vers19 "-Wl,--no-as-needed,-rpath,.,-rpath-link,." vers18.so vers19.ver vers19.dsym ""
build_vers_lib_no_pic "vers20a" vers20.c vers20a "" vers20.map vers20a.ver vers20.dsym ""
exec cp $tmpdir/vers20a.so $tmpdir/vers20b.so