Relocatable linking on x86-64 for i386

Relocatable linking on x86-64 for i386

shimi linux-il at shimi.net
Mon Apr 4 13:09:23 IDT 2011


On Mon, Apr 4, 2011 at 10:15 AM, Valery Reznic <valery_reznic at yahoo.com>wrote:

> Hello. I am trying to make relocatable linking on x86-64 box for objects in
> format i386
>
> Naive
>
> ld -r file1.o file2.o -o output.o
>
> produce
> ld: Relocatable linking with relocations from format elf32-i386 (file1.o)
> to format elf64-x86-64 (output.o) is not supported
>
> But even when I add --oformat situation not improved:
>
> ld --output-format elf32-i386 -r file1.o file2.o -o output.o
> ld: Relocatable linking with relocations from format elf32-i386 (file1.o)
> to format elf32-i386 (output.o) is not supported
>
> So linker correctly recognize what input and output format should be,
> but for some reason don't want do it.
>
> Do you have any ideas if it can be done at all and how?
>
>
Maybe your system is pure-64 ? (i.e. no 32 bit libs / compiler / linker
support?)

Can you compile a 32 bit with gcc -m32 ?

-- Shimi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.cs.huji.ac.il/pipermail/linux-il/attachments/20110404/594f0675/attachment.html>


More information about the Linux-il mailing list