While working on a patching problem (https://sebiik.github.io/community.axoloti.com.backup/t/maximum-patch-size/1483/9) I've been studying how the Axoloti Core allocates its memory, and there are some things that I don't understand in the .ld files.
In the firmware .ld file STM32F407xG.ld 44 k (from address 0x2000000, i.e. 0x2000000..0x2000B000) is allocated as RAM, with the rest of the internal SRAM presumable intended for patch storage. However in ramlink.ld which defines the allocation of the patch code itself, the defined SRAM for the patch starts at 0x000110000 (again with a length of 0xB000). I assume this RAM is a mapped mirror of the true SRAM at 0x20000000, but why is there an offset between the end of the area defined in STM32F407xG (0x2000B000) and the start in ramlink.ld ? (There is a definition of a PATCHMAINLOC in patch.h, which is 0x20011000).
Also, why is the patch code linked to start at 0x00011000 rather than in the SRAM proper, so that its starting address would be 0x20011000 ? When the patch is initialized, the Axoloti Core calls to 0x20011000, so this would imply that the patch code is compiled to be position independent. The patch initialization code then returns (among other things) the address to the DSP function to be called from the Core, which is in the 0x000..... segment.