aboutsummaryrefslogtreecommitdiff
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
parentd039200a7ee8ac170afbdc3b987af553c07fb6a3 (diff)
downloadgdb-f5e98b7d675230fdfee794afa5ebae1fbc2893a2.zip
gdb-f5e98b7d675230fdfee794afa5ebae1fbc2893a2.tar.gz
gdb-f5e98b7d675230fdfee794afa5ebae1fbc2893a2.tar.bz2
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.
-rw-r--r--bfd/ChangeLog4
-rw-r--r--bfd/elf.c1
-rw-r--r--gas/ChangeLog6
-rw-r--r--gas/testsuite/gas/elf/section25.d4
-rw-r--r--gas/testsuite/gas/elf/section26.d6
-rw-r--r--gas/testsuite/gas/elf/section26.s3
6 files changed, 22 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index f401e29..701357c 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,7 @@
+2021-04-23 Eric Botcazou <ebotcazou@adacore.com>
+
+ * elf.c (special_sections_p): Add .persistent.bss.
+
2021-04-23 Jan Beulich <jbeulich@suse.com>
* elf32-i386.c (elf_howto_table): R_386_TLS_DESC_CALL has zero
diff --git a/bfd/elf.c b/bfd/elf.c
index 11ae2f3..4846b7b 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 },
diff --git a/gas/ChangeLog b/gas/ChangeLog
index aedc6ea..696d728 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,9 @@
+2021-04-23 Eric Botcazou<ebotcazou@adacore.com>
+
+ * testsuite/gas/elf/section25.d: Run it everywhere.
+ * testsuite/gas/elf/section26.d: Likewise.
+ * testsuite/gas/elf/section26.s: Add test for .persistent.bss.
+
2021-04-23 Jérôme Gardou <jerome.gardou@gmail.com>
* config/obj-coff-seh.c (obj_coff_seh_pushframe): Allow an
diff --git a/gas/testsuite/gas/elf/section25.d b/gas/testsuite/gas/elf/section25.d
index 0935384..fa09b85 100644
--- a/gas/testsuite/gas/elf/section25.d
+++ b/gas/testsuite/gas/elf/section25.d
@@ -1,7 +1,9 @@
#name: sections 25 (.noinit)
-#target: [supports_noinit_section]
#source: section25.s
#readelf: -S --wide
+# The h8300 port issues a warning message for
+# new sections created without atrributes.
+#xfail: h8300-*
#...
\[..\] .noinit[ ]+NOBITS[ ]+[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 00 WA .*
diff --git a/gas/testsuite/gas/elf/section26.d b/gas/testsuite/gas/elf/section26.d
index 15d85bd..f08f444 100644
--- a/gas/testsuite/gas/elf/section26.d
+++ b/gas/testsuite/gas/elf/section26.d
@@ -1,12 +1,16 @@
#name: sections 26 (.persistent)
-#target: [supports_persistent_section]
#source: section26.s
#readelf: -S --wide
+# The h8300 port issues a warning message for
+# new sections created without atrributes.
+#xfail: h8300-*
#...
\[..\] .persistent[ ]+PROGBITS[ ]+[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 00 WA .*
#...
\[..\] .persistent.foo[ ]+PROGBITS[ ]+[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 00 WA .*
#...
+ \[..\] .persistent.bss[ ]+NOBITS[ ]+[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 00 WA .*
+#...
\[..\] .gnu.linkonce.p.bar[ ]+PROGBITS[ ]+[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 00 WA .*
#pass
diff --git a/gas/testsuite/gas/elf/section26.s b/gas/testsuite/gas/elf/section26.s
index 7f98645..aefe15d 100644
--- a/gas/testsuite/gas/elf/section26.s
+++ b/gas/testsuite/gas/elf/section26.s
@@ -4,5 +4,8 @@
.section .persistent.foo
.word 0
+.section .persistent.bss
+.word 0
+
.section .gnu.linkonce.p.bar
.word 0