Relocatable linking on x86-64 for i386

Relocatable linking on x86-64 for i386

Valery Reznic valery_reznic at yahoo.com
Mon Apr 4 14:16:07 IDT 2011


> > > > 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
> > > > 
> 
> ld -m  elf_i386 -r file1.o file2.o -o output.o
Thanks, it works!! Great!!!

Valery


> 
> > Valery.
> > 
> > > 
> > > While it is possible to run both machine codes on
> your
> > > computer, they must run in different processes
> (the kernel
> > > actually treats x86 and amd64 codes differently
> when it sets
> > > up the registers for the context switch), and
> thus you
> > > cannot link them into a single executable,
> cannot
> > > dynamically load one from the other, and cannot
> have two
> > > threads with different types. Your only option
> for
> > > interaction is RPC of some sort (or recompile one
> of them).
> > > 
> > > Shachar
> > > 
> > > -- Shachar Shemesh
> > > Lingnu Open Source Consulting Ltd.
> > > http://www.lingnu.com
> > > 
> > > 
> > 
> > _______________________________________________
> > Linux-il mailing list
> > Linux-il at cs.huji.ac.il
> > http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
> 
> --
>            
> Gleb.
> 



More information about the Linux-il mailing list