Re: VMA vs LMA?
- From: dspfun <dspfun@xxxxxxxxxxx>
- Date: Wed, 29 Aug 2007 07:23:53 -0700
Thanks for your response!
So, the program is always linked with the VMA addresses, and never
linked with LMA addresses? Or how are references to LMA/VMA sections
resolved?
When writing a program where one wants different LMA and VMA sections
the programmer himself/hersel has to make sure he/she writes the code
that copies the LMA section/data to its appropriate VMA address?
No, these are different situations. When an OS loads code from a file,
the OS does the copying. Usually the VMA and LMA are the same, so that
the OS loads the initialised data section directly into place. With a
ROM'ed program, where the program is run directly from the ROM rather
than being first copied into RAM (in which case you have the same
situation as an OS and a file), the code at the beginning of the program
copies the data across and also clears the bss - this is part of the
crt0 startup code.
Why does crt0 (C runtime 0) have code that copies data from LMA to
VMA? Is it there so the C programmer doesn't have to write his own
"LMA data to VMA data copy code"? If so, how would one make use of the
crt0 "LMA data to VMA data copy code"?
.
- Follow-Ups:
- Re: VMA vs LMA?
- From: David Brown
- Re: VMA vs LMA?
- References:
- VMA vs LMA?
- From: dspfun
- Re: VMA vs LMA?
- From: David Brown
- VMA vs LMA?
- Prev by Date: Re: <CR/LF> or <CR> or <LF>?
- Next by Date: Re: Any Russian Programmer...
- Previous by thread: Re: VMA vs LMA?
- Next by thread: Re: VMA vs LMA?
- Index(es):
Relevant Pages
|