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 17:28:24 +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:
> That doesn't help me much. The loader (which is built into the ARM AXD
> debugger) uses only p_vaddr, so I need to make my image use that.
>
> The issue is, why is ld preventing me from doing what I need to do?
> Putting seeks to negative output-file offsets sounds like a linker bug to
> me.
What you described in your original mail indicates you need to load
image's segments at different addresses than the segments' p_vaddr. The
proper way to do it is via using the the AT keyword in your PHDRS command
(you may do it indirectly in the SECTIONS command as well). It sets the
p_paddr value of the respective segment, otherwise p_paddr just equals to
p_vaddr.
I you can't persuade your loader to use p_paddr and it uses p_vaddr
instead, then it's a bug in the loader. It uses physical addresses after
all. You need to fix the loader.
--
+ Maciej W. Rozycki, Technical University of Gdansk, Poland +
+--------------------------------------------------------------+
+ e-mail: macro@ds2.pg.gda.pl, PGP key available +