]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Revert "ld: testcase for .note.GNU-stack wanting to be SHT_NOTE" etc
authorJan Beulich <jbeulich@suse.com>
Thu, 29 Jan 2026 13:19:54 +0000 (14:19 +0100)
committerJan Beulich <jbeulich@suse.com>
Thu, 29 Jan 2026 13:21:39 +0000 (14:21 +0100)
This reverts commits a1c2fa92ac93bf50227941bd82094e6997c5fd56,
bc6e40a093e700e84b549902d55e73bfe92a113b
("amend "ELF: give .note.GNU-stack proper section type""), and
c8db2c887b4129732341c4a1a51cdcd3191db271
("ELF: give .note.GNU-stack proper section type"). They're deemed
to require a little more testing before being ready for a release.

bfd/elf.c
gas/as.c
ld/ldelf.c
ld/testsuite/ld-elf/note2.d [deleted file]
ld/testsuite/ld-elf/note2.t [deleted file]

index 75a2e0b9358f1563fbc7a576555191e1a541c0e5..1177c3c3016ed83fc5a6e58798e0a6d882a4f145 100644 (file)
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -3139,7 +3139,7 @@ static const struct bfd_elf_special_section special_sections_l[] =
 static const struct bfd_elf_special_section special_sections_n[] =
 {
   { STRING_COMMA_LEN (".noinit"),       -2, SHT_NOBITS,   SHF_ALLOC + SHF_WRITE },
-  { STRING_COMMA_LEN (".note.GNU-stack"), 0, SHT_NOTE,     0 },
+  { STRING_COMMA_LEN (".note.GNU-stack"), 0, SHT_PROGBITS, 0 },
   { STRING_COMMA_LEN (".note"),                 -1, SHT_NOTE,     0 },
   { NULL,                   0,           0, 0,            0 }
 };
index f08c7c71d73d7ff322f9254714291f0953fdfcca..eefcddeaa49b861f495b5b0580315bddace3150b 100644 (file)
--- a/gas/as.c
+++ b/gas/as.c
@@ -1519,7 +1519,7 @@ main (int argc, char ** argv)
       gnustack = subseg_new (".note.GNU-stack", 0);
       bfd_set_section_flags (gnustack,
                             SEC_READONLY | (flag_execstack ? SEC_CODE : 0));
-      elf_section_type (gnustack) = SHT_NOTE;
+
     }
 #endif
 
index fbab75aeefbdee89f38fb240804662b2f4527150..a623d37c4d0542b96f5035164081bcc4340bbc98 100644 (file)
@@ -1328,10 +1328,8 @@ ldelf_after_open (int use_libpath, int native, int is_linux, int is_freebsd,
             effect.  Instead we create a .note.GNU-stack section in much the
             same way as the assembler does with its --[no]execstack option.  */
          flagword flags = SEC_READONLY | (link_info.execstack ? SEC_CODE : 0);
-         s = bfd_make_section_with_flags (link_info.input_bfds,
-                                          ".note.GNU-stack", flags);
-         if (s && bfd_get_flavour (s->owner) == bfd_target_elf_flavour)
-           elf_section_type (s) = SHT_NOTE;
+         (void) bfd_make_section_with_flags (link_info.input_bfds,
+                                             ".note.GNU-stack", flags);
        }
       return;
     }
diff --git a/ld/testsuite/ld-elf/note2.d b/ld/testsuite/ld-elf/note2.d
deleted file mode 100644 (file)
index 16012aa..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-#name: .note.GNU-stack using SHT_NOTE
-#source: empty.s
-#source: property-or-1.s
-#as: --noexecstack --generate-missing-build-notes=no
-#ld: -shared --script note2.t
-#readelf: --notes
-#target: [check_shared_lib_support]
-# Assembly source file for the HPPA assembler is renamed and modifed by
-# sed.  mn10300 has relocations in .note.gnu.property section which
-# elf_parse_notes doesn't support.
-#notarget: am33_2.0-*-* hppa*-*-hpux* mn10300-*-*
-
-#...
-Displaying notes found in: .note
-[      ]+Owner[        ]+Data size[    ]+Description
-  GNU                  0x[0-9a-f]+     NT_GNU_PROPERTY_TYPE_0
-      Properties: UINT32_OR .*
-#pass
diff --git a/ld/testsuite/ld-elf/note2.t b/ld/testsuite/ld-elf/note2.t
deleted file mode 100644 (file)
index 1bf8c18..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-SECTIONS
-{
-  . = . + SIZEOF_HEADERS;
-  .text : { *(.text) *(.plt) *(.rodata) *(.got*) }
-  .note : { *(.note) *(.note.*) }
-  /DISCARD/ : { *(*) }
-}