I came across the size command which gives the section size of the ELF file. While playing around with it, I created an output file for the simplest C++ program :
int main(){return 0;}
Clearly, I have not defined any initialized or uninitialized, data then why are my BSS and DATA sections of the size 512 and 8 bytes?
I thought it might be because of int main(), I tried creating object file for the following C program :
void main(){}
I still don't get 0 for BSS and DATA sections.
Is it because a certain minimum sized memory is allocated to those section?
EDIT- I thought it might be because of linked libraries but my object is dynamically linked so probably it shouldn't be the issue
objdump --disassemble.objdump -fwill show information including the "start address". - sourcejedifile a.outsaid it's dynamically linked ELF so i assumed there are no statically linked libraries, guess i was wrong. - Time Travellernmon it - you will see all the symbols in the elf file. - filo