binutils: Add a --strip-section-headers test
authorH.J. Lu <hjl.tools@gmail.com>
Sat, 7 Mar 2020 13:27:12 +0000 (05:27 -0800)
committerH.J. Lu <hjl.tools@gmail.com>
Thu, 29 Jun 2023 17:29:47 +0000 (10:29 -0700)
PR ld/25617
* testsuite/binutils-all/objcopy.exp: Run strip-section-headers-1.
* testsuite/binutils-all/strip-section-headers-1.d: New file.

binutils/testsuite/binutils-all/objcopy.exp
binutils/testsuite/binutils-all/strip-section-headers-1.d [new file with mode: 0644]

index 361e430f1191f43b7073832651fa4f0ebf786d48..41add0fecda0088c57cdd63dff804604ee4fa703 100644 (file)
@@ -1357,6 +1357,11 @@ if [is_elf_format] {
         verbose [file rootname $t]
         run_dump_test [file rootname $t]
     }
+
+    # Test --strip-section-headers
+    run_dump_test "strip-section-headers-1" [list \
+                         [list source strip-15${reloc_format}.s] \
+                         [list as "${elf64} --defsym RELOC=${reloc}"]]
 }
 run_dump_test "localize-hidden-2"
 
diff --git a/binutils/testsuite/binutils-all/strip-section-headers-1.d b/binutils/testsuite/binutils-all/strip-section-headers-1.d
new file mode 100644 (file)
index 0000000..dc249bb
--- /dev/null
@@ -0,0 +1,5 @@
+#PROG: strip
+#strip: -g --strip-section-headers
+#readelf: -S
+
+There are no sections in this file.