summaryrefslogtreecommitdiffstats
path: root/binutils/testsuite
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2006-09-14 23:37:35 +0000
committerH.J. Lu <hjl.tools@gmail.com>2006-09-14 23:37:35 +0000
commit748fc5e9b442d7330373191ad556ce708cf14cb0 (patch)
tree4c855420eb8ab964e16f2b96722abab6e2a7abd8 /binutils/testsuite
parent30288845d67c64d07905c1e4ca9de4768d3b2dd8 (diff)
downloadppe42-binutils-748fc5e9b442d7330373191ad556ce708cf14cb0.tar.gz
ppe42-binutils-748fc5e9b442d7330373191ad556ce708cf14cb0.zip
binutils/
2006-09-14 H.J. Lu <hongjiu.lu@intel.com> PR binutils/3182 * objcopy.c (group_signature): Return proper group signature. binutils/testsuite/ 2006-09-14 H.J. Lu <hongjiu.lu@intel.com> PR binutils/3182 * binutils-all/objcopy.exp: Run strip-1 and strip-2 for ELF targets. * binutils-all/strip-1.d: New file. * binutils-all/strip-2.d: Likewise. * lib/utils-lib.exp (run_dump_test): Support strip.
Diffstat (limited to 'binutils/testsuite')
-rw-r--r--binutils/testsuite/ChangeLog11
-rw-r--r--binutils/testsuite/binutils-all/objcopy.exp2
-rw-r--r--binutils/testsuite/binutils-all/strip-1.d11
-rw-r--r--binutils/testsuite/binutils-all/strip-2.d18
-rw-r--r--binutils/testsuite/lib/utils-lib.exp12
5 files changed, 50 insertions, 4 deletions
diff --git a/binutils/testsuite/ChangeLog b/binutils/testsuite/ChangeLog
index b3347b78b2..47befb9771 100644
--- a/binutils/testsuite/ChangeLog
+++ b/binutils/testsuite/ChangeLog
@@ -1,3 +1,14 @@
+2006-09-14 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR binutils/3182
+ * binutils-all/objcopy.exp: Run strip-1 and strip-2 for ELF
+ targets.
+
+ * binutils-all/strip-1.d: New file.
+ * binutils-all/strip-2.d: Likewise.
+
+ * lib/utils-lib.exp (run_dump_test): Support strip.
+
2006-08-15 Thiemo Seufer <ths@mips.com>
Nigel Stephens <nigel@mips.com>
David Ung <davidu@mips.com>
diff --git a/binutils/testsuite/binutils-all/objcopy.exp b/binutils/testsuite/binutils-all/objcopy.exp
index 679eea5988..96ae518b9a 100644
--- a/binutils/testsuite/binutils-all/objcopy.exp
+++ b/binutils/testsuite/binutils-all/objcopy.exp
@@ -731,5 +731,7 @@ run_dump_test "copy-3"
if [is_elf_format] {
run_dump_test "localize-hidden-1"
+ run_dump_test "strip-1"
+ run_dump_test "strip-2"
}
run_dump_test "localize-hidden-2"
diff --git a/binutils/testsuite/binutils-all/strip-1.d b/binutils/testsuite/binutils-all/strip-1.d
new file mode 100644
index 0000000000..200983211e
--- /dev/null
+++ b/binutils/testsuite/binutils-all/strip-1.d
@@ -0,0 +1,11 @@
+#PROG: strip
+#source: group.s
+#readelf: -Sg --wide
+#name: strip with section group 1
+
+#...
+ \[[ 0-9]+\] \.text.*[ \t]+PROGBITS[ \t0-9a-f]+AX[ \t]+.*
+#...
+ \[[ 0-9]+\] \.data.*[ \t]+PROGBITS[ \t0-9a-f]+WA[ \t]+.*
+#...
+There are no section groups in this file.
diff --git a/binutils/testsuite/binutils-all/strip-2.d b/binutils/testsuite/binutils-all/strip-2.d
new file mode 100644
index 0000000000..5c54b7ecb8
--- /dev/null
+++ b/binutils/testsuite/binutils-all/strip-2.d
@@ -0,0 +1,18 @@
+#PROG: strip
+#source: group.s
+#strip: --strip-unneeded
+#readelf: -Sg --wide
+#name: strip with section group 2
+
+#...
+ \[[ 0-9]+\] foo_group[ \t]+GROUP[ \t]+.*
+#...
+ \[[ 0-9]+\] \.text.*[ \t]+PROGBITS[ \t0-9a-f]+AXG[ \t]+.*
+#...
+ \[[ 0-9]+\] \.data.*[ \t]+PROGBITS[ \t0-9a-f]+WAG[ \t]+.*
+#...
+COMDAT group section \[[ 0-9]+\] `foo_group' \[foo_group\] contains 2 sections:
+ \[Index\] Name
+ \[[ 0-9]+\] .text.*
+ \[[ 0-9]+\] .data.*
+#pass
diff --git a/binutils/testsuite/lib/utils-lib.exp b/binutils/testsuite/lib/utils-lib.exp
index 3ee76754a5..b914500645 100644
--- a/binutils/testsuite/lib/utils-lib.exp
+++ b/binutils/testsuite/lib/utils-lib.exp
@@ -279,8 +279,8 @@ proc exe_ext {} {
proc run_dump_test { name {extra_options {}} } {
global subdir srcdir
- global OBJDUMP NM OBJCOPY READELF
- global OBJDUMPFLAGS NMFLAGS OBJCOPYFLAGS READELFFLAGS
+ global OBJDUMP NM OBJCOPY READELF STRIP
+ global OBJDUMPFLAGS NMFLAGS OBJCOPYFLAGS READELFFLAGS STRIPFLAGS
global host_triplet
global env
global copyfile
@@ -362,11 +362,15 @@ proc run_dump_test { name {extra_options {}} } {
return
}
+ set destopt ""
switch -- $opts(PROG) {
ar { set program ar }
objcopy { set program objcopy }
ranlib { set program ranlib }
- strip { set program strip }
+ strip {
+ set program strip
+ set destopt "-o"
+ }
strings { set program strings }
default {
perror "unrecognized program option $opts(PROG) in $file.d"
@@ -470,7 +474,7 @@ proc run_dump_test { name {extra_options {}} } {
eval set progopts \$[string toupper $program]FLAGS
eval set binary \$[string toupper $program]
- set exec_output [binutils_run $binary "$progopts $progopts1 $tempfile ${copyfile}.o"]
+ set exec_output [binutils_run $binary "$progopts $progopts1 $tempfile $destopt ${copyfile}.o"]
if ![string match "" $exec_output] {
send_log "$exec_output\n"
verbose "$exec_output"
OpenPOWER on IntegriCloud