From: Alan Modra Date: Sun, 27 Nov 2022 23:44:30 +0000 (+1030) Subject: Use bfd_rename_section in msp430.em X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e7d942e0144264e952a735ae4fc41424df47470e;p=binutils-gdb.git Use bfd_rename_section in msp430.em * emultempl/msp430.em (add_region_prefix ): Use bfd_rename_section. * testsuite/ld-msp430-elf/msp430-tiny-rom.ld: Handle varian data and bss input sections. --- 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 :