This is the mail archive of the
mailing list for the GCC project.
Re: BSS size
- To: Joy Mukherjee <jmukherj at csgrad dot cs dot vt dot edu>
- Subject: Re: BSS size
- From: Michael Eager <eager at mvista dot com>
- Date: Tue, 06 Nov 2001 12:00:38 -0800
- CC: Bryce McKinlay <bryce at waitaki dot otago dot ac dot nz>, gcc at gcc dot gnu dot org
- Organization: MontaVista Software, Inc.
- References: <Pine.OSF.email@example.com>
Output from readelf -S gcov:
[Nr] Name Type Addr Off Size ES Flg Lk Inf Al
 .bss NOBITS 0804c390 003390 000074 00 WA 0 0 4
Output from objdump -h gcov:
Idx Name Size VMA LMA File off Algn
22 .bss 00000074 0804c390 0804c390 00003390 2**2
Looks like .bss size in memory for this executable is 0x74. Whether .bss occupies
file space is irrelevant, it occupies memory space.
If your question is how many bytes are in the object file, the answer is zero.
Joy Mukherjee wrote:
> readelf -S works the same way as objdump -h. That does not solve my
> problem since .bss does not occupy file space - 'NOBITS'. In that sense my
> question was misleading . More directly, how can I find out the no. of
> bytes of uninitialised globals in an object file ? Thank you very much for
> your help .
> Joy Mukherjee
> Graduate Student,
> Deptt. of CS,
> Virginia Tech,
> Blacksburg,VA - 24061.
> On Fri, 2 Nov 2001, Bryce McKinlay wrote:
> > readelf -S ?
> > Bryce.
> > Joy Mukherjee wrote:
> > >Hi !
> > > Can anyone tell me how to get the size of the .bss section for a
> > >particular object file ? I want to know the no. of uninitialised globals
> > >in that obj file (the obj file is not a final executable). I would greatly
> > >appreciate any help . Thanks a lot .
> > >
Michael Eager firstname.lastname@example.org 408-328-8426
MontaVista Software, Inc. 1237 E. Arques Ave., Sunnyvale, CA 94085