This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
Linking gcc and msvc objects
- To: "'Geoffrey Noer'" <noer at cygnus dot com>
- Subject: Linking gcc and msvc objects
- From: Sergey Okhapkin <sos at prospect dot com dot ru>
- Date: Wed, 26 Nov 1997 15:18:17 +0300
- Cc: "'Gnu-Win32'" <gnu-win32 at cygnus dot com>
Hi!
It's not possible to link together gcc and msvc compiled object files - ld
complains:
h:\usr\src\bsc>gcc -o demangle.exe demangle.c BSC.LIB
ld: BSC.LIB(objnt/mbrdecor.obj): warning: ignoring duplicate section
`.text'
ld: BSC.LIB(objnt/mbrdecor.obj): warning: ignoring duplicate section
`.text'
ld: BSC.LIB(objnt/mbrdecor.obj): warning: ignoring duplicate section
`.text'
...
I tried to compile single file with both gcc and msvc, the differences
present:
h:\usr\src\bsc>objdump --section-headers demangle.obj
demangle.obj: file format pe-i386
Sections:
Idx Name Size VMA LMA File off Algn
0 .drectve 00000026 00000000 00000000 00000064 2**0
CONTENTS, DEBUGGING, EXCLUDE
1 .text 0000003a 00000000 00000000 0000008a 2**4
CONTENTS, ALLOC, LOAD, RELOC, CODE
h:\usr\src\bsc>objdump --section-headers demangle.o
demangle.o: file format pe-i386
Sections:
Idx Name Size VMA LMA File off Algn
0 .text 00000050 00000000 00000000 0000008c 2**2
CONTENTS, ALLOC, LOAD, RELOC, CODE
1 .data 00000000 00000000 00000000 00000000 2**2
ALLOC, LOAD, DATA
2 .bss 00000000 00000000 00000000 00000000 2**2
ALLOC
The .text section have the same attributes, but the alignment differs -
2**2 for gcc and 2**4 for msvc-compiled object. Probably, if gnu tools will
set the proper alignment, it will be posiible to build an application from
gcc-compiled objects and msvc-compiled libraries. What do you think about?
--
Sergey Okhapkin, http://www.lexa.ru/sos
Moscow, Russia
Looking for a job.
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".