avr-gcc-list
[Top][All Lists]
Advanced

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

Re: [avr-gcc-list] section flags .data


From: Torsten Mohr
Subject: Re: [avr-gcc-list] section flags .data
Date: Sun, 24 Jul 2005 23:00:41 +0200
User-agent: KMail/1.8

Hi,

> That's the RAM address, where the offset 0x800000 is a hack to map the
> different address spaces of the AVR into a single flat address space
> for GCC.
>
> > is correct, but also the address needs to be changed according to
> > the mapping in the program header in the ELFs program header table.

I do not use avr-objcopy.  I directly download parts of the ELF file.
The condition if a section is downloaded into flash is that it is of
type PROGBITS and that the allocate flag is set.

> No mapping needed.  Internally, everything is handled in terms of RAM
> addresses.  In ROM, the initialization code knows that it has to
> expect the RAM init data straight after the normal program code.  (It
> knows that by some external symbol filled in by the linker.)  So as
> long as your avr-objcopy command that extracts the ROM image from the
> ELF file concatenates both .text and .data, it will work.

But still, i can't download the sections that meet the condition above
just like that into flash, the sections in the ELF file have a "virtusl"
address, as you mention above, gcc uses this for RAM data.

To know where a section needs to be loaded, the "program header" of the
ELF file has a mapping from virtual addresses to physical addresses.
That's what i've learned today.  So when i still want to download the
ELF file directly, i need to use the mapping in the "program header"
of the ELF file.
I got some hints to this on the binutils mailing list.  objcopy seems
to handle this quite similar.


Best regards,
Torsten.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]