What is the significance of .bss section as we have already separate data section. What advantage it gives over data section ? Is in .bss section all variables will be initialized to zero ? If I declare variable like this - int a = 0; So this variable will go in which section ?
Asked
Active
Viewed 219 times
2 Answers
5
.bss section accommodates the unitialized static storage objects. It is zeroed by the startup code (before the main
is called).
Existence of the .bss section is of course up to implementation and the placement of the explicit zero initialized object is also implementation defined. There is no rule defined by the C standard.

0___________
- 60,014
- 4
- 34
- 74
0
Unlike a data section, a BSS section requires no storage in the object file - it's an optimisation.

Toby Speight
- 27,591
- 48
- 66
- 103