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
  • Thank you for confirming. I was able to reproduce the same now just by building "Hello World" without the bootloader. I will investigate further and check with the developers whether this may be a known issue. I was on GCC version 12.2.0 prior to this.

    arm-zephyr-eabi-gcc --version
    arm-zephyr-eabi-gcc (Zephyr SDK 0.17.0) 12.2.0
    Copyright (C) 2022 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions. There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 

Children
Related