From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25914 invoked by alias); 10 Feb 2005 14:07:18 -0000 Mailing-List: contact binutils-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sources.redhat.com Received: (qmail 24969 invoked from network); 10 Feb 2005 14:07:11 -0000 Received: from unknown (HELO web21002.mail.yahoo.com) (216.136.227.56) by sourceware.org with SMTP; 10 Feb 2005 14:07:11 -0000 Received: (qmail 36119 invoked by uid 60001); 10 Feb 2005 14:07:11 -0000 Message-ID: <20050210140711.36117.qmail@web21002.mail.yahoo.com> Received: from [47.248.0.41] by web21002.mail.yahoo.com via HTTP; Thu, 10 Feb 2005 06:07:10 PST Date: Thu, 10 Feb 2005 17:26:00 -0000 From: Virgil Anuichi Subject: Re: wrong initialized global variable (in the wrong section: .bss instead of .data) To: Alan Modra Cc: binutils@sources.redhat.com In-Reply-To: <20050209221845.GE22497@bubble.modra.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2005-02/txt/msg00204.txt.bz2 The initialization is not zero. And that's the problem. In fact, a global looking like int foo=0; would come up with an undidefined value, in the .bss. I actually dig some more and it's not the linker script, rather the compiler. The objdump shows me even the .o file has the global in the .bss section. The old compiler works fine: it puts it in .data section. All initialized globals seem to be put in the .bss with the exception of the globals initialized with a constant (?). For instance int foo=0; ends up in .bss while int foo1=TICK_1; ends up in .data Again, the old gcc compiler sets all of them in .data. Thanks, Virgil --- Alan Modra wrote: > On Wed, Feb 09, 2005 at 12:26:53PM -0800, Virgil > Anuichi wrote: > > Right now all my initialized global variables end > up > > in the .bss section, which is wrong. > > Is the initialization zero? gcc > -fno-zero-initialized-in-bss > > -- > Alan Modra > IBM OzLabs - Linux Technology Centre > __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo