This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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: ld linking.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]