This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to check if .data section is loaded properly in LMA


chandru1248 <chandru1248@gmail.com> writes:

>> You originally said that the .data section was not properly loaded into
>> the LMA.  What did you mean, precisely?
>
> I am loading the image using debugger.
>
> My VMA and LMA addresses are different. When I checked a global initialized
> variable, the value is 0 and did not contain the value that is initialized.
>
> Below is the snapshot of the linker script for the .data section
>
> .data ORIGIN(rtarea) : AT (__code_ram_end)
> {
> __data_ram = .;
> *(.data)
> *(.sdata)
> SORT(CONSTRUCTORS)
> __data_end = .;
> } > rtarea
>
> I got the VMA as 0x600000 and LMA as 0x28ef294.

Normally when you do this kind of thing, your startup code needs to copy
the data from the LMA to the VMA.  See the last part of

http://sourceware.org/binutils/docs-2.21/ld/Output-Section-LMA.html

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]