This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: building for flash
- From: sensitron medical <sensitronnet at yahoo dot com>
- To: eCos Discussion <ecos-discuss at sources dot redhat dot com>
- Cc: Laurent GONZALEZ <laurent dot gonzalez at silicomp dot fr>
- Date: Thu, 21 Aug 2003 23:01:44 -0700 (PDT)
- Subject: Re: [ECOS] building for flash
--- 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?
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss