aboutsummaryrefslogtreecommitdiff
path: root/binutils/testsuite
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2008-10-01 21:54:59 +0000
committerH.J. Lu <hjl.tools@gmail.com>2008-10-01 21:54:59 +0000
commiteb3980ce22659dfa694a927ebe6cd3e91f838f06 (patch)
tree14267dbdb192f61f3dcfea92b577a257e0422c8b /binutils/testsuite
parentbec7fb47e47a91f7d2ea31044220381b44854d36 (diff)
downloadgdb-eb3980ce22659dfa694a927ebe6cd3e91f838f06.zip
gdb-eb3980ce22659dfa694a927ebe6cd3e91f838f06.tar.gz
gdb-eb3980ce22659dfa694a927ebe6cd3e91f838f06.tar.bz2
2008-10-01 H.J. Lu <hongjiu.lu@intel.com>
* binutils-all/group-2.s: New. * binutils-all/strip-4.d: Likewise. * binutils-all/strip-5.d: Likewise. * binutils-all/objcopy.exp: Test objcopy on group-2.s. Run strip-4 and strip-5.
Diffstat (limited to 'binutils/testsuite')
-rw-r--r--binutils/testsuite/ChangeLog9
-rw-r--r--binutils/testsuite/binutils-all/group-2.s8
-rw-r--r--binutils/testsuite/binutils-all/objcopy.exp3
-rw-r--r--binutils/testsuite/binutils-all/strip-4.d11
-rw-r--r--binutils/testsuite/binutils-all/strip-5.d18
5 files changed, 49 insertions, 0 deletions
diff --git a/binutils/testsuite/ChangeLog b/binutils/testsuite/ChangeLog
index 2b4fdac..cd1181f 100644
--- a/binutils/testsuite/ChangeLog
+++ b/binutils/testsuite/ChangeLog
@@ -1,3 +1,12 @@
+2008-10-01 H.J. Lu <hongjiu.lu@intel.com>
+
+ * binutils-all/group-2.s: New.
+ * binutils-all/strip-4.d: Likewise.
+ * binutils-all/strip-5.d: Likewise.
+
+ * binutils-all/objcopy.exp: Test objcopy on group-2.s. Run
+ strip-4 and strip-5.
+
2008-07-26 Alan Modra <amodra@bigpond.net.au>
* binutils-all/objdump.exp: Run compressed debug test only for ELF.
diff --git a/binutils/testsuite/binutils-all/group-2.s b/binutils/testsuite/binutils-all/group-2.s
new file mode 100644
index 0000000..6654138
--- /dev/null
+++ b/binutils/testsuite/binutils-all/group-2.s
@@ -0,0 +1,8 @@
+ .section .text.foo,"axG",%progbits,.text.foo,comdat
+ .global foo
+foo:
+ .word 0
+ .section .data.bar,"awG",%progbits,.text.foo,comdat
+ .global bar
+bar:
+ .word 0
diff --git a/binutils/testsuite/binutils-all/objcopy.exp b/binutils/testsuite/binutils-all/objcopy.exp
index e6ee142..c911289 100644
--- a/binutils/testsuite/binutils-all/objcopy.exp
+++ b/binutils/testsuite/binutils-all/objcopy.exp
@@ -827,6 +827,7 @@ if { ([istarget "ia64-*-elf*"]
if [is_elf_format] {
objcopy_test "ELF unknown section type" unknown.s
objcopy_test_readelf "ELF group" group.s
+ objcopy_test_readelf "ELF group" group-2.s
run_dump_test "copy-1"
}
@@ -837,6 +838,8 @@ if [is_elf_format] {
run_dump_test "strip-1"
run_dump_test "strip-2"
run_dump_test "strip-3"
+ run_dump_test "strip-4"
+ run_dump_test "strip-5"
if { [istarget "i*86-*"] || [istarget "x86_64-*-*"] } {
# Check to make sure we don't strip a symbol named in relocations.
diff --git a/binutils/testsuite/binutils-all/strip-4.d b/binutils/testsuite/binutils-all/strip-4.d
new file mode 100644
index 0000000..c8c2509
--- /dev/null
+++ b/binutils/testsuite/binutils-all/strip-4.d
@@ -0,0 +1,11 @@
+#PROG: strip
+#source: group-2.s
+#readelf: -Sg --wide
+#name: strip with section group 4
+
+#...
+ \[[ 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-5.d b/binutils/testsuite/binutils-all/strip-5.d
new file mode 100644
index 0000000..8dd2331
--- /dev/null
+++ b/binutils/testsuite/binutils-all/strip-5.d
@@ -0,0 +1,18 @@
+#PROG: strip
+#source: group-2.s
+#strip: --strip-unneeded
+#readelf: -Sg --wide
+#name: strip with section group 5
+
+#...
+ \[[ 0-9]+\] .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]+\] `.group' \[.text.foo\] contains 2 sections:
+ \[Index\] Name
+ \[[ 0-9]+\] .text.*
+ \[[ 0-9]+\] .data.*
+#pass