2024-08-02 11:15 AM
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.
2024-08-02 11:27 AM
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
2024-08-02 12:16 PM
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.