aboutsummaryrefslogtreecommitdiff
path: root/binutils/testsuite
diff options
context:
space:
mode:
authorBernd Schmidt <bernds@codesourcery.com>2011-06-30 21:41:05 +0000
committerBernd Schmidt <bernds@codesourcery.com>2011-06-30 21:41:05 +0000
commit28902555d09a901122db84331dfb6eccd48de921 (patch)
tree126670f27d3174ab56c2128597282b72721102a7 /binutils/testsuite
parentdc076558e23730cbec1298fab2b6c47937d7e550 (diff)
downloadgdb-28902555d09a901122db84331dfb6eccd48de921.zip
gdb-28902555d09a901122db84331dfb6eccd48de921.tar.gz
gdb-28902555d09a901122db84331dfb6eccd48de921.tar.bz2
* binutils-all/objcopy.exp (strip_test, strip_executable):
On ELF targets, test that OS/ABI is preserved. (copy_setup): Do test on tic6x-*-uclinux.
Diffstat (limited to 'binutils/testsuite')
-rw-r--r--binutils/testsuite/ChangeLog6
-rw-r--r--binutils/testsuite/binutils-all/objcopy.exp65
2 files changed, 70 insertions, 1 deletions
diff --git a/binutils/testsuite/ChangeLog b/binutils/testsuite/ChangeLog
index d19d1b0..7eb0361 100644
--- a/binutils/testsuite/ChangeLog
+++ b/binutils/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2011-06-30 Bernd Schmidt <bernds@codesourcery.com>
+
+ * binutils-all/objcopy.exp (strip_test, strip_executable):
+ On ELF targets, test that OS/ABI is preserved.
+ (copy_setup): Do test on tic6x-*-uclinux.
+
2011-06-19 H.J. Lu <hongjiu.lu@intel.com>
* binutils-all/elfedit-1.d: Updated for x32.
diff --git a/binutils/testsuite/binutils-all/objcopy.exp b/binutils/testsuite/binutils-all/objcopy.exp
index cf3535d..7ad8497 100644
--- a/binutils/testsuite/binutils-all/objcopy.exp
+++ b/binutils/testsuite/binutils-all/objcopy.exp
@@ -406,6 +406,7 @@ proc strip_test { } {
global NMFLAGS
global srcdir
global subdir
+ global READELF
set test "strip"
@@ -414,6 +415,19 @@ proc strip_test { } {
return
}
+ set osabi_fail "false"
+ if [is_elf_format] {
+ verbose -log "$READELF -a tmpdir/testprog.o > tmpdir/osabi.in"
+ set exec_output [remote_exec host "$READELF -h tmpdir/testprog.o" "" "/dev/null" "tmpdir/osabi.in"]
+ if { [lindex $exec_output 0] != 0 } then {
+ unresolved "$test preserving OS/ABI"
+ set osabi_fail "true"
+ } else {
+ verbose -log "grep OS/ABI tmpdir/osabi.in"
+ catch "exec grep OS/ABI tmpdir/osabi.in" osabi_in
+ }
+ }
+
if [is_remote host] {
set archive libstrip.a
set objfile [remote_download host tmpdir/testprog.o]
@@ -428,21 +442,40 @@ proc strip_test { } {
set exec_output [binutils_run $AR "rc $archive ${objfile}"]
if ![string match "" $exec_output] {
fail $test
+ unresolved "$test preserving OS/ABI"
return
}
set exec_output [binutils_run $STRIP "-g $archive"]
if ![string match "" $exec_output] {
fail $test
+ unresolved "$test preserving OS/ABI"
return
}
set exec_output [binutils_run $STRIP "$STRIPFLAGS $archive"]
if ![string match "" $exec_output] {
fail $test
+ unresolved "$test preserving OS/ABI"
return
}
+ if { $osabi_fail != "true" && [is_elf_format] } {
+ verbose -log "$READELF -a tmpdir/testprog.o > tmpdir/osabi.out"
+ set exec_output [remote_exec host "$READELF -h tmpdir/testprog.o" "" "/dev/null" "tmpdir/osabi.out"]
+ if { [lindex $exec_output 0] != 0 } then {
+ unresolved "$test preserving OS/ABI"
+ } else {
+ verbose -log "grep OS/ABI tmpdir/osabi.out"
+ catch "exec grep OS/ABI tmpdir/osabi.out" osabi_out
+ if { "$osabi_in" == "$osabi_out" } {
+ pass "$test preserving OS/ABI"
+ } else {
+ fail "$test preserving OS/ABI"
+ }
+ }
+ }
+
if { [target_compile $srcdir/$subdir/testprog.c tmpdir/testprog.o object debug] != "" } {
untested $test
return
@@ -531,7 +564,7 @@ proc copy_setup { } {
set res [build_wrapper testglue.o]
set flags { debug }
- if { [istarget *-*-uclinux*] } {
+ if { [istarget *-*-uclinux*] && ![istarget tic6x-*-*] } {
return 1
}
@@ -649,6 +682,7 @@ proc copy_executable { prog flags test1 test2 } {
proc strip_executable { prog flags test } {
global NM
global NMFLAGS
+ global READELF
global host_triplet
remote_file build delete tmpdir/striprog
@@ -659,6 +693,19 @@ proc strip_executable { prog flags test } {
set copyfile tmpdir/striprog
}
+ set osabi_fail "false"
+ if [is_elf_format] {
+ verbose -log "$READELF -a ${copyfile} > tmpdir/osabi.in"
+ set exec_output [remote_exec host "$READELF -h ${copyfile}" "" "/dev/null" "tmpdir/osabi.in"]
+ if { [lindex $exec_output 0] != 0 } then {
+ unresolved "$test preserving OS/ABI"
+ set osabi_fail "true"
+ } else {
+ verbose -log "grep OS/ABI tmpdir/osabi.in"
+ catch "exec grep OS/ABI tmpdir/osabi.in" osabi_in
+ }
+ }
+
set exec_output [binutils_run $prog "$flags ${copyfile}"]
if ![string match "" $exec_output] {
fail $test
@@ -679,6 +726,22 @@ proc strip_executable { prog flags test } {
return
}
+ if { $osabi_fail != "true" && [is_elf_format] } {
+ verbose -log "$READELF -a ${copyfile} > tmpdir/osabi.out"
+ set exec_output [remote_exec host "$READELF -h ${copyfile}" "" "/dev/null" "tmpdir/osabi.out"]
+ if { [lindex $exec_output 0] != 0 } then {
+ unresolved "$test preserving OS/ABI"
+ } else {
+ verbose -log "grep OS/ABI tmpdir/osabi.out"
+ catch "exec grep OS/ABI tmpdir/osabi.out" osabi_out
+ if { "$osabi_in" == "$osabi_out" } {
+ pass "$test preserving OS/ABI"
+ } else {
+ fail "$test preserving OS/ABI"
+ }
+ }
+ }
+
set exec_output [binutils_run $NM "$NMFLAGS ${copyfile}"]
if ![string match "*: no symbols*" $exec_output] {
fail $test