An object file is binary representation of source(text) file. It's a collection of various sections segragating type of data in:
- text section
- data section
- stack
- heap
Depending on your compiler/environment these may differ.
E.g. on *nix systems:
objdump -d a.out <--- provide we compiled a.cpp
disassembly of section .init:
08048278 <_init>:
8048278: 55 push %ebp
8048279: 89 e5 mov %esp,%ebp
804827b: 83 ec 08 sub $0x8,%esp
804827e: e8 61 00 00 00 call 80482e4
8048283: e8 b3 00 00 00 call 804833b
8048288: e8 9f 01 00 00 call 804842c <__do_global_ctors_aux>
804828d: c9 leave
804828e: c3 ret
Disassembly of section .plt:
08048290 :
8048290: ff 35 78 95 04 08 pushl 0x8049578
8048296: ff 25 7c 95 04 08 jmp *0x804957c
804829c: 00 00 add %al,(%eax)
...
080482a0 :
80482a0: ff 25 80 95 04 08 jmp *0x8049580
80482a6: 68 00 00 00 00 push $0x0
80482ab: e9 e0 ff ff ff jmp 8048290 <_init+0x18>
080482b0 <__libc_start_main@plt>:
80482b0: ff 25 84 95 04 08 jmp *0x8049584
80482b6: 68 08 00 00 00 push $0x8
80482bb: e9 d0 ff ff ff jmp 8048290 <_init+0x18>
Disassembly of section .text:
The various call commands here are then liked to the various libraries to call the actual functions.