A load memory address (LMA) is where a section is stored in the loadable image, typically in FLASH. Its virtual memory address (VMA) is where it resides during execution; on microcontrollers, these addresses are not translated by an MMU. section 4.1.1
LMA and VMA determine how sections reach their runtime locations:
- .text and .rodata typically stay in FLASH, with matching LMA and VMA. section 4.1.1 section 4.1.3
- .data is stored in FLASH but runs in RAM, so startup code copies it before main. section 4.1.1
- .bss occupies RAM and is zero-initialized at startup; it has no load image in FLASH. section 4.1.1 section 4.1.3
Idx Name Size VMA LMA File off Algn 0 .vector_table 00000040 08000000 08000000 00010000 2**2 1 .text 00001a00 08000040 08000040 00010040 2**2 2 .rodata 00000200 08001a40 08001a40 00011a40 2**2 3 .data 00000100 20000000 08001c40 00014000 2**2 4 .bss 00000080 20000100 20000100 00014100 2**2
Compare each section’s LMA and VMA: the .data row shows a FLASH load address and a RAM execution address. section 4.1.5
