I have a problem with this. I am using ARM Cortex-A9 with DS-5 to create firmware for baremetal. I modified my linker file to intentionally place the LMA.data section next to the text and rodata sections, since its default VMA is 1 MB at runtime and the .bin image is about 1 MB but contains 90% zeros. And so I intentionally made LMA! = VMA to save space. I also added code to start.S, which moves the .data section from its lma to vma.
However, when loading the resulting elf file into DS-5, it already loads the entire section into its VMA. As a result, my start.S code, which should move the data, was copied from the LMA with the contents of the garbage to the already correct VMA, and soon after that the garbage led to an error.
I had experience with unequal VMA and LMA in the Cortex-M4 binary, and used gdb to debug the elf, and there was no problem there, but it was a microcontroller. In my current pen software, as it were then, I modeled in the el module the debugging of a script for correctly copying data from its LMA to VMA. Most likely, there will be no problems with offline loading using the binary format, but now we are still in debugging the elf, so I have to fix it.
source share