From 5995714cfd331997dd3f935083942477577e3678 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 16 Sep 2019 08:14:32 -0600 Subject: [PATCH] boards/mips Linker Scripts: The PIC32M* start-up code initializes .bss by writing 16 bytes at a time in a loop. The start (_sbss) alignment is only required to be 4 bytes since the write is done with 4 store instructions. In a previous change, the end address, _ebss, was aligned to 16 byte to prevent initializing past the end off the .bss region. However, that does not work unless the start address, _sbss, is also aligned to 16 bytes. --- boards/mips/pic32mx/mirtoo/scripts/c32-debug.ld | 1 + boards/mips/pic32mx/mirtoo/scripts/c32-release.ld | 1 + boards/mips/pic32mx/mirtoo/scripts/mips-elf-debug.ld | 1 + boards/mips/pic32mx/mirtoo/scripts/mips-elf-release.ld | 1 + boards/mips/pic32mx/mirtoo/scripts/xc32-debug.ld | 1 + boards/mips/pic32mx/mirtoo/scripts/xc32-release.ld | 1 + boards/mips/pic32mx/pic32mx-starterkit/scripts/c32-release.ld | 1 + boards/mips/pic32mx/pic32mx-starterkit/scripts/mips-release.ld | 1 + boards/mips/pic32mx/pic32mx7mmb/scripts/c32-release.ld | 1 + boards/mips/pic32mx/pic32mx7mmb/scripts/mips-release.ld | 1 + boards/mips/pic32mx/sure-pic32mx/scripts/c32-release.ld | 1 + boards/mips/pic32mx/sure-pic32mx/scripts/mips-release.ld | 1 + boards/mips/pic32mx/ubw32/scripts/c32-release.ld | 1 + boards/mips/pic32mx/ubw32/scripts/mips-release.ld | 1 + boards/mips/pic32mz/flipnclick-pic32mz/scripts/c32-debug.ld | 1 + boards/mips/pic32mz/flipnclick-pic32mz/scripts/mips-debug.ld | 1 + boards/mips/pic32mz/flipnclick-pic32mz/scripts/pinguino-debug.ld | 1 + boards/mips/pic32mz/flipnclick-pic32mz/scripts/xc32-debug.ld | 1 + boards/mips/pic32mz/pic32mz-starterkit/scripts/c32-debug.ld | 1 + boards/mips/pic32mz/pic32mz-starterkit/scripts/mips-debug.ld | 1 + boards/mips/pic32mz/pic32mz-starterkit/scripts/pinguino-debug.ld | 1 + boards/mips/pic32mz/pic32mz-starterkit/scripts/xc32-debug.ld | 1 + 22 files changed, 22 insertions(+) diff --git a/boards/mips/pic32mx/mirtoo/scripts/c32-debug.ld b/boards/mips/pic32mx/mirtoo/scripts/c32-debug.ld index de41eea585..d6d6983479 100644 --- a/boards/mips/pic32mx/mirtoo/scripts/c32-debug.ld +++ b/boards/mips/pic32mx/mirtoo/scripts/c32-debug.ld @@ -253,6 +253,7 @@ SECTIONS .sbss : { + . = ALIGN(16); _sbss = ABSOLUTE(.); *(.dynsbss) *(.sbss .sbss.* .gnu.linkonce.sb.*) diff --git a/boards/mips/pic32mx/mirtoo/scripts/c32-release.ld b/boards/mips/pic32mx/mirtoo/scripts/c32-release.ld index b6c778f5cb..b9e38801a7 100644 --- a/boards/mips/pic32mx/mirtoo/scripts/c32-release.ld +++ b/boards/mips/pic32mx/mirtoo/scripts/c32-release.ld @@ -255,6 +255,7 @@ SECTIONS .sbss : { + . = ALIGN(16); _sbss = ABSOLUTE(.); *(.dynsbss) *(.sbss .sbss.* .gnu.linkonce.sb.*) diff --git a/boards/mips/pic32mx/mirtoo/scripts/mips-elf-debug.ld b/boards/mips/pic32mx/mirtoo/scripts/mips-elf-debug.ld index 3487bae1c2..d679a7fcab 100644 --- a/boards/mips/pic32mx/mirtoo/scripts/mips-elf-debug.ld +++ b/boards/mips/pic32mx/mirtoo/scripts/mips-elf-debug.ld @@ -253,6 +253,7 @@ SECTIONS .sbss : { + . = ALIGN(16); _sbss = ABSOLUTE(.); *(.dynsbss) *(.sbss .sbss.* .gnu.linkonce.sb.*) diff --git a/boards/mips/pic32mx/mirtoo/scripts/mips-elf-release.ld b/boards/mips/pic32mx/mirtoo/scripts/mips-elf-release.ld index cce87e4f10..8fe496ecaa 100644 --- a/boards/mips/pic32mx/mirtoo/scripts/mips-elf-release.ld +++ b/boards/mips/pic32mx/mirtoo/scripts/mips-elf-release.ld @@ -255,6 +255,7 @@ SECTIONS .sbss : { + . = ALIGN(16); _sbss = ABSOLUTE(.); *(.dynsbss) *(.sbss .sbss.* .gnu.linkonce.sb.*) diff --git a/boards/mips/pic32mx/mirtoo/scripts/xc32-debug.ld b/boards/mips/pic32mx/mirtoo/scripts/xc32-debug.ld index 482aea339e..4b89794f8b 100644 --- a/boards/mips/pic32mx/mirtoo/scripts/xc32-debug.ld +++ b/boards/mips/pic32mx/mirtoo/scripts/xc32-debug.ld @@ -253,6 +253,7 @@ SECTIONS .sbss : { + . = ALIGN(16); _sbss = ABSOLUTE(.); *(.dynsbss) *(.sbss .sbss.* .gnu.linkonce.sb.*) diff --git a/boards/mips/pic32mx/mirtoo/scripts/xc32-release.ld b/boards/mips/pic32mx/mirtoo/scripts/xc32-release.ld index f39e026ce0..d8fda78ddd 100644 --- a/boards/mips/pic32mx/mirtoo/scripts/xc32-release.ld +++ b/boards/mips/pic32mx/mirtoo/scripts/xc32-release.ld @@ -255,6 +255,7 @@ SECTIONS .sbss : { + . = ALIGN(16); _sbss = ABSOLUTE(.); *(.dynsbss) *(.sbss .sbss.* .gnu.linkonce.sb.*) diff --git a/boards/mips/pic32mx/pic32mx-starterkit/scripts/c32-release.ld b/boards/mips/pic32mx/pic32mx-starterkit/scripts/c32-release.ld index a670b70da7..a38af5ae89 100644 --- a/boards/mips/pic32mx/pic32mx-starterkit/scripts/c32-release.ld +++ b/boards/mips/pic32mx/pic32mx-starterkit/scripts/c32-release.ld @@ -257,6 +257,7 @@ SECTIONS .sbss : { + . = ALIGN(16); _sbss = ABSOLUTE(.); *(.dynsbss) *(.sbss .sbss.* .gnu.linkonce.sb.*) diff --git a/boards/mips/pic32mx/pic32mx-starterkit/scripts/mips-release.ld b/boards/mips/pic32mx/pic32mx-starterkit/scripts/mips-release.ld index ee42b078d3..6d6f100205 100644 --- a/boards/mips/pic32mx/pic32mx-starterkit/scripts/mips-release.ld +++ b/boards/mips/pic32mx/pic32mx-starterkit/scripts/mips-release.ld @@ -257,6 +257,7 @@ SECTIONS .sbss : { + . = ALIGN(16); _sbss = ABSOLUTE(.); *(.dynsbss) *(.sbss .sbss.* .gnu.linkonce.sb.*) diff --git a/boards/mips/pic32mx/pic32mx7mmb/scripts/c32-release.ld b/boards/mips/pic32mx/pic32mx7mmb/scripts/c32-release.ld index dd04cf9178..9e2323a6ac 100644 --- a/boards/mips/pic32mx/pic32mx7mmb/scripts/c32-release.ld +++ b/boards/mips/pic32mx/pic32mx7mmb/scripts/c32-release.ld @@ -257,6 +257,7 @@ SECTIONS .sbss : { + . = ALIGN(16); _sbss = ABSOLUTE(.); *(.dynsbss) *(.sbss .sbss.* .gnu.linkonce.sb.*) diff --git a/boards/mips/pic32mx/pic32mx7mmb/scripts/mips-release.ld b/boards/mips/pic32mx/pic32mx7mmb/scripts/mips-release.ld index 6bae116a40..a457905a90 100644 --- a/boards/mips/pic32mx/pic32mx7mmb/scripts/mips-release.ld +++ b/boards/mips/pic32mx/pic32mx7mmb/scripts/mips-release.ld @@ -257,6 +257,7 @@ SECTIONS .sbss : { + . = ALIGN(16); _sbss = ABSOLUTE(.); *(.dynsbss) *(.sbss .sbss.* .gnu.linkonce.sb.*) diff --git a/boards/mips/pic32mx/sure-pic32mx/scripts/c32-release.ld b/boards/mips/pic32mx/sure-pic32mx/scripts/c32-release.ld index fe05953ef8..8947f19432 100644 --- a/boards/mips/pic32mx/sure-pic32mx/scripts/c32-release.ld +++ b/boards/mips/pic32mx/sure-pic32mx/scripts/c32-release.ld @@ -257,6 +257,7 @@ SECTIONS .sbss : { + . = ALIGN(16); _sbss = ABSOLUTE(.); *(.dynsbss) *(.sbss .sbss.* .gnu.linkonce.sb.*) diff --git a/boards/mips/pic32mx/sure-pic32mx/scripts/mips-release.ld b/boards/mips/pic32mx/sure-pic32mx/scripts/mips-release.ld index d3edbf9459..9ef11a4bdd 100644 --- a/boards/mips/pic32mx/sure-pic32mx/scripts/mips-release.ld +++ b/boards/mips/pic32mx/sure-pic32mx/scripts/mips-release.ld @@ -257,6 +257,7 @@ SECTIONS .sbss : { + . = ALIGN(16); _sbss = ABSOLUTE(.); *(.dynsbss) *(.sbss .sbss.* .gnu.linkonce.sb.*) diff --git a/boards/mips/pic32mx/ubw32/scripts/c32-release.ld b/boards/mips/pic32mx/ubw32/scripts/c32-release.ld index 2f66fdf3e6..0050c5eaf5 100644 --- a/boards/mips/pic32mx/ubw32/scripts/c32-release.ld +++ b/boards/mips/pic32mx/ubw32/scripts/c32-release.ld @@ -257,6 +257,7 @@ SECTIONS .sbss : { + . = ALIGN(16); _sbss = ABSOLUTE(.); *(.dynsbss) *(.sbss .sbss.* .gnu.linkonce.sb.*) diff --git a/boards/mips/pic32mx/ubw32/scripts/mips-release.ld b/boards/mips/pic32mx/ubw32/scripts/mips-release.ld index 5b73ee4601..6377698ff9 100644 --- a/boards/mips/pic32mx/ubw32/scripts/mips-release.ld +++ b/boards/mips/pic32mx/ubw32/scripts/mips-release.ld @@ -257,6 +257,7 @@ SECTIONS .sbss : { + . = ALIGN(16); _sbss = ABSOLUTE(.); *(.dynsbss) *(.sbss .sbss.* .gnu.linkonce.sb.*) diff --git a/boards/mips/pic32mz/flipnclick-pic32mz/scripts/c32-debug.ld b/boards/mips/pic32mz/flipnclick-pic32mz/scripts/c32-debug.ld index b11d9e2d41..5b4e650509 100644 --- a/boards/mips/pic32mz/flipnclick-pic32mz/scripts/c32-debug.ld +++ b/boards/mips/pic32mz/flipnclick-pic32mz/scripts/c32-debug.ld @@ -276,6 +276,7 @@ SECTIONS .sbss : { + . = ALIGN(16); _sbss = ABSOLUTE(.); *(.dynsbss) *(.sbss .sbss.* .gnu.linkonce.sb.*) diff --git a/boards/mips/pic32mz/flipnclick-pic32mz/scripts/mips-debug.ld b/boards/mips/pic32mz/flipnclick-pic32mz/scripts/mips-debug.ld index f4416b79eb..1e6b70437d 100644 --- a/boards/mips/pic32mz/flipnclick-pic32mz/scripts/mips-debug.ld +++ b/boards/mips/pic32mz/flipnclick-pic32mz/scripts/mips-debug.ld @@ -276,6 +276,7 @@ SECTIONS .sbss : { + . = ALIGN(16); _sbss = ABSOLUTE(.); *(.dynsbss) *(.sbss .sbss.* .gnu.linkonce.sb.*) diff --git a/boards/mips/pic32mz/flipnclick-pic32mz/scripts/pinguino-debug.ld b/boards/mips/pic32mz/flipnclick-pic32mz/scripts/pinguino-debug.ld index 401064dcbe..9dd2bc8c4c 100644 --- a/boards/mips/pic32mz/flipnclick-pic32mz/scripts/pinguino-debug.ld +++ b/boards/mips/pic32mz/flipnclick-pic32mz/scripts/pinguino-debug.ld @@ -276,6 +276,7 @@ SECTIONS .sbss : { + . = ALIGN(16); _sbss = ABSOLUTE(.); *(.dynsbss) *(.sbss .sbss.* .gnu.linkonce.sb.*) diff --git a/boards/mips/pic32mz/flipnclick-pic32mz/scripts/xc32-debug.ld b/boards/mips/pic32mz/flipnclick-pic32mz/scripts/xc32-debug.ld index e3ef7c044d..4809b36c41 100644 --- a/boards/mips/pic32mz/flipnclick-pic32mz/scripts/xc32-debug.ld +++ b/boards/mips/pic32mz/flipnclick-pic32mz/scripts/xc32-debug.ld @@ -276,6 +276,7 @@ SECTIONS .sbss : { + . = ALIGN(16); _sbss = ABSOLUTE(.); *(.dynsbss) *(.sbss .sbss.* .gnu.linkonce.sb.*) diff --git a/boards/mips/pic32mz/pic32mz-starterkit/scripts/c32-debug.ld b/boards/mips/pic32mz/pic32mz-starterkit/scripts/c32-debug.ld index 70fb72e209..0c4dca9269 100644 --- a/boards/mips/pic32mz/pic32mz-starterkit/scripts/c32-debug.ld +++ b/boards/mips/pic32mz/pic32mz-starterkit/scripts/c32-debug.ld @@ -276,6 +276,7 @@ SECTIONS .sbss : { + . = ALIGN(16); _sbss = ABSOLUTE(.); *(.dynsbss) *(.sbss .sbss.* .gnu.linkonce.sb.*) diff --git a/boards/mips/pic32mz/pic32mz-starterkit/scripts/mips-debug.ld b/boards/mips/pic32mz/pic32mz-starterkit/scripts/mips-debug.ld index 4cd4cf0bdb..619bb73095 100644 --- a/boards/mips/pic32mz/pic32mz-starterkit/scripts/mips-debug.ld +++ b/boards/mips/pic32mz/pic32mz-starterkit/scripts/mips-debug.ld @@ -276,6 +276,7 @@ SECTIONS .sbss : { + . = ALIGN(16); _sbss = ABSOLUTE(.); *(.dynsbss) *(.sbss .sbss.* .gnu.linkonce.sb.*) diff --git a/boards/mips/pic32mz/pic32mz-starterkit/scripts/pinguino-debug.ld b/boards/mips/pic32mz/pic32mz-starterkit/scripts/pinguino-debug.ld index 087d9e5a5a..1be9eba92d 100644 --- a/boards/mips/pic32mz/pic32mz-starterkit/scripts/pinguino-debug.ld +++ b/boards/mips/pic32mz/pic32mz-starterkit/scripts/pinguino-debug.ld @@ -276,6 +276,7 @@ SECTIONS .sbss : { + . = ALIGN(16); _sbss = ABSOLUTE(.); *(.dynsbss) *(.sbss .sbss.* .gnu.linkonce.sb.*) diff --git a/boards/mips/pic32mz/pic32mz-starterkit/scripts/xc32-debug.ld b/boards/mips/pic32mz/pic32mz-starterkit/scripts/xc32-debug.ld index b2c888f7f4..1b39818a7b 100644 --- a/boards/mips/pic32mz/pic32mz-starterkit/scripts/xc32-debug.ld +++ b/boards/mips/pic32mz/pic32mz-starterkit/scripts/xc32-debug.ld @@ -276,6 +276,7 @@ SECTIONS .sbss : { + . = ALIGN(16); _sbss = ABSOLUTE(.); *(.dynsbss) *(.sbss .sbss.* .gnu.linkonce.sb.*)