This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Linking images at one address, but loading them at another.
- To: Richard dot Earnshaw at arm dot com
- Subject: Re: Linking images at one address, but loading them at another.
- From: "Maciej W. Rozycki" <macro at ds2 dot pg dot gda dot pl>
- Date: Fri, 26 Oct 2001 16:51:18 +0200 (MET DST)
- cc: Nick Clifton <nickc at cambridge dot redhat dot com>, binutils at sources dot redhat dot com
- Organization: Technical University of Gdansk
- Reply-To: "Maciej W. Rozycki" <macro at ds2 dot pg dot gda dot pl>
On Fri, 26 Oct 2001, Richard Earnshaw wrote:
> I've done some more digging, the ARM ELF spec
> http://www.arm.com/armwww.ns4/img/12-Technical+Specs-ARM+ELF+Specification+PDF/$File/ARMELFA08.pdf?OpenElement
>
> is quite explicit about this in section 4.6 -- the p_vaddr field says where
> the image should be loaded, and the p_paddr field is ignored (and set to
> zero).
ELF specs generally assume a SYSV environment. That's typically
fulfilled when running userland under an OS, but a kernel image is not
usually loaded within a SYSV environment. It might even not be
dynamically linked. ;-) Thus the binary is not SYSV-compliant anyway.
In short: use p_vaddr in a loader if it operates on virtual addresses as
seen by the program and p_paddr if it operates on physical addresses. If
a loader operates on virtual addresses different from the ones seen by the
program, you should probably use p_paddr anyway.
--
+ Maciej W. Rozycki, Technical University of Gdansk, Poland +
+--------------------------------------------------------------+
+ e-mail: macro@ds2.pg.gda.pl, PGP key available +