Skip to content
Commit 87f68b4d authored by Nicolas Pitre's avatar Nicolas Pitre Committed by Fabio Baltieri
Browse files

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: default avatarNicolas Pitre <npitre@baylibre.com>
parent fc7e8fb8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment