]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gas/ELF: drop bogus check for ELFOSABI_STANDALONE
authorJan Beulich <jbeulich@suse.com>
Fri, 15 Aug 2025 10:18:03 +0000 (12:18 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 15 Aug 2025 10:18:03 +0000 (12:18 +0200)
obj_elf_parse_section_letters() checking for that ABI, when the checking
at the bottom of obj_elf_section() and the logic in
_bfd_elf_final_write_processing() don't, makes no sense. Either
STANDALONE is meant to be GNU-ish, or it is not, I would think. Drop the
one inconsistent check.

If it was not GNU-ish (as the other two locations suggest), what did the
section23b testcase actually mean to check? The numeric attribute value
0x200000 has an entirely unknown (or more precisely, OS-defined, which
we may or may not know of) meaning then, so ought to be accepted. If it
was GNU-ish, the other testcase, elf/section23a, would want running for
those targets as well, and the testcase in question would still be wrong
to have. Hence that testcase is removed, and section23a is renamed to
just section23.

gas/config/obj-elf.c
gas/testsuite/gas/elf/elf.exp
gas/testsuite/gas/elf/section23.d [moved from gas/testsuite/gas/elf/section23a.d with 100% similarity]
gas/testsuite/gas/elf/section23b.d [deleted file]
gas/testsuite/gas/elf/section23b.err [deleted file]

index 315d08ea9963c44d6dcf86f00df8676574179d2f..a209a9be7d6395f3f56c5007ae98cba82d9117e3 100644 (file)
@@ -950,14 +950,13 @@ obj_elf_parse_section_letters (char *str, size_t len,
                  bed = get_elf_backend_data (stdoutput);
 
                  if (bed->elf_osabi == ELFOSABI_NONE
-                     || bed->elf_osabi == ELFOSABI_STANDALONE
                      || bed->elf_osabi == ELFOSABI_GNU
                      || bed->elf_osabi == ELFOSABI_FREEBSD)
                    {
                      /* Add flags in the SHF_MASKOS range to gnu_attr for
                         OSABIs that support those flags.
-                        Also adding the flags for ELFOSABI_{NONE,STANDALONE}
-                        allows them to be validated later in obj_elf_section.
+                        Also adding the flags for ELFOSABI_NONE allows them
+                        to be validated later in obj_elf_section.
                         We can't just always set these bits in gnu_attr for
                         all OSABIs, since Binutils does not recognize all
                         SHF_MASKOS bits for non-GNU OSABIs.  It's therefore
index 1f42c3f372326f630eadbd7f83068e4f25c5dcca..ab97e5e751b7783699d2141302b949ab26891963 100644 (file)
@@ -281,8 +281,7 @@ if { [is_elf_format] } then {
     run_dump_test "section20"
     run_dump_test "section21"
     run_dump_test "section22"
-    run_dump_test "section23a"
-    run_dump_test "section23b"
+    run_dump_test "section23"
     run_dump_test "section24a"
     run_dump_test "section24b"
     run_dump_test "section25"
diff --git a/gas/testsuite/gas/elf/section23b.d b/gas/testsuite/gas/elf/section23b.d
deleted file mode 100644 (file)
index c85200e..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#name: SHF_GNU_RETAIN set with numeric flag value in .section for non-GNU OSABI target
-#source: section23.s
-#error_output: section23b.err
-#target: msp430-*-elf visium-*-elf
-
-# This test only runs for targets which set ELFOSABI_STANDALONE.
diff --git a/gas/testsuite/gas/elf/section23b.err b/gas/testsuite/gas/elf/section23b.err
deleted file mode 100644 (file)
index 83de60c..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-.*: Assembler messages:
-.*:1: Error: GNU_RETAIN section is supported only by GNU and FreeBSD targets