ld: vers19 test: add -rpath-link
[binutils-gdb.git] / ld / testsuite / ld-elfvers / vers.exp
index 9f85b835809ef41928225e3e2e10e68b684f7097..d1c2228dc96d59491dd4c64fdd6008f0ca3c2aaf 100644 (file)
@@ -29,35 +29,34 @@ if ![isnative] then {return}
 # This test can only be run on a couple of ELF platforms.
 # Square bracket expressions seem to confuse istarget.
 # This is similar to the test that is used in ld-shared, BTW.
-if { ![istarget hppa*64*-*-hpux*] \
-     && ![istarget hppa*-*-linux*] \
-     && ![istarget i?86-*-sysv4*] \
-     && ![istarget i?86-*-unixware] \
-     && ![istarget i?86-*-elf*] \
-     && ![istarget i?86-*-linux*] \
-     && ![istarget i?86-*-gnu*] \
-     && ![istarget ia64-*-elf*] \
-     && ![istarget ia64-*-linux*] \
-     && ![istarget m68k-*-linux*] \
-     && ![istarget mips*-*-irix5*] \
-     && ![istarget powerpc*-*-elf*] \
-     && ![istarget powerpc*-*-linux*] \
-     && ![istarget powerpc*-*-sysv4*] \
-     && ![istarget sparc*-*-elf] \
-     && ![istarget sparc*-*-solaris2*] \
-     && ![istarget sparc*-*-linux*] \
-     && ![istarget arm*-*-linux*] \
-     && ![istarget mips*-*-linux*] \
-     && ![istarget alpha*-*-linux*] \
-     && ![istarget s390*-*-linux*] \
-     && ![istarget sh\[34\]*-*-linux*] \
+if { ![istarget hppa*64*-*-hpux*]
+     && ![istarget hppa*-*-linux*]
+     && ![istarget i?86-*-sysv4*]
+     && ![istarget i?86-*-unixware]
+     && ![istarget i?86-*-elf*]
+     && ![istarget i?86-*-linux*]
+     && ![istarget i?86-*-gnu*]
+     && ![istarget ia64-*-elf*]
+     && ![istarget ia64-*-linux*]
+     && ![istarget m68k-*-linux*]
+     && ![istarget mips*-*-irix5*]
+     && ![istarget powerpc*-*-elf*]
+     && ![istarget powerpc*-*-linux*]
+     && ![istarget powerpc*-*-sysv4*]
+     && ![istarget sparc*-*-elf]
+     && ![istarget sparc*-*-solaris2*]
+     && ![istarget sparc*-*-linux*]
+     && ![istarget arm*-*-linux*]
+     && ![istarget mips*-*-linux*]
+     && ![istarget alpha*-*-linux*]
+     && ![istarget s390*-*-linux*]
+     && ![istarget sh\[34\]*-*-linux*]
      && ![istarget x86_64-*-linux*] } {
     return
 }
 
-if { [istarget i?86-*-linux*aout*] \
-     || [istarget i?86-*-linux*oldld*] \
-     || [istarget m68k-*-linux*aout*] } {
+if { [istarget *-*-linux*aout*]
+     || [istarget *-*-linux*oldld*] } {
     return
 }
 
@@ -84,9 +83,9 @@ if [istarget mips*-*-*] {
     catch "exec $CC $picflag" exec_output
     send_log "$exec_output\n"
     verbose "--" "$exec_output"
-    if { [string match "*illegal option*" $exec_output] \
-        || [string match "*option ignored*" $exec_output] \
-        || [string match "*unrecognized option*" $exec_output] \
+    if { [string match "*illegal option*" $exec_output]
+        || [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"
@@ -804,11 +803,11 @@ build_exec "vers3" vers3.c vers3 "" vers1.so vers3.ver vers3.dsym ""
 setup_xfail "mips*-*-*"
 build_exec "vers4" vers4.c vers4 "" "" "" "" vers4.sym
 
-build_exec "vers4a" vers4.c vers4a "-export-dynamic" "" vers4a.ver vers4a.dsym vers4a.sym
+build_exec "vers4a" vers4.c vers4a "-Wl,-export-dynamic" "" vers4a.ver vers4a.dsym vers4a.sym
 
 # Verify that --no-export-dynamic undoes the effect of --export-dynamic.
 setup_xfail "mips*-*-*"
-build_exec "vers4b" vers4.c vers4b "-export-dynamic -Wl,--no-export-dynamic" "" "" "" vers4.sym
+build_exec "vers4b" vers4.c vers4b "-Wl,-export-dynamic -Wl,--no-export-dynamic" "" "" "" vers4.sym
 
 
 #
@@ -849,7 +848,7 @@ build_vers_lib_pic "vers8" vers1.c vers8 vers8.map "" vers8.ver vers1.dsym vers1
 # This test tries to make sure that version references to versioned symbols
 # don't collide with default definitions with the same symbol.
 #
-build_exec "vers9" vers9.c vers9 "-export-dynamic" "" vers9.ver vers9.dsym vers9.sym
+build_exec "vers9" vers9.c vers9 "-Wl,-export-dynamic" "" vers9.ver vers9.dsym vers9.sym
 
 
 #
@@ -894,7 +893,7 @@ build_exec "vers16" vers16.c vers16 "" vers16a.so "" vers16.dsym ""
 # 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,." vers18.so vers19.ver vers19.dsym ""
+build_exec "vers19" vers19.c vers19 "-Wl,-rpath,. -Wl,-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