This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Help again :-) ...
- From: Ian Lance Taylor <ian at airs dot com>
- To: Lars Segerlund <lars dot segerlund at comsys dot se>
- Cc: binutils at sources dot redhat dot com
- Date: 21 May 2003 09:46:09 -0700
- Subject: Re: Help again :-) ...
- References: <3ECB7BD3.5040309@comsys.se>
Lars Segerlund <lars.segerlund@comsys.se> writes:
> I am trying to link two object files together into a binary file,
> and I dont understand what I am doing wrong, I am using the following
> command:
>
>
> /home/seger/src/burk/tools/bin/m68k-elf-ld -o filter.bin cf.o main.o
> -oformat binary -Map filter.map -T sys/sys9.lds
> cf.o: In function `flux_finder':
> cf.o(.text+0x12): relocation truncated to fit: R_68K_GOT16O xal.4
> cf.o(.text+0x16): relocation truncated to fit: R_68K_GOT16O n.3
> cf.o(.text+0x20): relocation truncated to fit: R_68K_GOT16O xbe.5
> cf.o(.text+0x30): relocation truncated to fit: R_68K_GOT16O yal.6
> ....
This error means that you have a relocation which uses a 16 bit field
to refer to a global offset table entry, and that the address of the
table entry does not fit into 16 bits.
Probably it's because you are using -oformat. That often doesn't work
in the presence of PIC relocations. Instead of using that, generate
an ELF file, and use objcopy to change to the format you want.
Note that R_68K_GOT16O implies that you are linking code compiled with
-fpic. Such code requires a dynamic loader at run time. It's
unlikely that converting it to binary will make any sense.
Ian