cancel
Showing results for 
Search instead for 
Did you mean: 

elf has a LOAD segment with RWX permissions when using .RamFunc functions

RobDeatherage
Associate

I've seen other posts to resolve the compiler warning of "elf has a LOAD segment with RWX permissions", but I'm receiving this warning only when calling functions in RAM using the .RamFunc segment attribute.

 

From the map file I've verified the function is being loaded into RAM.  I could disable the warning, but would like to understand the underlying issue.

 

I'm working with the latest STMCubeIDE version 1.16.0, but also saw this in 1.15.0.  I'm building code for the STM3H735 and STM32H745 families.

2 REPLIES 2
TDK
Guru

Issue is probably write + execute. Typically you don't have write permission to sections where you are executing code. Code should be static.

Try the READONLY attribute.

ld - GNU Linker: ELF has a LOAD segment with RWX permissions. Embedded ARM project - Stack Overflow

If you feel a post has answered your question, please click "Accept as Solution".
Pavel A.
Evangelist III

The .ld files shipped with CubeIDE have the "w" attribute for the internal flash. (For 'historic reasons' ?)

Actually the flash can be declared as "rx" because it is not writable from the linker POV. The linker does not care about runtime behavior, it is not aware of MPU and so on. So it's up to the developers how they get rid of this warning.