From d44f8065da91c4030278e7a6df3d4e263b422d55 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 5 Jun 2025 08:54:25 -0700 Subject: [PATCH] soc/esp32c6: Discard .note.GNU-stack sections while linking These sections are simple stack behavior annotations and are not needed in the final executable. Signed-off-by: Keith Packard --- soc/espressif/esp32c6/default_lpcore.ld | 3 +++ 1 file changed, 3 insertions(+) diff --git a/soc/espressif/esp32c6/default_lpcore.ld b/soc/espressif/esp32c6/default_lpcore.ld index 2730eaffbb4..bb5f0d04976 100644 --- a/soc/espressif/esp32c6/default_lpcore.ld +++ b/soc/espressif/esp32c6/default_lpcore.ld @@ -121,6 +121,9 @@ SECTIONS __stack_top = ORIGIN(ram) + LENGTH(ram); #include + + /DISCARD/ : { *(.note.GNU-stack) } + SECTION_PROLOGUE(.riscv.attributes, 0,) { KEEP(*(.riscv.attributes))