Use bfd_rename_section in msp430.em
authorAlan Modra <amodra@gmail.com>
Sun, 27 Nov 2022 23:44:30 +0000 (10:14 +1030)
committerAlan Modra <amodra@gmail.com>
Mon, 28 Nov 2022 06:59:11 +0000 (17:29 +1030)
* 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.

ld/emultempl/msp430.em
ld/testsuite/ld-msp430-elf/msp430-tiny-rom.ld

index f188b46b4aa9b48bfdf46e6f442285683b39a49e..048e3ebfe5aec3400349de9a1b4e20f32c12b3a6 100644 (file)
@@ -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.  */
index 3e2637969483b04c6960fd943c769fa4974b5e26..c88442377d1fe8d863887bde9e810b9368c44c37 100644 (file)
@@ -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 :