Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com X-Authentication-Warning: mail.webfountain.com: Host gate.webfountain.com [63.161.54.3] claimed to be electra From: "Serban Simu" To: "DJ Delorie" Cc: Subject: RE: ld COFF processing Date: Fri, 8 Sep 2000 09:53:46 -0700 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 In-Reply-To: <200009020039.UAA26092@envy.delorie.com> Importance: Normal Thanks for the answer. I have actually put the problem wrong. What I'm trying to do, is to process the object files using ld. I'll list my reasons below. My intention is not to build an archive library (with ar). On Linux, the command that I mentioned produces new.obj, identical with s.obj, same sections, symbols, etc: $ ld -o new.obj -r s.obj On NT, when s.obj is compiled with Microsoft tools (cl) it can have, for example, many .text sections and some other special sections. After issuing the above mentioned command, the output object file has many sections less (for example only one section .text and the special sections missing) and is considerably smaller in size. A lot of information from the COFF PE object file is lost once it's passed through ld. Also, the object file produced on NT can't be linked again using Microsoft 'link', which reports an internal error. My question is if there is any way that ld on NT can link and produce a relocatable (ld -r) output object file in the same way it does on Linux? Is there an NT usage restriction that says: don't use 'ld -r' with object files created with 'cl /c'? I would also appreciate if anyone could point me to an ld or a bfd patch to solve this problem! Thanks! -Serban P.S. Although unrelated directly to this mailing list, here is the reason I want to use 'ld -r' instead of creating an archive with 'ar'. I need to create a static library without exposing the internal symbol names but only the exportable symbol names. The internal symbols cannot be stripped out (using 'strip' or ld options) because they are needed for the relocation. I modified ld (actually the bfd backend) to change symbol names as it creates the output file. However, the problem I exposed is experienced with the unmodified Cygwin ld. > -----Original Message----- > From: DJ Delorie [mailto:dj AT delorie DOT com] > Sent: Friday, September 01, 2000 5:40 PM > To: serban AT digitalfountain DOT com > Cc: cygwin AT sourceware DOT cygnus DOT com > Subject: Re: ld COFF processing > > > > > $ ld -o s.a -r s.obj (produces s.a) > > > > My question is, to what extent is the pe-i386 format compatible with the > > Microsoft format? > > The formats are compatible, but you're using the tools wrong. The > "ar" program creates libraries, not the "ld" program. Please read the > documentation for the tools for further instructions. > -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com