L
linq936
Hi,
I hope this question belongs to this group.
I am studying book <<Expert C Programming>> and in the chapter of
run time data structure, it mentions that BSS segment only stores the
size of the un-initialized data, it does not have the data images, so
it does not take up any actual space in the object file.
I tried out a simple code, but it is not as said.
Here is my first code:
#include <stdio.h>
int main(void){
printf("hello");
}
and I run size command:
size a.out
text data bss dec hex filename
874 256 4 1134 46e a.out
You see bss is of size 4.
Now the 2nd code:
#include <stdio.h>
int arr[1000];
int main(void){
printf("hello");
}
and size command output:
size a.out
text data bss dec hex filename
874 256 4032 5162 142a a.out
so bss size increases roughly the array size!
Is this because my GCC on Intel machine has different format than
before?
I hope this question belongs to this group.
I am studying book <<Expert C Programming>> and in the chapter of
run time data structure, it mentions that BSS segment only stores the
size of the un-initialized data, it does not have the data images, so
it does not take up any actual space in the object file.
I tried out a simple code, but it is not as said.
Here is my first code:
#include <stdio.h>
int main(void){
printf("hello");
}
and I run size command:
size a.out
text data bss dec hex filename
874 256 4 1134 46e a.out
You see bss is of size 4.
Now the 2nd code:
#include <stdio.h>
int arr[1000];
int main(void){
printf("hello");
}
and size command output:
size a.out
text data bss dec hex filename
874 256 4032 5162 142a a.out
so bss size increases roughly the array size!
Is this because my GCC on Intel machine has different format than
before?