I want to learn reverse engineering so I was starting to try compiling simple (to start with) C programs and then reading the disassembly.
The following file
int main(void) {
return 0;
}
compiled with gcc
then disassembled with objdump -d
ends up creating 172 lines of output. I don't understand why there is so much output.
What is the meaning of the different sections:
0000000000400370 <_init>:
0000000000400390 <__libc_start_main@plt-0x10>:
00000000004003a0 <__libc_start_main@plt>:
00000000004003b0 <__gmon_start__@plt>:
00000000004003c0 <_start>:
00000000004003f0 <deregister_tm_clones>:
0000000000400420 <register_tm_clones>:
0000000000400460 <__do_global_dtors_aux>:
0000000000400480 <frame_dummy>:
00000000004004ad <main>:
00000000004004c0 <__libc_csu_init>:
0000000000400530 <__libc_csu_fini>:
0000000000400534 <_fini>:
Of course I have been reading about the calling convention and opcodes so I can see how the section corresponds to the C code.