projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use better test for usable compiler in ld testsuite.
[deliverable/binutils-gdb.git]
/
ld
/
testsuite
/
ld-elfvers
/
vers.exp
diff --git
a/ld/testsuite/ld-elfvers/vers.exp
b/ld/testsuite/ld-elfvers/vers.exp
index 45a004b041d39650e37079bb230e2b30c411ea23..ebaaa785320ccc709fce7c645a9513d71c96ef0f 100644
(file)
--- a/
ld/testsuite/ld-elfvers/vers.exp
+++ b/
ld/testsuite/ld-elfvers/vers.exp
@@
-1,5
+1,5
@@
# Expect script for ld-version tests
# Expect script for ld-version tests
-# Copyright (C) 1997-201
4
Free Software Foundation, Inc.
+# Copyright (C) 1997-201
9
Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
#
#
# This file is part of the GNU Binutils.
#
@@
-22,8
+22,10
@@
#
#
-# 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.
# This test can only be run on a couple of ELF platforms.
# Square bracket expressions seem to confuse istarget.
@@
-57,11
+59,6
@@
if { ![istarget hppa*64*-*-hpux*]
return
}
return
}
-if { [istarget *-*-linux*aout*]
- || [istarget *-*-linux*oldld*] } {
- return
-}
-
if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
return
}
if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
return
}
@@
-91,11
+88,7
@@
if { [istarget mips*-*-*] && ! [at_least_gcc_version 4 3] } then {
|| [string match "*option ignored*" $exec_output]
|| [string match "*unrecognized option*" $exec_output]
|| [string match "*passed to ld*" $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"
- } else {
- set picflag "-KPIC"
- }
+ set picflag "-KPIC"
}
}
}
}
@@
-122,9
+115,9
@@
proc test_ar { test lib object expect } {
return
}
return
}
-
verbose -log "$nm --print-armap $tmpdir/$lib | grep \" in \" | egrep \"VERS\\|bar\\|foo\"
| sort > $tmpdir/nm.out"
-
- catch "exec $
nm --print-armap $tmpdir/$lib | grep \\\ in\\\ | egrep VERS\\\|bar\\\|foo | sort > $tmpdir/nm.out
" exec_output
+
set cmd "$nm --print-armap $tmpdir/$lib | grep \\\ in\\\ | egrep VERS\\\|bar\\\|foo | grep -v ^\\\\.
| sort > $tmpdir/nm.out"
+ verbose -log $cmd
+ catch "exec $
cmd
" exec_output
if [string match "" $exec_output] then {
catch "exec sort $srcdir/$subdir/$expect | $diff $tmpdir/nm.out -" exec_output
set exec_output [prune_warnings $exec_output]
if [string match "" $exec_output] then {
catch "exec sort $srcdir/$subdir/$expect | $diff $tmpdir/nm.out -" exec_output
set exec_output [prune_warnings $exec_output]
@@
-245,9
+238,9
@@
proc objdump_symstuff { objdump object expectfile } {
if ![info exists SOBJDUMP_FLAGS] { set SOBJDUMP_FLAGS "" }
if ![info exists SOBJDUMP_FLAGS] { set SOBJDUMP_FLAGS "" }
-
verbose -log "$objdump $SOBJDUMP_FLAGS $object | grep \@ | sort -k 6
> $tmpdir/objdump.out"
-
- catch "exec $
objdump $SOBJDUMP_FLAGS $object | grep \@ | sort -k 6 > $tmpdir/objdump.out
" exec_output
+
set cmd "$objdump $SOBJDUMP_FLAGS $object | sed -n {s/^\\(\[0-9a-f\]* *\\)\\(\[gw\]\\)\\( *\\)\\(\[FO\]\\)/\\1\\2\\4\\3/;/\@/p} | sort -k 5
> $tmpdir/objdump.out"
+ verbose -log $cmd
+ catch "exec $
cmd
" exec_output
set exec_output [prune_warnings $exec_output]
if [string match "" $exec_output] then {
set exec_output [prune_warnings $exec_output]
if [string match "" $exec_output] then {
@@
-286,7
+279,8
@@
proc objdump_symstuff { objdump object expectfile } {
close $file_a
while { [gets $file_b line] != $eof } {
close $file_a
while { [gets $file_b line] != $eof } {
- if [regexp "^#.*$" $line] then {
+ if [regexp {\.text.* \.[^ ]*$} $line] then {
+ # Discard defined powerpc64 dot-symbols
continue
} else {
lappend list_b $line
continue
} else {
lappend list_b $line
@@
-340,9
+334,9
@@
proc objdump_dynsymstuff { objdump object expectfile } {
if ![info exists DOBJDUMP_FLAGS] { set DOBJDUMP_FLAGS "" }
if ![info exists DOBJDUMP_FLAGS] { set DOBJDUMP_FLAGS "" }
-
verbose -log "$objdump $DOBJDUMP_FLAGS $object | sed -n /VERS/p\\\;/show/p | sort | uniq
> $tmpdir/objdump.out"
-
- catch "exec $
objdump $DOBJDUMP_FLAGS $object | sed -n /VERS/p\\\;/show/p | sort | uniq > $tmpdir/objdump.out
" exec_output
+
set cmd "$objdump $DOBJDUMP_FLAGS $object | sed -n /VERS/p\\\;/show/p | sort | uniq
> $tmpdir/objdump.out"
+ verbose -log $cmd
+ catch "exec $
cmd
" exec_output
set exec_output [prune_warnings $exec_output]
if [string match "" $exec_output] then {
set exec_output [prune_warnings $exec_output]
if [string match "" $exec_output] then {
@@
-381,7
+375,8
@@
proc objdump_dynsymstuff { objdump object expectfile } {
close $file_a
while { [gets $file_b line] != $eof } {
close $file_a
while { [gets $file_b line] != $eof } {
- if [regexp "^#.*$" $line] then {
+ if [regexp {\.text.* \.[^ ]*$} $line] then {
+ # Discard defined powerpc64 dot-symbols
continue
} else {
lappend list_b $line
continue
} else {
lappend list_b $line
@@
-390,8
+385,12
@@
proc objdump_dynsymstuff { objdump object expectfile } {
close $file_b
# Support empty files.
close $file_b
# Support empty files.
- if { ![info exists list_a] && ![info exists list_b] } then {
- return 1
+ if { ![info exists list_a] } then {
+ if { ![info exists list_b] } then {
+ return 1
+ }
+ verbose -log "\t$tmpdir/objdump.out: $list_b"
+ return 0
}
for { set i 0 } { $i < [llength $list_b] } { incr i } {
}
for { set i 0 } { $i < [llength $list_b] } { incr i } {
@@
-538,7
+537,7
@@
proc build_binary { shared pic test source libname other mapfile verexp versymex
set script_arg "$script $srcdir/$subdir/$mapfile"
}
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
}
fail "$test"
return
}
@@
-575,7
+574,9
@@
proc build_executable { test source libname other mapfile verexp versymexp symex
proc build_vers_lib_no_pic { test source libname other mapfile verexp versymexp symexp } {
global shared
proc build_vers_lib_no_pic { test source libname other mapfile verexp versymexp symexp } {
global shared
- build_binary $shared "" $test $source $libname $other $mapfile $verexp $versymexp $symexp ""
+ # Make sure that PLT is used since PLT is expected.
+ global PLT_CFLAGS
+ build_binary $shared $PLT_CFLAGS $test $source $libname $other $mapfile $verexp $versymexp $symexp ""
}
proc build_vers_lib_pic { test source libname other mapfile verexp versymexp symexp } {
}
proc build_vers_lib_pic { test source libname other mapfile verexp versymexp symexp } {
@@
-627,7
+628,7
@@
proc test_ldfail { test flag source execname other mapfile whyfail } {
set script_arg "-Wl,$script $srcdir/$subdir/$mapfile"
}
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
}
pass "$test"
return
}
@@
-725,7
+726,7
@@
proc build_exec { test source execname flags solibname verexp versymexp symexp }
set solibname_lib $tmpdir/$solibname
}
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
}
fail "$test"
return
}
@@
-899,7
+900,7
@@
build_exec "vers16" vers16.c vers16 "-Wl,--no-as-needed" vers16a.so "" vers16.ds
# 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
# 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
build_vers_lib_no_pic "vers20a" vers20.c vers20a "" vers20.map vers20a.ver vers20.dsym ""
exec cp $tmpdir/vers20a.so $tmpdir/vers20b.so
This page took
0.025393 seconds
and
4
git commands to generate.