arm64: linker: move data section between rodata and bss
Having .data after .bss creates a big empty gap in zephyr.bin to provide
proper offset for the data section. Reversing them allows for dropping
.bss from zephyr.bin's output as it is typically done, saving precious
flash memory space.
For demonstration purpose, let's consider those changes:
|--- a/samples/hello_world/src/main.c
|+++ b/samples/hello_world/src/main.c
|@@ -6,9 +6,12 @@
|
| #include <stdio.h>
|
|+int dummybuf[1024 * 1024];
|+
| int main(void)
| {
| printf("Hello World! %s\n", CONFIG_BOARD_TARGET);
|+ dummybuf[0] = 42;
|
| return 0;
| }
Before this commit:
$ ls -l build/zephyr/zephyr.bin
-rwxr-xr-x 1 nico nico 4561908 Aug 2 15:13 build/zephyr/zephyr.bin*
After this commit:
$ ls -l build/zephyr/zephyr.bin
-rwxr-xr-x 1 nico nico 37028 Aug 2 15:17 build/zephyr/zephyr.bin*
While at it, remove some more repetitive comments with no value.
Also defaults CONFIG_LINKER_LAST_SECTION_ID to n as it otherwise screws
everything up for the same reason as above.
Signed-off-by:
Nicolas Pitre <npitre@baylibre.com>
Loading
Please sign in to comment