I'm writing a bit of assembler, which has to initialise the RAM so I put the data in the .data section.
The assembler should have made a table of the data to be initialised at the end of the program in flash
and label the start as LMA
Sections:
Idx Name Size VMA LMA File off Algn
0 .text 00001c3c 00000000 00000000 00010000 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
1 .data 00000070 02000000 02000000 00020000 2**2
CONTENTS, ALLOC, LOAD, DATA
2 .data_RAM2 00000000 02001000 02001000 00020070 2**2
CONTENTS
3 .data_RAM3 00000000 02002000 02002000 00020070 2**2
The amount of data is correct (112 bytes (0x70)), but the LMA appears as the same as the VMA. I would have expected the .data LMA to be after .text hence 0x1c3c.
In some software I wrote four years ago, it seems to get it right (.data LMA is at the end of .text = 0x1EA4)
Sections:
Idx Name Size VMA LMA File off Algn
0 .text 00001ea4 00000000 00000000 00010000 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
1 .data 0000016c 02000000 00001ea4 00020000 2**2
CONTENTS, ALLOC, LOAD, DATA
2 .data_RAM2 00000000 02001000 02001000 0002016c 2**2
CONTENTS
3 .data_RAM3 00000000 02002000 02002000 0002016c 2**2
Something must not be set up correctly - any clues?