Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8041

SDK • Linker leaves holes in RAM - how to avoid

$
0
0
I've got a data structure that I want to align in Memory

Code:

unsigned char __attribute__ ((aligned (4096))) DMAbuff[4096];
This works as expected but, depending on where it appears in memory the linker leaves unused up to 0x1000 of memory rather than filling in the memory with other variables that are declared after and could easily fit. I can't afford to lose up to 4095 bytes of precious RAM

Is this just a limitation of the linker or is there any sort of option I can set to get round this? I know I could define a separate psect for the variable but this would mean creating a non-standard linker script for every variant of the program

Statistics: Posted by matherp — Thu Jul 31, 2025 1:53 pm



Viewing all articles
Browse latest Browse all 8041

Trending Articles