0

Possible Duplicate:
.bss section in elf file

Hi,

Is BSS(Block started by symbol) part of Program file(a.out). Suppose i have a global variable char buf[2048] declared in my c program. I make an executable out of my c program(a.out). Will the 2048 bytes of buf be part of a.out? Or is the amount of memory needed for buf allocate only during the execution of the program file?

I get confused when the size command shows the memory allocated for text segment, initialized data segment and BSS for the executable(a.out)

Community
  • 1
  • 1
nitin_cherian
  • 6,405
  • 21
  • 76
  • 127

1 Answers1

4

No, the 2048 bytes won't actually occupy any space in file 'a.out', assuming that you have a modern Linux operating system where the format of file 'a.out' is actually ELF, and not the format named "a.out", which used to be the case. For more information on the ELF format, see http://en.wikipedia.org/wiki/Executable_and_Linkable_Format.

Bill Evans at Mariposa
  • 3,590
  • 1
  • 18
  • 22