Not linking 32-bit and 64-bit objects

Alan Modra amodra@bigpond.net.au
Tue Mar 12 23:48:00 GMT 2002


On Tue, Mar 12, 2002 at 04:02:36PM +0100, Jakub Jelinek wrote:
> It is not working properly.
> It gives an error message, but then crashes anyway, e.g.:
> $ gcc -m64 -c helloworld.c
> $ gcc -o helloworld helloworld.o
> /usr/bin/ld: warning: sparc:v9 architecture of input file `helloworld.o' is incompatible with sparc output

It's a warning message, not an error..

> /usr/bin/ld: BFD 2.11.93.0.2 20020207 assertion fail elflink.h:2817
> helloworld.o: In function `main':
> helloworld.o(.text+0x0): relocation truncated to fit: R_SPARC_DISP8 *UND*
> collect2: ld returned 1 exit status
> $ gcc -c helloworld.c
> $ gcc -m64 -o helloworld helloworld.o
> collect2: ld terminated with signal 11 [Segmentation fault], core dumped
> /usr/bin/ld: warning: sparc architecture of input file `helloworld.o' is incompatible with sparc:v9 output
> /usr/bin/ld: helloworld.o: invalid string offset 6841708 >= 47 for section `.strtab'

Try it again with current sources.  You'll likely have warnings if
the foreign input file has relocs, but hopefully the core dump has
gone.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre



More information about the Binutils mailing list