Why .bss is not of size 0?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I see .bss is of size 000004. I don't quite understand it. Since it is
of type NOBITS, shouldn't it contains nothing? Why it is not of size
zero? Thanks.

$ cat foo.c
int globalVar;
$ gcc -c foo.c
readelf -SW foo.o
There are 9 section headers, starting at offset 0x180:

Section Headers:
  [Nr] Name              Type            Address          Off    Size
 ES Flg Lk Inf Al
  [ 0]                   NULL            0000000000000000 000000
000000 00      0   0  0
  [ 1] .text             PROGBITS        0000000000000000 000040
000000 00  AX  0   0  1
  [ 2] .data             PROGBITS        0000000000000000 000040
000000 00  WA  0   0  1
  [ 3] .bss              NOBITS          0000000000000000 000040
000004 00  WA  0   0  4
  [ 4] .comment          PROGBITS        0000000000000000 000040
000028 01  MS  0   0  1
  [ 5] .note.GNU-stack   PROGBITS        0000000000000000 000068
000000 00      0   0  1
  [ 6] .symtab           SYMTAB          0000000000000000 000068
0000c0 18      7   7  8
  [ 7] .strtab           STRTAB          0000000000000000 000128
000011 00      0   0  1
  [ 8] .shstrtab         STRTAB          0000000000000000 000139
000045 00      0   0  1
Key to Flags:
  W (write), A (alloc), X (execute), M (merge), S (strings), I (info),
  L (link order), O (extra OS processing required), G (group), T (TLS),
  C (compressed), x (unknown), o (OS specific), E (exclude),
  l (large), p (processor specific)

-- 
Regards,
Peng



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux