diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2024-06-11 10:50:57 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2024-06-17 12:45:07 -0400 |
commit | 863a463cb2d07fce2ae09e2b0f925bdf201051dc (patch) | |
tree | e4374448143cbee5471c6ff42e8133eca1063cad /src/rp2040 | |
parent | ae227d485cdac859b22d77da4072f870bce07740 (diff) | |
download | kutter-863a463cb2d07fce2ae09e2b0f925bdf201051dc.tar.gz kutter-863a463cb2d07fce2ae09e2b0f925bdf201051dc.tar.xz kutter-863a463cb2d07fce2ae09e2b0f925bdf201051dc.zip |
rp2040_link: Explicitly set klipper.elf output section flags to avoid warning
Avoid pointless "LOAD segment with RWX permissions" linker warnings
during the rp2040 build.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/rp2040')
-rw-r--r-- | src/rp2040/rp2040_link.lds.S | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/rp2040/rp2040_link.lds.S b/src/rp2040/rp2040_link.lds.S index 6c2db3c9..abc5be6c 100644 --- a/src/rp2040/rp2040_link.lds.S +++ b/src/rp2040/rp2040_link.lds.S @@ -21,6 +21,16 @@ MEMORY ram (rwx) : ORIGIN = CONFIG_RAM_START , LENGTH = CONFIG_RAM_SIZE } +// Force flags for each output section to avoid RWX linker warning +PHDRS +{ + text_segment PT_LOAD FLAGS(5); // RX flags + ram_vectortable_segment PT_LOAD FLAGS(6); // RW flags + data_segment PT_LOAD FLAGS(6); // RW flags + bss_segment PT_LOAD FLAGS(6); // RW flags + stack_segment PT_LOAD FLAGS(6); // RW flags +} + SECTIONS { .text : { @@ -32,7 +42,7 @@ SECTIONS KEEP(*(.vector_table)) _text_vectortable_end = .; *(.text.armcm_boot*) - } > rom + } > rom :text_segment . = ALIGN(4); _data_flash = .; @@ -41,7 +51,7 @@ SECTIONS _ram_vectortable_start = .; . = . + ( _text_vectortable_end - _text_vectortable_start ) ; _ram_vectortable_end = .; - } > ram + } > ram :ram_vectortable_segment .data : AT (_data_flash) { @@ -53,7 +63,7 @@ SECTIONS *(.data .data.*); . = ALIGN(4); _data_end = .; - } > ram + } > ram :data_segment .bss (NOLOAD) : { @@ -63,14 +73,14 @@ SECTIONS *(COMMON) . = ALIGN(4); _bss_end = .; - } > ram + } > ram :bss_segment _stack_start = CONFIG_RAM_START + CONFIG_RAM_SIZE - CONFIG_STACK_SIZE ; .stack _stack_start (NOLOAD) : { . = . + CONFIG_STACK_SIZE; _stack_end = .; - } > ram + } > ram :stack_segment /DISCARD/ : { // The .init/.fini sections are used by __libc_init_array(), but |