apache / nuttx

Apache NuttX is a mature, real-time embedded operating system (RTOS)
https://nuttx.apache.org/
Apache License 2.0
2.92k stars 1.19k forks source link

Fix arm-none-eabi-ld: warning: /github/workspace/sources/nuttx/nuttx has a LOAD segment with RWX permissions #11462

Open xiaoxiang781216 opened 11 months ago

xiaoxiang781216 commented 11 months ago

Report from all ci console, like this: https://github.com/apache/nuttx/actions/runs/7347758008/job/20004759931

pkarashchenko commented 11 months ago

I'm not sure how to fix this especially when the part of the code is relocated to SRAM.

codusnocturnus commented 10 months ago

Just getting into this level of development, and am only working with STM32, so I can't say it's an all-around fix with no edge cases, but the solution on this blog seems to work: Solution to LOAD segment with RWX permissions warning with CMSIS

To summarize, define a PHDRS block in the linker script with descriptions for the text, data, and bss segments, and assign the segments to the related output sections.

The warning goes away, and the ELF listing will show that the flags on segment 0 are now "correct".