delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/08/13/20:14:02

X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
Subject: Mixing MASM and GCC/GAS generated objects - Cygwin vs. Linux
Date: Mon, 13 Aug 2007 17:14:08 -0700
Message-ID: <562C09A341AA3942A9F70218A5A1BE7006FF4985@caex02.trans.corp>
From: "Lance Beazley" <lbeazley AT pillardata DOT com>
To: <cygwin AT cygwin DOT com>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id l7E0DppO007879

Hi,

I have a project which for a variety of reasons requires that I bring
coff object generated by MASM 6.14 together with GCC/GAS generated
object.

Under straight Linux, link immediately chokes on the MASM object files.
Cygwin tools get much further but still fail at the final LD stage.

The LD failure is very cryptic so I'd like to ask if anyone understands
why the Cygwin tools might behave differently from the Linux tools WRT
object file formats and whether anyone can shed some light on the LD
failure.

I suspect the BFD package under Cygwin may have been modified to handle
MASM "coff" output but I am surprised the Cygwin loader then has
problems with the Cygwin linker's output so my assumption may be
incorrect.

Microsoft claims MASM 6.14 generates coff output per the spec at:
http://www.microsoft.com/whdc/system/platform/firmware/PECOFF.mspx
Though of course at April 1999 levels.

The level of Cygwin tools I am using are
Objdump 2.17.5, GCC 3.4.4, AS 2.17.5, Link 6.9, LD 2.17.5

To get the Cygwin tools to process output as far as they do I had to
force the output format to be pe-i386 as demonstrated by the following
cmd line:
gcc -m32 -O2 -nostdlib -nostartfiles -static -o <TARGET>
-Wl,"--oformat=pe-i386" -T <LD_SCRIPT> <SOURCE_OBJECT>

The failure pops up some time later as follows:
..../i686-pc-cygwin/bin/ld: final link failed: Memory exhausted

Any history or ideas would be greatly appreciated.
Thank you for your time and your knowledge,
Lance
________________________________________________________________
Lance Beazley  |  Associate Architect  |  Pillar Data Systems
lbeazley at pillardata dot com
________________________________________________________________
Quality is free but only to those willing to pay heavily for it.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019