Subject: loadfile's ELF handling and load vs. run-time address
To: None <tech-kern@netbsd.org>
From: Jason R Thorpe <thorpej@wasabisystems.com>
List: tech-kern
Date: 03/03/2002 13:29:29
Hi folks...

In ELF, each section has a VMA (virtual memory address, i.e. what is
used at run-time) and an LMA (load memory address, i.e. what is used
when loading an image into memory).

Most of the time, VMA == LMA, however this is not always the case if
the linker script is used to perform relocation of the kernel (see the
IQ80310 support code in the evbarm port for an example).

I'd like to suggest that we start using the LMA in libsa's ELF loadfile
code, so that VMA != LMA applications will work.  This should not cause
a problem for any port currently using loadfile, since VMA == LMA unless
explicitly frobbed by the linker script.

Comments?

-- 
        -- Jason R. Thorpe <thorpej@wasabisystems.com>