--- On Tue, 4/5/11, Ehud Karni <[email protected]> wrote:

> From: Ehud Karni <[email protected]>
> Subject: Re: Relocatable linking on x86-64 for i386
> To: [email protected]
> Cc: [email protected], [email protected], [email protected]
> Date: Tuesday, April 5, 2011, 10:58 AM
> On Mon, 4 Apr 2011 23:19:43 -0700,
> Valery Reznic wrote:
> >
> > --- On Mon, 4/4/11, Ehud Karni <[email protected]>
> wrote:
> >
> > > In fact you can do: gcc -m32 file1.o file2.o -o
> output.o
> >
> > I vaguely remember that I tried to use gcc instead of
> ld long time ago, but gcc gave me some trouble - may be link
> failed after that, may be run-time problems.
> 

Create programs using gcc -m32 is fine.
But I use ld command not to create the program, but to create object file 

While both 
ld -m elf_i386 file1.o file2.o -o output.o
and
gcc -m32 file1.o file2.o -o output.o

create EXECUTABLE file (despite .o extension)

I use
ld -r file1.o file2.o -o output.o # Note -r

that create "partially linked object file"
And with this operation (even on i386 system, without need for -m32 flag)
I had a problem. Or at least I remember it.

Valery.



> Just to state the facts. I use `gcc -m32' regularly to
> create 32 bit
> programs on 64 bit systems.  I checked the ld
> replacement command
> specifically, and it worked without any problems.
> 
> Ehud.
> 
> 
> --
>  Ehud Karni       
>    Tel: +972-3-7966-561  /"\
>  Mivtach - Simon      Fax:
> +972-3-7976-561  \ /  ASCII Ribbon Campaign
>  Insurance agencies   (USA) voice mail
> and   X   Against   HTML   Mail
>  http://www.mvs.co.il  FAX: 
> 1-815-5509341  / \
>  GnuPG: 98EA398D <http://www.keyserver.net/> 
>   Better Safe Than Sorry
> 

_______________________________________________
Linux-il mailing list
[email protected]
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il

Reply via email to