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: redboot elf loader


On Mon, 2003-09-29 at 08:43, Mark Salter wrote:
> >>>>> Gary Thomas writes:
> 
> > On Mon, 2003-09-29 at 08:17, Mark Salter wrote:
> >> >>>>> Gary Thomas writes:
> >> 
> >> > On Mon, 2003-09-29 at 08:00, Mark Salter wrote:
> >> >> >>>>> Gary Thomas writes:
> >> >> 
> >> >> > I'd suggest that you leave this to your startup code.  Have it copy the
> >> >> > data from the VMA to the LMA - that's how we handle it in eCos.
> >> >> 
> >> >> Actually, we copy LMA to VMA. That is, for ROM startup the .data section
> >> >> has a VMA in RAM and an LMA in ROM. I tend to believe that the ELF loader
> >> >> should indeed be using LMA addresses.
> >> >> 
> >> 
> >> > How could this work for this example - loading via LMA into memory
> >> > that RedBoot clearly needs while running?
> >> 
> >> If that is the case, then the example is broken. My reading was that
> >> the VMA was 0x0 and LMA was somewhere where the other parts of the
> >> program lives. My point is that the LMA is where a loader should put
> >> sections (Load Memory Address) and VMA is where the running program
> >> actually accesses the sections.
> >> 
> 
> > Agreed, and if LMA != VMA, then it would be up to the code (loaded 
> > program) to relocate it as appropriate.  So, the real question becomes
> > is the LMA stored in the p_paddr field (just making sure I understand
> > the terminology)?  If so, then the patch from Artur would be the correct
> > solution.
> 
> Yes, VMA == p_vaddr and LMA == p_paddr.
> 

Fair enough - I've made this change.

-- 
Gary Thomas <gary@mlbassoc.com>
MLB Associates


-- 
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]