From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5335 invoked by alias); 12 Jul 2002 13:40:32 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 5328 invoked from network); 12 Jul 2002 13:40:30 -0000 Received: from unknown (HELO ns.logos-m.ru) (195.7.187.66) by sources.redhat.com with SMTP; 12 Jul 2002 13:40:30 -0000 Received: from gibe.logos-m.ru (gibe.logos-m.ru [195.7.187.101]) by ns.logos-m.ru (8.12.1/8.12.1) with ESMTP id g6CDxIQF071885; Fri, 12 Jul 2002 17:59:19 +0400 (MSD) Date: Fri, 12 Jul 2002 07:52:00 -0000 From: egor duda Reply-To: egor duda Organization: deo X-Priority: 3 (Normal) Message-ID: <9382195250.20020712173928@logos-m.ru> To: Wolfgang Hesseler CC: cygwin@cygwin.com Subject: Re: Bug: BSS segment in COFF files In-Reply-To: <3D2EC616.19DA@multimediaware.com> References: <3D2EA2E2.2881@multimediaware.com> <8772121004.20020712145134@logos-m.ru> <3D2EBFC2.6973@multimediaware.com> <9975891676.20020712155424@logos-m.ru> <3D2EC616.19DA@multimediaware.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2002-07/txt/msg01037.txt.bz2 Hi! Friday, 12 July, 2002 Wolfgang Hesseler qv@multimediaware.com wrote: >> >> 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. >> >> WH> This works, however only if the variables are non-static. If a >> WH> variable is static the .comm directive is still used. >> >> .lcomm, to be precise. >> >> That's easy to work around. Just add 'int dummy;' to your source >> file compiled with gcc, and you have 4 bytes in bss section. WH> But how does this help? The other static variables still use WH> the .lcomm directive. Ah, i was thinking the problem is that wlink refuses to link in modules with empty .bss section. The problem seems to be that you can't reference to static variable from within the module. You can add #ifdef GCC #define STATIC static __attribute__ ((section(".bss"))) #else #define STATIC static #endif and then replace all 'static some_type some_var;' with 'STATIC some_type some_var;', although i don't know if such tricks are guaranteed to work with all current and future versions of gcc. Egor. mailto:deo@logos-m.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/