nuttx icon indicating copy to clipboard operation
nuttx copied to clipboard

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

Open xiaoxiang781216 opened this issue 2 years ago • 2 comments

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

xiaoxiang781216 avatar Dec 28 '23 19:12 xiaoxiang781216

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

pkarashchenko avatar Dec 28 '23 22:12 pkarashchenko

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".

codusnocturnus avatar Feb 04 '24 19:02 codusnocturnus