summaryrefslogtreecommitdiff
path: root/bfd/elf.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@gcc.gnu.org>2021-04-23 19:07:59 +0200
committerEric Botcazou <ebotcazou@gcc.gnu.org>2021-04-23 19:13:52 +0200
commitf5e98b7d675230fdfee794afa5ebae1fbc2893a2 (patch)
treeefb4c02527179124846ccd92779ac8d41dd1a1c1 /bfd/elf.c
parentd039200a7ee8ac170afbdc3b987af553c07fb6a3 (diff)
Fix type of .persistent.bss section
The change implementing the .persistent family of sections broke the existing support for the .persistent.bss section in the compiler: int a __attribute__ ((section (".persistent.bss"))); t.s: Assembler messages: t.s:4: Warning: setting incorrect section type for .persistent.bss The compiler encodes it as @nobits but the assembler expects @progbits. The assembler is incorrect and should treat the section like the compiler. bfd/ * elf.c (special_sections_p): Add .persistent.bss. gas/ * testsuite/gas/elf/section25.d: Run it everywhere. * testsuite/gas/elf/section26.d: Likewise. * testsuite/gas/elf/section26.s: Add test for .persistent.bss.
Diffstat (limited to 'bfd/elf.c')
-rw-r--r--bfd/elf.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/bfd/elf.c b/bfd/elf.c
index 11ae2f3a81..4846b7bd47 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -2725,6 +2725,7 @@ static const struct bfd_elf_special_section special_sections_n[] =
static const struct bfd_elf_special_section special_sections_p[] =
{
+ { STRING_COMMA_LEN (".persistent.bss"), 0, SHT_NOBITS, SHF_ALLOC + SHF_WRITE },
{ STRING_COMMA_LEN (".persistent"), -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
{ STRING_COMMA_LEN (".preinit_array"), -2, SHT_PREINIT_ARRAY, SHF_ALLOC + SHF_WRITE },
{ STRING_COMMA_LEN (".plt"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR },