This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: objcopy of coff-i386 to elf32-i386?


On Fri, Sep 15, 2000 at 03:16:28PM +1100, Lachlan O'Dea wrote:
> On Wed, Sep 13, 2000 at 10:57:32AM -0700, H . J . Lu wrote:
> > On Wed, Sep 13, 2000 at 02:56:46PM +1100, Lachlan O'Dea wrote:
> > > 
> > > objcopy --remove-leading-char \
> > > 	--input-target=coff-i386 --output-target=elf32-i386 \
> > > 	$(COFFDIR)/$*.obj $*.o
> > > 
> > 
> > That never worked. If it did, it did by accident. Please read the
> > updated documentation from sourceware or my Linux binutils. Basically,
> > you can only use objcopy on fully linked files. You can mix .o files
> > in the final link.
> 
> Sorry, my mistake. It almost works :-)
> 
> So are you suggesting I do something like this (on an elf system):
> 
> gcc -g -o test main.o c_code.o -Wl,-b,coff-i386 masm_code.obj
				^^^^^^^^^^^^^^^^^^
If you have to add it, the chances are it won't work. It is a very
tricky thing to do, complicated by the difference between PE and COFF.

> 
> where masm_code.obj is coff produced by MASM, main.o and c_code.o are
> elf32 compiled by gcc.

I can tell you now if MASM is Microsoft ASM, it will work with MY
current precompiled binutils binaries for Linux. If you want to
build binutils yourself, please make sure you use

.../configure --enable-targets=i386-pe ....

and don't add -Wl,-b,coff-i386. Pay attention it is i386-pe, not
i386-coff.



H.J.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]