aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2022-11-28 10:14:30 +1030
committerAlan Modra <amodra@gmail.com>2022-11-28 17:29:11 +1030
commite7d942e0144264e952a735ae4fc41424df47470e (patch)
tree1e711826464d399f5e9878958b8031f3e0da051f
parent970a38be462bda875ac495c51e93af728a8c98de (diff)
downloadfsf-binutils-gdb-e7d942e0144264e952a735ae4fc41424df47470e.zip
fsf-binutils-gdb-e7d942e0144264e952a735ae4fc41424df47470e.tar.gz
fsf-binutils-gdb-e7d942e0144264e952a735ae4fc41424df47470e.tar.bz2
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.
-rw-r--r--ld/emultempl/msp430.em2
-rw-r--r--ld/testsuite/ld-msp430-elf/msp430-tiny-rom.ld6
2 files changed, 7 insertions, 1 deletions
diff --git a/ld/emultempl/msp430.em b/ld/emultempl/msp430.em
index f188b46..048e3eb 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 3e26379..c884423 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 :