diff options
author | Alan Modra <amodra@gmail.com> | 2023-07-07 17:40:00 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2023-07-12 09:31:40 +0930 |
commit | 9dbd067f964d464b48c5899485786a37057f717e (patch) | |
tree | 9af99046bef63dae04ea186b7595c65e3637fc1e | |
parent | dbe6d432d1f48fe77200cf4baff06d9f8d7debd7 (diff) | |
download | gdb-9dbd067f964d464b48c5899485786a37057f717e.zip gdb-9dbd067f964d464b48c5899485786a37057f717e.tar.gz gdb-9dbd067f964d464b48c5899485786a37057f717e.tar.bz2 |
.noinit and .persistent for msp430
Similar to the previous patch, but also tidy a few more sections.
* scripttempl/elf32msp430.sc (.text, .rodata, .data, .bss, .noinit),
(.persistent): Align the section rather than aligning inside.
-rw-r--r-- | ld/scripttempl/elf32msp430.sc | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/ld/scripttempl/elf32msp430.sc b/ld/scripttempl/elf32msp430.sc index 6edc908..7d5391d 100644 --- a/ld/scripttempl/elf32msp430.sc +++ b/ld/scripttempl/elf32msp430.sc @@ -137,9 +137,9 @@ SECTIONS .rela.plt ${RELOCATING-0} : { *(.rela.plt) } /* Internal text space. */ - .text ${RELOCATING-0} : + .text ${RELOCATING-0} : ${RELOCATING+ALIGN(2)} { - ${RELOCATING+. = ALIGN(2); + ${RELOCATING+ *(SORT_NONE(.init)) *(SORT_NONE(.init0)) /* Start here after reset. */ *(SORT_NONE(.init1)) @@ -189,9 +189,9 @@ SECTIONS _etext = .;} } ${RELOCATING+ > text} - .rodata ${RELOCATING-0} : + .rodata ${RELOCATING-0} : ${RELOCATING+ALIGN(2)} { - ${RELOCATING+. = ALIGN(2); + ${RELOCATING+ *(.lower.rodata.* .lower.rodata) . = ALIGN(2); @@ -254,11 +254,11 @@ SECTIONS ${RELOCATING+ _vectors_end = . ; } } ${RELOCATING+ > vectors} - .data ${RELOCATING-0} : + .data ${RELOCATING-0} : ${RELOCATING+ALIGN(2)} { - ${RELOCATING+ PROVIDE (__data_start = .) ; } - ${RELOCATING+ PROVIDE (__datastart = .) ; } - ${RELOCATING+. = ALIGN(2); + ${RELOCATING+ + PROVIDE (__data_start = .) ; + PROVIDE (__datastart = .) ; KEEP (*(.jcr)) *(.data.rel.ro.local) *(.data.rel.ro*) @@ -287,9 +287,8 @@ SECTIONS ${RELOCATING+__romdatastart = LOADADDR(.data); __romdatacopysize = SIZEOF(.data);} - .bss ${RELOCATING-0}${RELOCATING+SIZEOF(.data) + ADDR(.data)} : + .bss ${RELOCATING-0}${RELOCATING+ALIGN(SIZEOF(.data) + ADDR(.data), 2)} : { - ${RELOCATING+. = ALIGN(2);} ${RELOCATING+ PROVIDE (__bss_start = .); } ${RELOCATING+ PROVIDE (__bssstart = .); *(.lower.bss.* .lower.bss) @@ -304,9 +303,8 @@ SECTIONS /* This section contains data that is not initialized during load, or during the application's initialization sequence. */ - .noinit ${RELOCATING-0}${RELOCATING+SIZEOF(.bss) + ADDR(.bss)} : + .noinit ${RELOCATING-0}${RELOCATING+ALIGN(SIZEOF(.bss) + ADDR(.bss), 2)} : { - ${RELOCATING+. = ALIGN(2);} ${RELOCATING+ PROVIDE (__noinit_start = .) ; } *(.noinit${RELOCATING+ .noinit.* .gnu.linkonce.n.*}) ${RELOCATING+. = ALIGN(2);} @@ -315,9 +313,8 @@ SECTIONS /* This section contains data that is initialized during load, but not during the application's initialization sequence. */ - .persistent ${RELOCATING-0}${RELOCATING+SIZEOF(.noinit) + ADDR(.noinit)} : + .persistent ${RELOCATING-0}${RELOCATING+ALIGN(SIZEOF(.noinit) + ADDR(.noinit), 2)} : { - ${RELOCATING+. = ALIGN(2);} ${RELOCATING+ PROVIDE (__persistent_start = .) ; } *(.persistent${RELOCATING+ .persistent.* .gnu.linkonce.p.*}) ${RELOCATING+. = ALIGN(2);} |