This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: ld linking.
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Brian Beardall <brian at rapsure dot net>
- Cc: binutils at sources dot redhat dot com
- Date: Thu, 15 Nov 2007 01:32:14 +1030
- Subject: Re: ld linking.
- References: <1195020958.31449.5.camel@rapsure.rapsure.net>
On Tue, Nov 13, 2007 at 11:15:58PM -0700, Brian Beardall wrote:
> as -o lab8.o lab8.S
>
> ld -Tbss 0x00000 -Ttext 0xE0000 --oformat binary -o lab8.bin lab8.o
> lab8.o: In function `initialize':
> (.text+0x183): relocation truncated to fit: R_X86_64_16 against `.text'
> lab8.o: In function `initialize':
> (.text+0x1fffc): relocation truncated to fit: R_X86_64_16 against
> `_start'
You are using a label to specify a 16-bit address field in an
instruction. -Ttext 0xE0000 says to start .text at 0xE0000, so all
labels defined in .text will be outside the range of valid 16-bit
addresses. The linker doesn't know anything about segmented
addressing... I suspect you want -Ttext 0.
--
Alan Modra
Australia Development Lab, IBM