aboutsummaryrefslogtreecommitdiff
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/data-sections.s17
-rw-r--r--binutils/testsuite/binutils-all/objcopy.exp3
-rw-r--r--binutils/testsuite/binutils-all/only-section-01.d9
-rw-r--r--binutils/testsuite/binutils-all/remove-section-01.d8
4 files changed, 37 insertions, 0 deletions
diff --git a/binutils/testsuite/binutils-all/data-sections.s b/binutils/testsuite/binutils-all/data-sections.s
new file mode 100644
index 0000000..0d6284c
--- /dev/null
+++ b/binutils/testsuite/binutils-all/data-sections.s
@@ -0,0 +1,17 @@
+ .section ".data.aa.01", "aw"
+ .word 0x1
+
+ .section ".data.aa.02", "aw"
+ .word 0x2
+
+ .section ".data.aa.03", "aw"
+ .word 0x3
+
+ .section ".data.bb.01", "aw"
+ .word 0x4
+
+ .section ".data.bb.02", "aw"
+ .word 0x5
+
+ .section ".data.bb.03", "aw"
+ .word 0x6
diff --git a/binutils/testsuite/binutils-all/objcopy.exp b/binutils/testsuite/binutils-all/objcopy.exp
index ccd4422..be8a7d2 100644
--- a/binutils/testsuite/binutils-all/objcopy.exp
+++ b/binutils/testsuite/binutils-all/objcopy.exp
@@ -1118,6 +1118,9 @@ if [is_elf_format] {
run_dump_test "exclude-1a"
run_dump_test "exclude-1b"
+
+ run_dump_test "only-section-01"
+ run_dump_test "remove-section-01"
}
run_dump_test "localize-hidden-2"
diff --git a/binutils/testsuite/binutils-all/only-section-01.d b/binutils/testsuite/binutils-all/only-section-01.d
new file mode 100644
index 0000000..0e71430
--- /dev/null
+++ b/binutils/testsuite/binutils-all/only-section-01.d
@@ -0,0 +1,9 @@
+#PROG: objcopy
+#source: data-sections.s
+#objcopy: --only-section=.data.aa.* --only-section=!.data.aa.02
+#readelf: -WS
+
+#...
+ \[ [0-9]+\] .data.aa.01.*
+ \[ [0-9]+\] .data.aa.03.*
+#...
diff --git a/binutils/testsuite/binutils-all/remove-section-01.d b/binutils/testsuite/binutils-all/remove-section-01.d
new file mode 100644
index 0000000..b2837b2
--- /dev/null
+++ b/binutils/testsuite/binutils-all/remove-section-01.d
@@ -0,0 +1,8 @@
+#PROG: objcopy
+#source: data-sections.s
+#objcopy: --remove-section=.data.aa.* --remove-section=!.data.aa.02
+#readelf: -WS
+
+#...
+ \[ [0-9]+\] \.data\.aa\.02.*
+#...