summaryrefslogtreecommitdiff
path: root/binutils/testsuite/binutils-all
diff options
context:
space:
mode:
Diffstat (limited to 'binutils/testsuite/binutils-all')
-rw-r--r--binutils/testsuite/binutils-all/group-2.s8
-rw-r--r--binutils/testsuite/binutils-all/group-3.s8
-rw-r--r--binutils/testsuite/binutils-all/group-4.s6
-rw-r--r--binutils/testsuite/binutils-all/group.s4
-rw-r--r--binutils/testsuite/binutils-all/objcopy.exp9
-rw-r--r--binutils/testsuite/binutils-all/objdump.W2
-rw-r--r--binutils/testsuite/binutils-all/strip-4.d11
-rw-r--r--binutils/testsuite/binutils-all/strip-5.d18
-rw-r--r--binutils/testsuite/binutils-all/strip-6.d11
-rw-r--r--binutils/testsuite/binutils-all/strip-7.d18
-rw-r--r--binutils/testsuite/binutils-all/strip-8.d11
-rw-r--r--binutils/testsuite/binutils-all/strip-9.d18
12 files changed, 121 insertions, 3 deletions
diff --git a/binutils/testsuite/binutils-all/group-2.s b/binutils/testsuite/binutils-all/group-2.s
new file mode 100644
index 00000000000..187eeda2453
--- /dev/null
+++ b/binutils/testsuite/binutils-all/group-2.s
@@ -0,0 +1,8 @@
+ .section .text.foo,"axG",%progbits,.text.foo,comdat
+ .global foo2
+foo2:
+ .word 0
+ .section .data.bar,"awG",%progbits,.text.foo,comdat
+ .global bar2
+bar2:
+ .word 0
diff --git a/binutils/testsuite/binutils-all/group-3.s b/binutils/testsuite/binutils-all/group-3.s
new file mode 100644
index 00000000000..eb235e865b0
--- /dev/null
+++ b/binutils/testsuite/binutils-all/group-3.s
@@ -0,0 +1,8 @@
+ .section .text.foo3,"axG",%progbits,foo3,comdat
+ .global foo3
+foo3:
+ .word 0
+ .section .data.bar3,"awG",%progbits,foo3,comdat
+ .global bar3
+bar3:
+ .word 0
diff --git a/binutils/testsuite/binutils-all/group-4.s b/binutils/testsuite/binutils-all/group-4.s
new file mode 100644
index 00000000000..b1c8736ffec
--- /dev/null
+++ b/binutils/testsuite/binutils-all/group-4.s
@@ -0,0 +1,6 @@
+ .section .text.foo4,"axG",%progbits,foo4,comdat
+foo4:
+ .word 0
+ .section .data.foo4,"awG",%progbits,foo4,comdat
+bar4:
+ .word 0
diff --git a/binutils/testsuite/binutils-all/group.s b/binutils/testsuite/binutils-all/group.s
index 21aa4be55b6..cc1ffb6ded7 100644
--- a/binutils/testsuite/binutils-all/group.s
+++ b/binutils/testsuite/binutils-all/group.s
@@ -1,8 +1,8 @@
- .section .text,"axG",%progbits,foo_group,comdat
+ .section .text.foo,"axG",%progbits,foo_group,comdat
.global foo
foo:
.word 0
- .section .data,"awG",%progbits,foo_group,comdat
+ .section .data.foo,"awG",%progbits,foo_group,comdat
.global bar
bar:
.word 0
diff --git a/binutils/testsuite/binutils-all/objcopy.exp b/binutils/testsuite/binutils-all/objcopy.exp
index e6ee14220bf..997b543a9d1 100644
--- a/binutils/testsuite/binutils-all/objcopy.exp
+++ b/binutils/testsuite/binutils-all/objcopy.exp
@@ -827,6 +827,9 @@ 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
+ objcopy_test_readelf "ELF group" group-3.s
+ objcopy_test_readelf "ELF group" group-4.s
run_dump_test "copy-1"
}
@@ -837,6 +840,12 @@ 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"
+ run_dump_test "strip-6"
+ run_dump_test "strip-7"
+ run_dump_test "strip-8"
+ run_dump_test "strip-9"
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/objdump.W b/binutils/testsuite/binutils-all/objdump.W
index dfca5628d6c..7617470a5b9 100644
--- a/binutils/testsuite/binutils-all/objdump.W
+++ b/binutils/testsuite/binutils-all/objdump.W
@@ -1,7 +1,7 @@
tmpdir/dw2-compressed.o: file format .*
-The section .debug_info contains:
+Contents of the .debug_info section:
Compilation Unit @ offset 0x0:
Length: 0x4e \(32-bit\)
diff --git a/binutils/testsuite/binutils-all/strip-4.d b/binutils/testsuite/binutils-all/strip-4.d
new file mode 100644
index 00000000000..c8c2509f520
--- /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 00000000000..8dd233183f8
--- /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
diff --git a/binutils/testsuite/binutils-all/strip-6.d b/binutils/testsuite/binutils-all/strip-6.d
new file mode 100644
index 00000000000..c5d428872d4
--- /dev/null
+++ b/binutils/testsuite/binutils-all/strip-6.d
@@ -0,0 +1,11 @@
+#PROG: strip
+#source: group-3.s
+#readelf: -Sg --wide
+#name: strip with section group 6
+
+#...
+ \[[ 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-7.d b/binutils/testsuite/binutils-all/strip-7.d
new file mode 100644
index 00000000000..791463b81b7
--- /dev/null
+++ b/binutils/testsuite/binutils-all/strip-7.d
@@ -0,0 +1,18 @@
+#PROG: strip
+#source: group-3.s
+#strip: --strip-unneeded
+#readelf: -Sg --wide
+#name: strip with section group 7
+
+#...
+ \[[ 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' \[foo3\] contains 2 sections:
+ \[Index\] Name
+ \[[ 0-9]+\] .text.*
+ \[[ 0-9]+\] .data.*
+#pass
diff --git a/binutils/testsuite/binutils-all/strip-8.d b/binutils/testsuite/binutils-all/strip-8.d
new file mode 100644
index 00000000000..56185103484
--- /dev/null
+++ b/binutils/testsuite/binutils-all/strip-8.d
@@ -0,0 +1,11 @@
+#PROG: strip
+#source: group-4.s
+#readelf: -Sg --wide
+#name: strip with section group 8
+
+#...
+ \[[ 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-9.d b/binutils/testsuite/binutils-all/strip-9.d
new file mode 100644
index 00000000000..7f07a0da377
--- /dev/null
+++ b/binutils/testsuite/binutils-all/strip-9.d
@@ -0,0 +1,18 @@
+#PROG: strip
+#source: group-4.s
+#strip: --strip-unneeded
+#readelf: -Sg --wide
+#name: strip with section group 9
+
+#...
+ \[[ 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' \[foo4\] contains 2 sections:
+ \[Index\] Name
+ \[[ 0-9]+\] .text.*
+ \[[ 0-9]+\] .data.*
+#pass