This is the mail archive of the binutils@sourceware.org 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]
Other format: [Raw text]

Re: objcopy .o to .obj


On Tue, Sep 27, 2005 at 10:38:41AM -0700, ring0 (sent by Nabble.com) wrote:
>From Cygwin I'm trying to compile a few .c programs which .o objects
>are to be added to an existing microsoft vc++6 project (.obj).
>
>While both gcc and vc generate Coff objects formats, there are subtle
>differences (name mangling, relocations) making impossible any linkage
>of these two kinds of objects.
>
>I was hoping objcopy (from binutils-2.13.90.0.18) could generate a .obj
>(vc) from a gcc (.o) object.  However objdump shows the same format for
>both files (pe-i386) and I'm confused on which relevant output format
>objcopy is to be fed on.
>
>Question Is it possible to proceed this objcopy from a .o to a .obj?

If you are producing cygwin object files then it is unlikely that you'll
be able to intermix them with MSVC objects unless your "main()" is a
cygwin object.  If you are trying to intermix C++ objects between gcc
and MSVC then, unfortunately, that is never going to work since, as you
noted, the mangling schemes differ.

If you are trying to link regular non-cygwin C object files with C
object files from MSVC then that should "just work".

If you have questions about intermixing cygwin and non-cygwin objects,
the best place to ask is the cygwin mailing list: <http://cygwin.com/lists.html>.
--
Christopher Faylor			spammer? ->	aaaspam@sourceware.org
Cygwin Co-Project Leader				aaaspam@duffek.com
TimeSys, Inc.


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