]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Re: binutils: Add a test for strip with build notes
authorAlan Modra <amodra@gmail.com>
Sat, 20 Jul 2024 02:53:59 +0000 (12:23 +0930)
committerAlan Modra <amodra@gmail.com>
Sat, 20 Jul 2024 04:24:00 +0000 (13:54 +0930)
The new test wasn't being run, and failed due to relocations against
.gnu.build.attributes being stripped by default strip behaviour.
We probably should be keeping these relocations, but I haven't made
that change here.
BTW, the new test fails on ia64-hpux but that's just a repeat of the
existing note-5 fail.

PR 31999
* testsuite/binutils-all/strip-16.d: strip with --strip-unneeded
and --merge-notes.
* testsuite/binutils-all/objcopy.exp: Run the new test.  Sort
other strip tests.

binutils/testsuite/binutils-all/objcopy.exp
binutils/testsuite/binutils-all/strip-16.d

index 8b432f3b48c45a50dc3075e08be2f3c8b4fc3035..2e105febc2d95cfd738ee74d7054c54fb854a71f 100644 (file)
@@ -1273,6 +1273,11 @@ if [is_elf_format] {
     run_dump_test "strip-7"
     run_dump_test "strip-8"
     run_dump_test "strip-9"
+    # This requires STB_GNU_UNIQUE support with OSABI set to GNU.
+    if { [supports_gnu_unique] } {
+       run_dump_test "strip-10"
+    }
+    run_dump_test "strip-11"
     run_dump_test "strip-12"
 
     if { [istarget "mips64*-*-openbsd*"] \
@@ -1308,12 +1313,7 @@ if [is_elf_format] {
     run_dump_test "strip-15" [list \
                                  [list source strip-15${reloc_format}.s] \
                                  [list as "${elf64} --defsym RELOC=${reloc}"]]
-
-    # This requires STB_GNU_UNIQUE support with OSABI set to GNU.
-    if { [supports_gnu_unique] } {
-       run_dump_test "strip-10"
-    }
-    run_dump_test "strip-11"
+    run_dump_test "strip-16"
 
     if { [istarget "i*86-*"] || [istarget "x86_64-*-*"] } {
        # Check to make sure we don't strip a symbol named in relocations.
index b2c87a97c485d446a12d67c6f4e43a3a01419b30..039a60b8a7c93b2d1cd3a417081b656cbd54f37b 100644 (file)
@@ -1,4 +1,5 @@
 #PROG: strip
+#strip: --strip-unneeded --merge-notes
 #as: --generate-missing-build-notes=yes
 #readelf: --notes --wide
 #name: strip with build notes