This is the mail archive of the binutils@sources.redhat.com 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: Help again :-) ...


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


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