aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorTucker <tuckkern@sourceware@gmail.com>2021-07-12 17:12:13 +0100
committerNick Clifton <nickc@redhat.com>2021-07-12 17:12:13 +0100
commitef744040b49e92ecd3de3ae3b94c8f85020111c3 (patch)
treec7683e27737656fcb6c1a0d2ef6ac3f6635626ee /gas
parent16e7bd3b25bb5715e5161926713094a2982c9c7a (diff)
downloadfsf-binutils-gdb-ef744040b49e92ecd3de3ae3b94c8f85020111c3.zip
fsf-binutils-gdb-ef744040b49e92ecd3de3ae3b94c8f85020111c3.tar.gz
fsf-binutils-gdb-ef744040b49e92ecd3de3ae3b94c8f85020111c3.tar.bz2
Add the SEC_ELF_OCTETS flag to debug sections created by the assembler.
PR 28054 gas * config/obj-elf.c (obj_elf_change_section): Set the SEF_ELF_OCTETS flag on debug sections.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog6
-rw-r--r--gas/config/obj-elf.c16
2 files changed, 22 insertions, 0 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 0bcf9ff..432506b 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,9 @@
+2021-07-12 Tucker <tuckkern@sourceware@gmail.com>
+
+ PR 28054
+ * config/obj-elf.c (obj_elf_change_section): Set the
+ SEF_ELF_OCTETS flag on debug sections.
+
2021-06-07 Andreas Krebbel <krebbel@linux.ibm.com>
* testsuite/gas/s390/zarch-arch14.d: Add qpaci.
diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c
index e93d59c..42a3851 100644
--- a/gas/config/obj-elf.c
+++ b/gas/config/obj-elf.c
@@ -743,6 +743,22 @@ obj_elf_change_section (const char *name,
if (linkonce)
flags |= SEC_LINK_ONCE | SEC_LINK_DUPLICATES_DISCARD;
+ /* PR 28054: Set the SEC_ELF_OCTETS flag for debugging sections.
+ Based on the code in bfd/elf.c:_bfd_elf_make_section_from_shdr().
+
+ FIXME: We do not set the SEC_DEBUGGING flag because that causes
+ problems for the FT32 and MSP430 targets. Investigate and fix. */
+ if ((flags & SEC_ALLOC) == 0 && name [0] == '.')
+ {
+ if ( startswith (name, ".debug")
+ || startswith (name, ".zdebug")
+ || startswith (name, ".gnu.debuglto_.debug_")
+ || startswith (name, ".gnu.linkonce.wi.")
+ || startswith (name, GNU_BUILD_ATTRS_SECTION_NAME)
+ || startswith (name, ".note.gnu"))
+ flags |= SEC_ELF_OCTETS;
+ }
+
if (old_sec == NULL)
{
symbolS *secsym;