Skip to main content
chriskuku
Senior II
March 31, 2025
Solved

warning in build (Stm32CubeIDE 1.18.0) load segment with RWX permissions

  • March 31, 2025
  • 3 replies
  • 881 views
/Applications/STM32CubeIDE.app/Contents/Eclipse/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.13.3.rel1.macos64_1.0.0.202411102158/tools/bin/../lib/gcc/arm-none-eabi/13.3.1/../../../../arm-none-eabi/bin/ld: warning: pedal13.elf has a LOAD segment with RWX permissions

 

When launching a build in my project (IDE C/C++) , I'm getting the above in the console window from the build.
Is this normal? Should I care?

Best answer by Andrew Neil

This article explains what the warnings are, why they've "suddenly" started appearing, and what to do about them - including just disabling the warning:

https://www.redhat.com/en/blog/linkers-warnings-about-executable-stacks-and-segments

 

#rwxWarning

3 replies

Pavel A.
Super User
March 31, 2025

Usually you should care about warnings and unusual messages. This one can be ignored for many STM32 models because yes, the memory is defined in the linker scripts as RWX. If this annoys, change the attributes so that no memory block has W and X together.

 

chriskuku
chriskukuAuthor
Senior II
April 1, 2025

I'm a bit clueless where this is made. I can find a piece of code in

<project_name>.map (excerpt):

Memory Configuration
 
Name Origin Length Attributes
RAM 0x20000000 0x00005000 xrw
FLASH 0x08000000 0x00010000 xr
*default* 0x00000000 0xffffffff

Linker script and memory map

But wouldn't  it  be normal to give RAM these attributes (rwx)?

Defined in the loader file:
STM32F103C8TX_FLASH.ld

/* Memories definition */
MEMORY
{
 RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 20K
 FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 64K
}

 

And I changed this to `rw` to no avail. The warning persists.

 

Would it be possible to increase the linker verbosity to find out which segment is the culprit?

Andrew Neil
Super User
April 1, 2025

This is defined in the linker script - the .ld file; eg,

/* Memories definition */
MEMORY
{
 RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 8K
 FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 64K
}

 

Remove the 'x' from RAM, if you wish

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Andrew Neil
Andrew NeilBest answer
Super User
April 1, 2025

This article explains what the warnings are, why they've "suddenly" started appearing, and what to do about them - including just disabling the warning:

https://www.redhat.com/en/blog/linkers-warnings-about-executable-stacks-and-segments

 

#rwxWarning

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Andrew Neil
Super User
April 8, 2025
A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.