Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Fri, 12 Jul 2002 14:51:34 +0400 From: egor duda Reply-To: egor duda Organization: deo X-Priority: 3 (Normal) Message-ID: <8772121004.20020712145134@logos-m.ru> To: Wolfgang Hesseler CC: cygwin AT cygwin DOT com Subject: Re: Bug: BSS segment in COFF files In-Reply-To: <3D2EA2E2.2881@multimediaware.com> References: <3D2EA2E2 DOT 2881 AT multimediaware DOT com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi! Friday, 12 July, 2002 Wolfgang Hesseler qv AT multimediaware DOT com wrote: WH> I'm trying to link some code compiled with the Cygwin gcc compiler with WH> the Watcom linker. This works as the Watcom linker supports the COFF WH> object code format. However, there seems to be a problem with WH> uninitialized variables. After analyzing an object file it seems as if WH> the BSS segment always has size 0 so that the Cygwin generated object WH> files are not valid COFF files. Is this a known problem? WH> I ended up in making all uninitialized data to 0-inialized variables. WH> Is there any better way? If you run gcc with '--save-temps' flag, and then look into 'yourfile.s' file, you'll see that uninitialized data is tagged as "common" (using '.comm' directive) and is put to bss only by linker when final executable is created. To turn this feature off, use '-fno-common' flag when compiling your object file. Not sure if it's all that needed to link gcc-produced object files with watcom linker, though. For instance, for function 'func ()' gcc uses _func as symbol name in object files while watcom uses 'func_'. But in a simple testcase i've just tried, in which only data is imported from gcc-compiled object everything seems to work ok. Egor. mailto:deo AT logos-m DOT ru ICQ 5165414 FidoNet 2:5020/496.19 -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/