This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos 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: building for flash


On Thu, 21 Aug 2003 23:01:44 -0700 (PDT)
sensitron medical <sensitronnet@yahoo.com> wrote:

> --- Laurent GONZALEZ <laurent.gonzalez@silicomp.fr>
> wrote:
> > 
> > > Recall that the
> > > AT91 resets with ROM located at 0 until remap.
> > After
> > > remap, I am locating it at 0x01000000.
> > > 
> > > If I change my rom origin to 0, i.e.:
> > > 
> > >     rom  : ORIGIN = 0x00000000, LENGTH = 0x200000
> > > 
> > > then I have a conflict with ram/sram which are
> > also at
> > > 0. Catch-22.
> > > 
> > > What I need to do is burn my code (.text and
> > .data)
> > > into flash at pre-remap address 0 (post-remap
> > > 0x01000000), and allow the code to access my .bss
> > at
> > > post-remap 0, but I don't know how.
> > No needs to do anything, the early startup of the
> > HAL should take care of the remap command (see
> > include/hal_platform_setup.h).
> > 
> 
> I'm pretty sure that it is not that simple. True, HAL
> takes care of *executing* the remap command, but the
> problem is that after a remap, the linker sections are
> going to be mixed up. Pre- and post-remap references
> to the exact same section, .data, for example, are
> going to have 2 different values. So if a section is
> referenced at runtime prior to remap, the pre-remap
> address needs to be used in the linker section
> definition. But, for a section that is referenced
> after remap, the post-remap address needs to be used.
> When I craft my linker script, how am I supposed to
> know which address, pre- or post-, to use for a given section?
> 

It is not worth to take care for what memory map is before remap, because the remap command is issued by the very first asm intruction when the target boot. This code is more or less position independant and further that deal with section (caopy .data, clear .bss) uses post-remap addresses.
In other word, the linker script only takes care for adresses after remap.

-- 
GONZALEZ Laurent
Silicomp Research Institute
Tel: 04 76 41 66 98

-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


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