Ali Bahrami <Ali.Bahrami at Sun.COM> writes:

>>> I compile some source code using cc -m64
>>>
>>> However, I can't seem to link the objects. I'm getting the
>>> error,"Relocatable linking with relocation from elf64-x86-64 to format
>>> elf32-i386 is not supported".
>>>
>>> My ld command line is:
>>> ld -r -o outfile obj1.o obj1.o
[...]
> -64 shouldn't be necessary, as ld will intuit what to
> do from the first object on the line.

True for Sun ld, false for GNU ld ;-)

> That error looks to me as if it came from the GNU
> ld, which unfortunately is at the beginning of the default
> path under OpenSolaris. Try running /usr/bin/ld explicitly.

Or, if you really want to use GNU ld for some reason, either invoke it
indirectly with a gcc built to use gld, or by specifying the linker
emulation to use:

$ ld -m elf_x86_64 -r -o outfile obj1.o obj1.o

Because this is so messy, next to nobody runs gld manually.

        Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

Reply via email to