[binutils-gdb] Use bfd_rename_section in msp430.em

Alan Modra amodra@sourceware.org
Mon Nov 28 09:46:32 GMT 2022


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=e7d942e0144264e952a735ae4fc41424df47470e

commit e7d942e0144264e952a735ae4fc41424df47470e
Author: Alan Modra <amodra@gmail.com>
Date:   Mon Nov 28 10:14:30 2022 +1030

    Use bfd_rename_section in msp430.em
    
            * emultempl/msp430.em (add_region_prefix <REGION_EITHER>): Use
            bfd_rename_section.
            * testsuite/ld-msp430-elf/msp430-tiny-rom.ld: Handle varian data
            and bss input sections.

Diff:
---
 ld/emultempl/msp430.em                        | 2 +-
 ld/testsuite/ld-msp430-elf/msp430-tiny-rom.ld | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/ld/emultempl/msp430.em b/ld/emultempl/msp430.em
index f188b46b4aa..048e3ebfe5a 100644
--- a/ld/emultempl/msp430.em
+++ b/ld/emultempl/msp430.em
@@ -417,7 +417,7 @@ add_region_prefix (bfd *abfd ATTRIBUTE_UNUSED, asection *s,
       bfd_rename_section (s, concat (".lower", curr_name, NULL));
       break;
     case REGION_EITHER:
-      s->name = concat (".either", curr_name, NULL);
+      bfd_rename_section (s, concat (".either", curr_name, NULL));
       break;
     default:
       /* Unreachable.  */
diff --git a/ld/testsuite/ld-msp430-elf/msp430-tiny-rom.ld b/ld/testsuite/ld-msp430-elf/msp430-tiny-rom.ld
index 3e263796948..c88442377d1 100644
--- a/ld/testsuite/ld-msp430-elf/msp430-tiny-rom.ld
+++ b/ld/testsuite/ld-msp430-elf/msp430-tiny-rom.ld
@@ -26,13 +26,19 @@ SECTIONS
   .data :
   {
     . = ALIGN(2);
+    *(.lower.data.* .lower.data)
     *(.data.* .data)
+    *(.either.data.* .either.data)
+    *(.upper.data.* .upper.data)
   } > RAM AT> ROM
 
   .bss :
   {
     . = ALIGN(2);
+    *(.lower.bss.* .lower.bss)
     *(.bss.* .bss)
+    *(.either.bss.* .either.bss)
+    *(.upper.bss.* .upper.bss)
   } > RAM
 
   .upper.text :


More information about the Binutils-cvs mailing list