I understand that the default alignment of .bss is 8 bytes for GCC as mentioned in this question Why the int type takes up 8 bytes in BSS section but 4 bytes in DATA section
So with this program:
int main(){ return 0; } I have something like this:
text data bss dec hex filename 1418 544 8 1970 7b2 test When I add an static variable with initialization to increase .data (and it does):
static int var = 255; int main(){ return 0; } I see that the size of .bss also decrease 4 bytes:
text data bss dec hex filename 1418 548 4 1970 7b2 test Please tell me why ?
readelf,nm, etc. to see if you can determine what symbols are at the address[es] in bss?.bssand.data, but still not find out the logic.