a question about linker and addresses

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I copied some lines of the manual, ld, GNU linker:
--------------------------------------------------------------------------------------------------
Every loadable or allocatable output section has two addresses. The
first is the VMA, or
virtual memory address. This is the address the section will have when
the output file is
run. The second is the LMA, or load memory address. This is the
address at which the
section will be loaded. In most cases the two addresses will be the
same. An example of
when they might be different is when a data section is loaded into
ROM, and then copied
into RAM when the program starts up (this technique is often used to
initialize global
variables in a ROM based system). In this case the ROM address would
be the LMA, and
the RAM address would be the VMA.
--------------------------------------------------------------------------------------------------
How data section is loaded into ROM, while the program has not been
started up? (Usually at first we start a program, then sections are
loaded into the memory, isn't it?)
Please clarify when LMA and VMA addresses are used?


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux