MCUboot: warning: zephyr/zephyr_pre0.elf has a LOAD segment with RWX permissions

Same problem as  nRF Connect SDK link error with GCC 12 , which was 3 years ago...

Our app builds fine until we enable MCUboot, when we get the above warning, and being good people we have CONFIG_COMPILER_WARNINGS_AS_ERRORS enabled, which means our application can't build.

For now I've added target_link_options(app PUBLIC "LINKER:--no-warn-rwx-segments") to my CMakeLists.txt, but this isn't exactly an optimal solution, especially given how long it took to find it, and I'll have to remember the fix for every other project going forward.

Is there a plan to fix the linker script so it doesn't generate the error?

Parents Reply
  • I have asked around and it does not appear to be a known issue. Internally we are using GCC from the Zephyr SDK  which means we have limited or no test coverage with this toolchain. I also tried Zephyr SDK v1.0.0-beta1 which includes GCC 14.3.0 but that did not trigger in this warning either. Is using the Zephyr SDK with arm-zephyr-eabi-gcc an option for you? This is the recommended toolchain and it greatly reduces the build times when using picolib. 

    It may also be worth adding that the MPU driver is configured to prevent execution from RAM by default.  

Children
Related