As per my knowledge, segmentation for c program is:
High address
|---------------------------|
|env/cmd line args vars |
|---------------------------|
| stack segment |--> uninitialized auto vars
|---------------------------|
|---------------------------|
|---------------------------|
| heap segment |--> dynamic allocated memory
|---------------------------|
| BSS segment |--> uninitialized static/global vars
|---------------------------|
| data segment |--> initialized static/global vars
|---------------------------|
| text segment |--> initialized auto vars/exec instructions
|---------------------------|
Low address
On my RHEL 5.4 64-bit machine, for below c program
#include <stdio.h>
int main()
{
}
when I do:
# size a.out
text data bss dec hex filename
1259 540 16 1815 717 a.out
I am unable to understand why is
bss=16
As I am not declaring/initializing any global/static vars?