1 # Expect script for ld-version tests
2 # Copyright 1997, 1998, 1999, 2001, 2003 Free Software Foundation, Inc.
4 # This file is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 # Written by Eric Youngdale (eric@andante.jic.com)
22 # This test can only be run if ld generates native executables.
23 if ![isnative] then {return}
25 # This test can only be run on a couple of ELF platforms.
26 # Square bracket expressions seem to confuse istarget.
27 # This is similar to the test that is used in ld-shared, BTW.
28 if { ![istarget hppa*64*-*-hpux*] \
29 && ![istarget hppa*-*-linux*] \
30 && ![istarget i?86-*-sysv4*] \
31 && ![istarget i?86-*-unixware] \
32 && ![istarget i?86-*-elf*] \
33 && ![istarget i?86-*-linux*] \
34 && ![istarget ia64-*-elf*] \
35 && ![istarget ia64-*-linux*] \
36 && ![istarget m68k-*-linux*] \
37 && ![istarget mips*-*-irix5*] \
38 && ![istarget powerpc-*-elf*] \
39 && ![istarget powerpc-*-linux*] \
40 && ![istarget powerpc-*-sysv4*] \
41 && ![istarget sparc*-*-elf] \
42 && ![istarget sparc*-*-solaris2*] \
43 && ![istarget sparc*-*-linux*] \
44 && ![istarget arm*-*-linux*] \
45 && ![istarget mips*-*-linux*] \
46 && ![istarget alpha*-*-linux*] \
47 && ![istarget s390*-*-linux*] \
48 && ![istarget x86_64-*-linux*] } {
52 if { [istarget i?86-*-linux*aout*] \
53 || [istarget i?86-*-linux*oldld*] \
54 || [istarget m68k-*-linux*aout*] } {
58 if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
64 set VOBJDUMP_FLAGS --private-headers
65 set DOBJDUMP_FLAGS --dynamic-syms
66 set SOBJDUMP_FLAGS --syms
67 set shared "--shared --no-undefined-version"
68 set script --version-script
70 if [istarget mips*-*-*] {
73 # Unfortunately, the gcc argument is -fpic and the cc argument is
74 # -KPIC. We have to try both.
76 send_log "$CC $picflag\n"
77 verbose "$CC $picflag"
78 catch "exec $CC $picflag" exec_output
79 send_log "$exec_output\n"
80 verbose "--" "$exec_output"
81 if { [string match "*illegal option*" $exec_output] \
82 || [string match "*option ignored*" $exec_output] \
83 || [string match "*unrecognized option*" $exec_output] \
84 || [string match "*passed to ld*" $exec_output] } {
85 if [istarget *-*-sunos4*] {
93 proc test_ar { test lib object expect } {
101 verbose -log "$ar -cr $tmpdir/$lib $tmpdir/$object"
102 catch "exec $ar -cr $tmpdir/$lib $tmpdir/$object" exec_output
103 set exec_output [prune_warnings $exec_output]
104 if ![string match "" $exec_output] {
105 verbose -log "$exec_output"
110 verbose -log "$nm --print-armap $tmpdir/$lib | grep \" in \" | egrep \"VERS\\|bar\\|foo\" | sort > $tmpdir/nm.out"
112 catch "exec $nm --print-armap $tmpdir/$lib | grep \\\ in\\\ | egrep VERS\\\|bar\\\|foo | sort > $tmpdir/nm.out" exec_output
113 if [string match "" $exec_output] then {
114 catch "exec $diff $tmpdir/nm.out $srcdir/$subdir/$expect" exec_output
115 set exec_output [prune_warnings $exec_output]
116 if [string match "" $exec_output] then {
120 verbose -log "$exec_output"
125 verbose -log "$exec_output"
131 # objdump_emptysymstuff
132 # Check non-dynamic symbols and make sure there are none with '@'.
134 proc objdump_emptysymstuff { objdump object } {
135 global SOBJDUMP_FLAGS
136 global version_output
139 if ![info exists SOBJDUMP_FLAGS] { set SOBJDUMP_FLAGS "" }
141 verbose -log "$objdump $SOBJDUMP_FLAGS $object | sed -n /\@/p"
143 catch "exec $objdump $SOBJDUMP_FLAGS $object | sed -n /\@/p" exec_output
144 set exec_output [prune_warnings $exec_output]
145 if [string match "" $exec_output] then {
146 # We shouldn't get anything here.
149 # it is not normal to come here - we have no output to compare.
150 verbose -log "$exec_output"
151 verbose -log "objdump_emptysymstuff: did not expect any output from objdump"
158 # objdump_emptydynsymstuff
159 # Check dynamic symbols and make sure there are none with '@'.
161 proc objdump_emptydynsymstuff { objdump object } {
162 global DOBJDUMP_FLAGS
163 global version_output
166 if ![info exists VOBJDUMP_FLAGS] { set VOBJDUMP_FLAGS "" }
168 verbose -log "$objdump $DOBJDUMP_FLAGS $object | sed -n /VERS/p\\\;/show/p"
170 catch "exec $objdump $DOBJDUMP_FLAGS $object | sed -n /VERS/p\\\;/show/p" exec_output
171 set exec_output [prune_warnings $exec_output]
172 if [string match "" $exec_output] then {
173 # We shouldn't get anything here.
175 } else { if [string match "*objdump: *: not a dynamic object" $exec_output] then {
178 # it is not normal to come here - we have no output to compare.
179 verbose -log "$exec_output"
180 verbose -log "objdump_emptydynsymstuff: did not expect any output from objdump"
186 # objdump_emptyverstuff
187 # Make sure there is no version information
189 proc objdump_emptyverstuff { objdump object } {
190 global VOBJDUMP_FLAGS
191 global version_output
195 if {[which $objdump] == 0} then {
196 perror "$objdump does not exist"
200 if ![info exists VOBJDUMP_FLAGS] { set VOBJDUMP_FLAGS "" }
202 verbose -log "$objdump $VOBJDUMP_FLAGS $object | sed -n /Version/,\\\$p > $tmpdir/objdump.out"
204 catch "exec $objdump $VOBJDUMP_FLAGS $object | sed -n /Version/,\\\$p" exec_output
205 set exec_output [prune_warnings $exec_output]
206 if [string match "" $exec_output] then {
207 # it is normal to fail here - we have no output to compare.
209 } else { if { [string match "*libc*" $exec_output] } then {
210 # this probably means that there is version information in libc, so we
211 # can't really perform this test.
214 verbose -log "$exec_output"
215 verbose -log "objdump_emptyverstuff: did not expect any output from objdump"
223 # Dump non-dynamic symbol stuff and make sure that it is sane.
225 proc objdump_symstuff { objdump object expectfile } {
226 global SOBJDUMP_FLAGS
227 global version_output
231 if ![info exists SOBJDUMP_FLAGS] { set SOBJDUMP_FLAGS "" }
233 verbose -log "$objdump $SOBJDUMP_FLAGS $object | grep \@ | sort > $tmpdir/objdump.out"
235 catch "exec $objdump $SOBJDUMP_FLAGS $object | grep \@ | sort > $tmpdir/objdump.out" exec_output
236 set exec_output [prune_warnings $exec_output]
237 if [string match "" $exec_output] then {
239 # Now do a line-by-line comparison to effectively diff the darned things
240 # The stuff coming from the expectfile is actually a regex, so we can
241 # skip over the actual addresses and so forth. This is currently very
242 # simpleminded - it expects a one-to-one correspondence in terms of line
245 if [file exists $expectfile] then {
246 set file_a [open $expectfile r]
248 perror "$expectfile doesn't exist"
252 if [file exists $tmpdir/objdump.out] then {
253 set file_b [open $tmpdir/objdump.out r]
255 perror "$tmpdir/objdump.out doesn't exist"
259 verbose "# Diff'ing: $expectfile $tmpdir/objdump.out" 2
264 while { [gets $file_a line] != $eof } {
265 if [regexp "^#.*$" $line] then {
273 while { [gets $file_b line] != $eof } {
274 if [regexp "^#.*$" $line] then {
282 for { set i 0 } { $i < [llength $list_a] } { incr i } {
283 set line_a [lindex $list_a $i]
284 set line_b [lindex $list_b $i]
287 verbose "\t$expectfile: $i: $line_a" 3
288 verbose "\t/tmp/objdump.out: $i: $line_b" 3
289 if [regexp $line_a $line_b] then {
292 verbose -log "\t$expectfile: $i: $line_a"
293 verbose -log "\t$tmpdir/objdump.out: $i: $line_b"
299 if { [llength $list_a] != [llength $list_b] } {
300 verbose -log "Line count"
304 if $differences<1 then {
310 verbose -log "$exec_output"
317 # objdump_dymsymstuff
318 # Dump dynamic symbol stuff and make sure that it is sane.
320 proc objdump_dynsymstuff { objdump object expectfile } {
321 global DOBJDUMP_FLAGS
322 global version_output
326 if ![info exists DOBJDUMP_FLAGS] { set DOBJDUMP_FLAGS "" }
328 verbose -log "$objdump $DOBJDUMP_FLAGS $object | sed -n /VERS/p\\\;/show/p | sort | uniq > $tmpdir/objdump.out"
330 catch "exec $objdump $DOBJDUMP_FLAGS $object | sed -n /VERS/p\\\;/show/p | sort | uniq > $tmpdir/objdump.out" exec_output
331 set exec_output [prune_warnings $exec_output]
332 if [string match "" $exec_output] then {
334 # Now do a line-by-line comparison to effectively diff the darned things
335 # The stuff coming from the expectfile is actually a regex, so we can
336 # skip over the actual addresses and so forth. This is currently very
337 # simpleminded - it expects a one-to-one correspondence in terms of line
340 if [file exists $expectfile] then {
341 set file_a [open $expectfile r]
343 warning "$expectfile doesn't exist"
347 if [file exists $tmpdir/objdump.out] then {
348 set file_b [open $tmpdir/objdump.out r]
350 fail "$tmpdir/objdump.out doesn't exist"
354 verbose "# Diff'ing: $expectfile $tmpdir/objdump.out" 2
359 while { [gets $file_a line] != $eof } {
360 if [regexp "^#.*$" $line] then {
368 while { [gets $file_b line] != $eof } {
369 if [regexp "^#.*$" $line] then {
377 # Support empty files.
378 if { ![info exists list_a] && ![info exists list_b] } then {
382 for { set i 0 } { $i < [llength $list_b] } { incr i } {
383 set line_b [lindex $list_b $i]
385 # The tests are rigged so that we should never export a symbol with the
386 # word 'hide' in it. Thus we just search for it, and bail if we find it.
387 if [regexp "hide" $line_b] then {
388 verbose -log "\t$tmpdir/objdump.out: $i: $line_b"
393 verbose "\t$expectfile: $i: $line_b" 3
395 # We can't assume that the sort is consistent across
396 # systems, so we must check each regexp. When we find a
397 # regexp, we null it out, so we don't match it twice.
398 for { set j 0 } { $j < [llength $list_a] } { incr j } {
399 set line_a [lindex $list_a $j]
401 if [regexp $line_a $line_b] then {
402 lreplace $list_a $j $j "CAN NOT MATCH"
407 if { $j >= [llength $list_a] } {
408 verbose -log "\t$tmpdir/objdump.out: $i: $line_b"
414 if { [llength $list_a] != [llength $list_b] } {
415 verbose -log "Line count"
419 if $differences<1 then {
425 verbose -log "$exec_output"
432 # objdump_versionstuff
433 # Dump version definitions/references and make sure that it is sane.
435 proc objdump_versionstuff { objdump object expectfile } {
436 global VOBJDUMP_FLAGS
437 global version_output
441 if {[which $objdump] == 0} then {
442 perror "$objdump does not exist"
446 if ![info exists VOBJDUMP_FLAGS] { set VOBJDUMP_FLAGS "" }
448 verbose -log "$objdump $VOBJDUMP_FLAGS $object | sed -n /Version/,\\\$p > $tmpdir/objdump.out"
450 catch "exec $objdump $VOBJDUMP_FLAGS $object | sed -n /Version/,\\\$p > $tmpdir/objdump.out" exec_output
451 set exec_output [prune_warnings $exec_output]
452 if [string match "" $exec_output] then {
454 # It's OK if there are extra lines in the actual output; they
455 # may come from version information in libc. We require that
456 # every line in EXPECTFILE appear in the output in order.
458 set f1 [open $tmpdir/objdump.out r]
459 set f2 [open $expectfile r]
461 while { [gets $f1 l1] != -1 } {
462 if { [string match $l2 $l1] } then {
463 if { [gets $f2 l2] == -1 } then {
471 # We reached the end of the output without seeing the line we
472 # expected. This is a test failure.
477 # Support empty expected file.
478 if [string match "" $l2] then {
482 verbose -log "Did not find \"$l2\""
483 set f1 [open $tmpdir/objdump.out r]
484 while { [gets $f1 l1] != -1 } {
488 verbose -log "$exec_output"
491 verbose -log "$exec_output"
496 proc build_vers_lib { pic test source libname other mapfile verexp versymexp symexp } {
510 if ![ld_compile "$CC -S $pic $CFLAGS" $srcdir/$subdir/$source $tmpdir/$libname.s] {
515 if ![ld_assemble $as $tmpdir/$libname.s $tmpdir/$libname.o ] {
521 if ![string match "" $other] then {
523 set other_lib "$other_lib $tmpdir/$o"
527 if [string match "" $mapfile] then {
530 set script_arg "$script $srcdir/$subdir/$mapfile"
533 if {![ld_simple_link $ld $tmpdir/$libname.so "$shared $tmpdir/$libname.o $other_lib $script_arg"]} {
538 if {![objdump_versionstuff $objdump $tmpdir/$libname.so $srcdir/$subdir/$verexp ]} {
543 if {![objdump_dynsymstuff $objdump $tmpdir/$libname.so $srcdir/$subdir/$versymexp ]} {
548 if [string match "" $symexp] then {
549 if {![objdump_emptysymstuff $objdump $tmpdir/$libname.o ]} {
554 if {![objdump_symstuff $objdump $tmpdir/$libname.o $srcdir/$subdir/$symexp ]} {
564 proc build_vers_lib_no_pic { test source libname other mapfile verexp versymexp symexp } {
565 build_vers_lib "" $test $source $libname $other $mapfile $verexp $versymexp $symexp
568 proc build_vers_lib_pic { test source libname other mapfile verexp versymexp symexp } {
570 build_vers_lib $picflag $test $source $libname $other $mapfile $verexp $versymexp $symexp
573 proc test_ldfail { test flag source execname other mapfile whyfail } {
586 if [string match "" $other] then {
589 set other_lib $tmpdir/$other
592 if ![ld_compile "$CC -S $flag $CFLAGS" $srcdir/$subdir/$source $tmpdir/$execname.s] {
597 if ![ld_assemble $as $tmpdir/$execname.s $tmpdir/$execname.o ] {
602 verbose -log "This link should fail because of $whyfail"
604 if [string match "" $mapfile] then {
607 set script_arg "$script $srcdir/$subdir/$mapfile"
610 if {![ld_link $ld $tmpdir/$execname "$tmpdir/$execname.o $other_lib $script_arg"]} {
617 proc test_asfail { test flag source execname whyfail } {
625 if ![ld_compile "$CC -S $flag $CFLAGS" $srcdir/$subdir/$source $tmpdir/$execname.s] {
630 verbose -log "This assemble should fail because of $whyfail"
631 catch "exec $as -o $tmpdir/$execname.o $tmpdir/$execname.s" exec_output
632 set exec_output [prune_warnings $exec_output]
633 if [string match "" $exec_output] then {
637 verbose -log "$exec_output"
641 proc test_strip_vers_lib { test srclib libname verexp versymexp } {
650 verbose -log "cp $tmpdir/$srclib $tmpdir/$libname.so"
651 exec cp $tmpdir/$srclib $tmpdir/$libname.so
653 verbose -log "$strip $tmpdir/$libname.so"
654 catch "exec $strip $tmpdir/$libname.so" exec_output
655 if [string match "" $exec_output] then {
657 # If strip went OK, then run the usual tests on the thing to make sure that
659 if {![objdump_versionstuff $objdump $tmpdir/$libname.so $srcdir/$subdir/$verexp ]} {
664 if {![objdump_dynsymstuff $objdump $tmpdir/$libname.so $srcdir/$subdir/$versymexp ]} {
670 verbose -log "$exec_output"
678 proc build_exec { test source execname flags solibname verexp versymexp symexp } {
690 set shared "--shared --no-undefined-version"
691 set script --version-script
692 if ![ld_compile "$CC -S $CFLAGS" $srcdir/$subdir/$source $tmpdir/$execname.s] {
697 if ![ld_assemble $as $tmpdir/$execname.s $tmpdir/$execname.o ] {
702 if [string match "" $solibname] then {
705 set solibname_lib $tmpdir/$solibname
708 if {![ld_link $ld $tmpdir/$execname "$flags $tmpdir/$execname.o $solibname_lib"]} {
713 if [string match "" $verexp] then {
715 # Make sure we get nothing back.
717 if {![objdump_emptyverstuff $objdump $tmpdir/$execname ]} {
722 if {![objdump_versionstuff $objdump $tmpdir/$execname $srcdir/$subdir/$verexp ]} {
728 if [string match "" $versymexp] then {
729 if {![objdump_emptydynsymstuff $objdump $tmpdir/$execname ]} {
734 if {![objdump_dynsymstuff $objdump $tmpdir/$execname $srcdir/$subdir/$versymexp ]} {
740 if [string match "" $symexp] then {
741 if {![objdump_emptysymstuff $objdump $tmpdir/$execname.o ]} {
746 if {![objdump_symstuff $objdump $tmpdir/$execname.o $srcdir/$subdir/$symexp ]} {
757 # Basic test - build a library with versioned symbols.
759 build_vers_lib_no_pic "vers1" vers1.c vers1 "" vers1.map vers1.ver vers1.dsym vers1.sym
763 # Test #2 - build a library, and link it against the library we built in step
766 if [istarget x86_64-*-linux*] {
767 # x86_64 doesn't like non-pic shared libraries
770 build_vers_lib_no_pic "vers2" vers2.c vers2 vers1.so vers2.map vers2.ver vers2.dsym ""
774 # Test #3 - build an executable, and link it against vers1.so.
776 build_exec "vers3" vers3.c vers3 "" vers1.so vers3.ver vers3.dsym ""
779 # Test #4 - Make sure a version implicitly defined in an executable
780 # causes a version node to be created. Verify this both with and without
784 # This test fails on MIPS. On the MIPS we must put foo in the dynamic
785 # symbol table, which the test does not expect.
786 setup_xfail "mips*-*-*"
787 build_exec "vers4" vers4.c vers4 "" "" "" "" vers4.sym
789 build_exec "vers4a" vers4.c vers4a "-export-dynamic" "" vers4a.ver vers4a.dsym vers4a.sym
793 # Try multiple definitions foo@BAR and foo@@BAR and make sure the linker
796 test_ldfail "vers5" "" vers5.c vers5 "" "" "multiple definition of foo@VERS_1.2"
800 # Now build a test that should reference a bunch of versioned symbols.
801 # All of them should be correctly referenced.
803 build_exec "vers6" vers6.c vers6 "" vers1.so vers6.ver vers6.dsym vers6.sym
806 # Another test to verify that something made local via 'local' is truly not
809 build_vers_lib_no_pic "vers7a" vers7a.c vers7a "" vers7.map vers7a.ver vers7a.dsym vers7a.sym
811 test_ldfail "vers7" "" vers7.c vers7 vers7a.so "" "undefined reference to hide_a"
815 # This test is designed to verify that we can pass a linker script on the
816 # command line as if it were a normal .o file.
818 catch "exec cp $srcdir/$subdir/vers8.map $tmpdir/" ignore_output
819 build_vers_lib_no_pic "vers8" vers1.c vers8 vers8.map "" vers8.ver vers1.dsym vers1.sym
822 # This test tries to make sure that version references to versioned symbols
823 # don't collide with default definitions with the same symbol.
825 build_exec "vers9" vers9.c vers9 "-export-dynamic" "" vers9.ver vers9.dsym vers9.sym
829 # Try and use a non-existant version node. The linker should fail with
832 test_ldfail "vers10" "-DDO_TEST10" vers1.c vers10 "" "vers1.map --shared" "invalid version"
835 # Try and some things the assembler should complain about.
837 test_asfail "vers11" "-DDO_TEST11" vers1.c vers11 "no @ in symver"
839 test_asfail "vers12" "-DDO_TEST12" vers1.c vers12 "extern version definition"
842 # Put a shared library in an archive library, and make sure the global
843 # archive symbol table is sane.
845 test_ar "ar with versioned solib" vers13.a vers1.so vers13.asym
848 # Strip a shared library, and make sure we didn't screw something up in there.
850 test_strip_vers_lib "vers14" vers1.so vers14 vers1.ver vers1.dsym
854 # Build another test with some versioned symbols. Here we are going to
855 # try and override something from the library, and we shouldn't get
858 build_exec "vers15" vers15.c vers15 "" vers1.so vers15.ver vers15.dsym vers15.sym
861 # Test that when we override a versioned symbol from the library this
862 # symbol appears in the dynamic symbol table of the executable.
864 build_vers_lib_no_pic "vers16a" vers16a.c vers16a "" vers16.map vers16a.ver vers16a.dsym ""
865 build_exec "vers16" vers16.c vers16 "" vers16a.so "" vers16.dsym ""
867 # Test a weak versioned symbol.
868 build_vers_lib_no_pic "vers17" vers17.c vers17 "" vers17.map vers17.ver vers17.dsym ""
869 build_vers_lib_no_pic "vers18" vers18.c vers18 vers17.so vers18.map vers18.ver vers18.dsym vers18.sym
870 build_exec "vers19" vers19.c vers19 "-rpath ." vers18.so vers19.ver vers19.dsym ""
872 build_vers_lib_no_pic "vers20a" vers20.c vers20a "" vers20.map vers20a.ver vers20.dsym ""
873 exec cp $tmpdir/vers20a.so $tmpdir/vers20b.so
874 build_vers_lib_no_pic "vers20" vers20.c vers20 "vers20a.so vers20b.so" vers20.map vers20.ver vers20.dsym ""
876 # Test .symver override.
877 build_vers_lib_no_pic "vers21" vers21.c vers21 "" vers21.map vers21.ver vers21.dsym vers21.sym
879 # Test moving default definition from one DSO to another.
880 build_vers_lib_no_pic "vers22a" vers22a.c vers22a "" vers22.map vers22a.ver vers22a.dsym vers22a.sym
881 build_vers_lib_no_pic "vers22b" vers22b.c vers22b "" vers22.map vers22b.ver vers22b.dsym ""
882 build_vers_lib_no_pic "vers22" vers22.c vers22 "vers22a.so vers22b.so" "" vers22.ver vers22.dsym ""
884 # Test versioned definitions in different files.
885 build_vers_lib_no_pic "vers23a" vers23a.c vers23a "" vers23a.map vers23a.ver vers23a.dsym vers23a.sym
886 build_vers_lib_no_pic "vers23b" vers23b.c vers23b "" vers23b.map vers23b.ver vers23b.dsym ""
887 build_vers_lib_no_pic "vers23c" vers23b.c vers23c "vers23a.so" vers23b.map vers23c.ver vers23b.dsym ""
888 build_exec "vers23d" vers23.c vers23d "tmpdir/vers23a.so tmpdir/vers23c.so" "" vers23.ver vers23d.dsym ""
889 build_exec "vers23" vers23.c vers23 "tmpdir/vers23a.so tmpdir/vers23b.o tmpdir/vers23b.so" "" vers23.ver vers23.dsym ""
891 # Test .symver x,x@VERS.0
893 if [istarget sparc*-*-*] {
894 set as_pic_flags "-K PIC"
896 run_ld_link_tests [list "\"vers24a\"
897 \"-shared --version-script $srcdir/$subdir/vers24.map\"
898 \"$as_pic_flags\" {vers24a.c vers24b.c} { { readelf -Wrs vers24.rd } }
899 \"libvers24a.so\" \"-fpic\""]
900 run_ld_link_tests [list "\"vers24b\"
901 \"-shared --version-script $srcdir/$subdir/vers24.map\"
902 \"$as_pic_flags\" {vers24b.c vers24a.c} { { readelf -Wrs vers24.rd } }
903 \"libvers24b.so\" \"-fpic\""]
904 run_ld_link_tests [list "\"vers24c\"
905 \"-shared --version-script $srcdir/$subdir/vers24.map\"
906 \"$as_pic_flags\" {vers24c.c} { { readelf -Wrs vers24.rd } }
907 \"libvers24c.so\" \"-fpic\""]
909 # Test versioned definition vs. normal definition in different files.
910 build_vers_lib_no_pic "vers25a" vers25a.c vers25a "" vers25a.map vers25a.ver vers25a.dsym ""
911 build_vers_lib_no_pic "vers25b1" vers25b.c vers25b1 "vers25a.o vers25a.so" "" vers25b.ver vers25b.dsym ""
912 build_vers_lib_no_pic "vers25b2" vers25b.c vers25b2 "vers25a.so vers25a.o" "" vers25b.ver vers25b.dsym ""
913 build_vers_lib_pic "vers26a" vers26a.c vers26a "" vers26a.map vers26a.ver vers26a.dsym ""
914 build_vers_lib_pic "vers26b1" vers26b.c vers26b1 "" "" vers26b.ver vers26b.dsym ""
915 build_vers_lib_pic "vers26b2" vers26b.c vers26b2 "vers26a.so vers26b1.so vers26a.o" "" vers26b.ver vers26b.dsym ""
916 if [istarget x86_64-*-linux*] {
917 # x86_64 doesn't like non-pic shared libraries
920 build_vers_lib_no_pic "vers26b3" vers26b.c vers26b3 "vers26a.so vers26b1.so vers26a.o" "" vers26b.ver vers26b.dsym ""
923 # Test versioned definition vs. hidden definition in different files.
924 build_vers_lib_no_pic "vers27a" vers27a.c vers27a "" vers27a.map vers27a.ver vers27a.dsym ""
925 build_vers_lib_no_pic "vers27b" vers27b.c vers27b "" "" vers27b.ver vers27b.dsym ""
926 build_vers_lib_no_pic "vers27c1" vers27c.c vers27c1 "vers27b.o vers27a.so" "" vers27c.ver vers27c.dsym ""
927 build_vers_lib_no_pic "vers27c2" vers27c.c vers27c2 "vers27a.so vers27b.o" "" vers27c.ver vers27c.dsym ""