ld linking.

Brian Beardall brian@rapsure.net
Wed Nov 14 17:27:00 GMT 2007


On Thu, 2007-11-15 at 01:32 +1030, Alan Modra wrote:
> 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.
> 

I am doing segment addressing. So with this understanding I am limited
to basically a 64kb address space to put my program in. If I have my
program exceed 64k then am I able to create multiple object files to go
into specific locations in the rom, and use LD to resolve the symbols
from the multiple object files?



More information about the Binutils mailing list