$ cat test.c
#include <stdio.h>
int main()
{
printf("hello world\n");
return 0;
}
$ file a.out
a.out: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, BuildID[sha1]=6a617e65aaf90badcd43b65d3af1df3357b04170, not stripped
$ cat a.out
ELF>?@@? @@@@@@?@@@@?? ??`?`? ??`?`?@@DDP?td??@?@$$Q?t/lib64/ld-linux-x86-64.so.2GNUGNUja~e??
??C?]:??3W?Ap __gmon_start__libc.so.6puts__libc_start_mainGLIBC_2.2.5ui 1```H??s???H???5? ?%? @?%? h??????%? h?????1?I??^H??H???PTI?? ?Ř`H?? H9?r??? H?[??fff.?H?= UH??t?H????`????Ð?UH???@???????Ð????????fffff.?H?l$?L?d$?H?-? L?%| L?l$?L?t$?L?|$?H?\$?H??8L)?A??I??H??I???[???H??t1?@L??L??D??A??H??H9?r?H?\H?l$L?d$L?l$ L?t$(L?|$0H??8Ð??????UH??SH?H?? H???t??`DH???H?H???u?H?[?Ð?H??o???H??hello world ????<????\
???tzRx
P ????A?C
<????$T?????Q??_@????????????????????
?@???o`@?@?@ ?@
=
`0`@H@ ???o(@???o???o@?`?@?@GCC: (GNU) 4.4.7 20120313 (Red Hat 4.4.7-17).symtab.strtab.shstrtab.interp.note.ABI-tag.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.text.fini.rodata.eh_frame_hdr.eh_frame.ctors.dtors.jcr.dynamic.got.got.plt.data.bss.comment#@ 1<@<$D???o`@N
?@?V?@?=^???ok???o(@(zH@?`@`0
??@???@?0??@????@???@??@?$??`??`????`??`?0-? . ?@@<@`@?@?@(@ H@
`@
?@
?@?@?@?@?`?`?`?`````
?@????`??`??`?`
?@????`???`???`???@??`?
?@call_gmon_startcrtstuff.c__CTOR_LIST____DTOR_LIST____JCR_LIST____do_global_dtors_auxcompleted.6352dtor_idx.6354frame_dummy__CTOR_END____FRAME_END____JCR_END____do_global_ctors_auxtest.c_GLOBAL_OFFSET_TABLE___init_array_end__init_array_start_DYNAMICdata_start__libc_csu_fini_start__gmon_start___Jv_RegisterClassesputs@@GLIBC_2.2.5_fini__libc_start_main@@GLIBC_2.2.5_IO_stdin_used__data_start__dso_handle__DTOR_END____libc_csu_init__bss_start_end_edatamain_init[wmb
.bss
.ctors
.data
.data.rel.ro
.dtors
.dynamic
.dynstr
.dynsym
.eh_frame
.eh_frame_hdr
.fini
.gcc_except_table
.gnu.hash
.gnu.version
.gnu.version_r
.got
.got.plt
.init
.interp
.jcr
.note.ABI-tag
.note.gnu.build-id
.plt
.rela.dyn
.rela.plt
.rodata
.text
$ objdump --help
Usage: objdump <option(s)> <file(s)>
Display information from object <file(s)>.
At least one of the following switches must be given:
-a, --archive-headers Display archive header information
-f, --file-headers Display the contents of the overall file header
-p, --private-headers Display object format specific file header contents
-h, --[section-]headers Display the contents of the section headers
-x, --all-headers Display the contents of all headers
-d, --disassemble Display assembler contents of executable sections
-D, --disassemble-all Display assembler contents of all sections
-S, --source Intermix source code with disassembly
-s, --full-contents Display the full contents of all sections requested
-g, --debugging Display debug information in object file
-e, --debugging-tags Display debug information using ctags style
-G, --stabs Display (in raw form) any STABS info in the file
-W[lLiaprmfFsoR] or
--dwarf[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=str,=loc,=Ranges]
Display DWARF info in the file
-t, --syms Display the contents of the symbol table(s)
-T, --dynamic-syms Display the contents of the dynamic symbol table
-r, --reloc Display the relocation entries in the file
-R, --dynamic-reloc Display the dynamic relocation entries in the file
@<file> Read options from <file>
-v, --version Display this program's version number
-i, --info List object formats and architectures supported
-H, --help Display this information
The following switches are optional:
-b, --target=BFDNAME Specify the target object format as BFDNAME
-m, --architecture=MACHINE Specify the target architecture as MACHINE
-j, --section=NAME Only display information for section NAME
-M, --disassembler-options=OPT Pass text OPT on to the disassembler
-EB --endian=big Assume big endian format when disassembling
-EL --endian=little Assume little endian format when disassembling
--file-start-context Include context from start of file (with -S)
-I, --include=DIR Add DIR to search list for source files
-l, --line-numbers Include line numbers and filenames in output
-F, --file-offsets Include file offsets when displaying information
-C, --demangle[=STYLE] Decode mangled/processed symbol names
The STYLE, if specified, can be `auto', `gnu',
`lucid', `arm', `hp', `edg', `gnu-v3', `java'
or `gnat'
-w, --wide Format output for more than 80 columns
-z, --disassemble-zeroes Do not skip blocks of zeroes when disassembling
--start-address=ADDR Only process data whose address is >= ADDR
--stop-address=ADDR Only process data whose address is <= ADDR
--prefix-addresses Print complete address alongside disassembly
--[no-]show-raw-insn Display hex alongside symbolic disassembly
--insn-width=WIDTH Display WIDTH bytes on a signle line for -d
--adjust-vma=OFFSET Add OFFSET to all displayed section addresses
--special-syms Include special symbols in symbol dumps
--prefix=PREFIX Add PREFIX to absolute paths for -S
--prefix-strip=LEVEL Strip initial directory names for -S
objdump: supported targets: elf64-x86-64 elf32-i386 a.out-i386-linux pei-i386 pei-x86-64 elf64-l1om elf64-little elf64-big elf32-little elf32-big srec symbolsrec verilog tekhex binary ihex
objdump: supported architectures: i386 i386:x86-64 i8086 i386:intel i386:x86-64:intel l1om l1om:intel
The following i386/x86-64 specific disassembler options are supported for use
with the -M switch (multiple options should be separated by commas):
x86-64 Disassemble in 64bit mode
i386 Disassemble in 32bit mode
i8086 Disassemble in 16bit mode
att Display instruction in AT&T syntax
intel Display instruction in Intel syntax
att-mnemonic
Display instruction in AT&T mnemonic
intel-mnemonic
Display instruction in Intel mnemonic
addr64 Assume 64bit address size
addr32 Assume 32bit address size
addr16 Assume 16bit address size
data32 Assume 32bit data size
data16 Assume 16bit data size
suffix Always display instruction suffix in AT&T syntax
Report bugs to <http://bugzilla.redhat.com/bugzilla/>.
$ cat .bss
a.out: file format elf64-x86-64
$ cat .ctors
a.out: file format elf64-x86-64
Contents of section .ctors:
600688 ffffffff ffffffff 00000000 00000000 ................
$ cat .data
a.out: file format elf64-x86-64
Contents of section .data:
600870 00000000 ....
$ cat .data.rel.ro
a.out: file format elf64-x86-64
$ cat .dtors
a.out: file format elf64-x86-64
Contents of section .dtors:
600698 ffffffff ffffffff 00000000 00000000 ................
$ cat .dynamic
a.out: file format elf64-x86-64
Contents of section .dynamic:
6006b0 01000000 00000000 10000000 00000000 ................
6006c0 0c000000 00000000 90034000 00000000 ..........@.....
6006d0 0d000000 00000000 b8054000 00000000 ..........@.....
6006e0 f5feff6f 00000000 60024000 00000000 ...o....`.@.....
6006f0 05000000 00000000 e0024000 00000000 ..........@.....
600700 06000000 00000000 80024000 00000000 ..........@.....
600710 0a000000 00000000 3d000000 00000000 ........=.......
600720 0b000000 00000000 18000000 00000000 ................
600730 15000000 00000000 00000000 00000000 ................
600740 03000000 00000000 48086000 00000000 ........H.`.....
600750 02000000 00000000 30000000 00000000 ........0.......
600760 14000000 00000000 07000000 00000000 ................
600770 17000000 00000000 60034000 00000000 ........`.@.....
600780 07000000 00000000 48034000 00000000 ........H.@.....
600790 08000000 00000000 18000000 00000000 ................
6007a0 09000000 00000000 18000000 00000000 ................
6007b0 feffff6f 00000000 28034000 00000000 ...o....(.@.....
6007c0 ffffff6f 00000000 01000000 00000000 ...o............
6007d0 f0ffff6f 00000000 1e034000 00000000 ...o......@.....
6007e0 00000000 00000000 00000000 00000000 ................
6007f0 00000000 00000000 00000000 00000000 ................
600800 00000000 00000000 00000000 00000000 ................
600810 00000000 00000000 00000000 00000000 ................
600820 00000000 00000000 00000000 00000000 ................
600830 00000000 00000000 00000000 00000000 ................
$ cat .dynstr
a.out: file format elf64-x86-64
Contents of section .dynstr:
4002e0 005f5f67 6d6f6e5f 73746172 745f5f00 .__gmon_start__.
4002f0 6c696263 2e736f2e 36007075 7473005f libc.so.6.puts._
400300 5f6c6962 635f7374 6172745f 6d61696e _libc_start_main
400310 00474c49 42435f32 2e322e35 00 .GLIBC_2.2.5.
$ cat .dynsym
a.out: file format elf64-x86-64
Contents of section .dynsym:
400280 00000000 00000000 00000000 00000000 ................
400290 00000000 00000000 01000000 20000000 ............ ...
4002a0 00000000 00000000 00000000 00000000 ................
4002b0 1a000000 12000000 00000000 00000000 ................
4002c0 00000000 00000000 1f000000 12000000 ................
4002d0 00000000 00000000 00000000 00000000 ................
$ cat .eh_frame
a.out: file format elf64-x86-64
Contents of section .eh_frame:
400608 14000000 00000000 017a5200 01781001 .........zR..x..
400618 1b0c0708 90010000 1c000000 1c000000 ................
400628 9cfeffff 15000000 00410e10 8602430d .........A....C.
400638 06500c07 08000000 14000000 3c000000 .P..........<...
400648 98feffff 02000000 00000000 00000000 ................
400658 24000000 54000000 90feffff 89000000 $...T...........
400668 00518c05 86065f0e 4083078f 028e038d .Q...._.@.......
400678 0402580e 08000000 00000000 ..X.........
$ cat .eh_frame_hdr
a.out: file format elf64-x86-64
Contents of section .eh_frame_hdr:
4005e4 011b033b 20000000 03000000 e0feffff ...; ...........
4005f4 3c000000 fcfeffff 5c000000 0cffffff <.......\.......
400604 74000000 t...
$ cat .fini
a.out: file format elf64-x86-64
Contents of section .fini:
4005b8 4883ec08 e86ffeff ff4883c4 08c3 H....o...H....
$ cat .gcc_except_table
a.out: file format elf64-x86-64
$ cat .gnu.hash
a.out: file format elf64-x86-64
Contents of section .gnu.hash:
400260 01000000 01000000 01000000 00000000 ................
400270 00000000 00000000 00000000 ............
$ cat .gnu.version
a.out: file format elf64-x86-64
Contents of section .gnu.version:
40031e 00000000 02000200 ........
$ cat .gnu.version_r
a.out: file format elf64-x86-64
Contents of section .gnu.version_r:
400328 01000100 10000000 10000000 00000000 ................
400338 751a6909 00000200 31000000 00000000 u.i.....1.......
$ cat .got
a.out: file format elf64-x86-64
Contents of section .got:
600840 00000000 00000000 ........
$ cat .got.plt
a.out: file format elf64-x86-64
Contents of section .got.plt:
600848 b0066000 00000000 00000000 00000000 ..`.............
600858 00000000 00000000 be034000 00000000 ..........@.....
600868 ce034000 00000000 ..@.....
$ cat .init
a.out: file format elf64-x86-64
Contents of section .init:
400390 4883ec08 e8730000 00e80201 0000e8dd H....s..........
4003a0 01000048 83c408c3 ...H....
$ cat .interp
a.out: file format elf64-x86-64
Contents of section .interp:
400200 2f6c6962 36342f6c 642d6c69 6e75782d /lib64/ld-linux-
400210 7838362d 36342e73 6f2e3200 x86-64.so.2.
$ cat .jcr
a.out: file format elf64-x86-64
Contents of section .jcr:
6006a8 00000000 00000000 ........
$ cat .note.ABI-tag
a.out: file format elf64-x86-64
Contents of section .note.ABI-tag:
40021c 04000000 10000000 01000000 474e5500 ............GNU.
40022c 00000000 02000000 06000000 12000000 ................
$ cat .note.gnu.build-id
a.out: file format elf64-x86-64
Contents of section .note.gnu.build-id:
40023c 04000000 14000000 03000000 474e5500 ............GNU.
40024c 6a617e65 aaf90bad cd43b65d 3af1df33 ja~e.....C.]:..3
40025c 57b04170 W.Ap
$ cat .plt
a.out: file format elf64-x86-64
Contents of section .plt:
4003a8 ff35a204 2000ff25 a4042000 0f1f4000 .5.. ..%.. ...@.
4003b8 ff25a204 20006800 000000e9 e0ffffff .%.. .h.........
4003c8 ff259a04 20006801 000000e9 d0ffffff .%.. .h.........
$ cat .rela.dyn
a.out: file format elf64-x86-64
Contents of section .rela.dyn:
400348 40086000 00000000 06000000 01000000 @.`.............
400358 00000000 00000000 ........
$ cat .rela.plt
a.out: file format elf64-x86-64
Contents of section .rela.plt:
400360 60086000 00000000 07000000 02000000 `.`.............
400370 00000000 00000000 68086000 00000000 ........h.`.....
400380 07000000 03000000 00000000 00000000 ................
$ cat .rodata
a.out: file format elf64-x86-64
Contents of section .rodata:
4005c8 01000200 00000000 00000000 00000000 ................
4005d8 68656c6c 6f20776f 726c6400 hello world.
$ cat .text
a.out: file format elf64-x86-64
Contents of section .text:
4003e0 31ed4989 d15e4889 e24883e4 f0505449 1.I..^H..H...PTI
4003f0 c7c0e004 400048c7 c1f00440 0048c7c7 [email protected][email protected]..
400400 c4044000 e8bfffff fff49090 4883ec08 [email protected]...
400410 488b0529 04200048 85c07402 ffd04883 H..). .H..t...H.
400420 c408c390 90909090 90909090 90909090 ................
400430 554889e5 534883ec 08803d38 04200000 UH..SH....=8. ..
400440 754bbba0 06600048 8b053204 20004881 uK...`.H..2. .H.
400450 eb980660 0048c1fb 034883eb 014839d8 ...`.H...H...H9.
400460 7324660f 1f440000 4883c001 4889050d s$f..D..H...H...
400470 042000ff 14c59806 6000488b 05ff0320 . ......`.H....
400480 004839d8 72e2c605 eb032000 014883c4 .H9.r..... ..H..
400490 085bc9c3 6666662e 0f1f8400 00000000 .[..fff.........
4004a0 48833d00 02200000 554889e5 7412b800 H.=.. ..UH..t...
4004b0 00000048 85c07408 bfa80660 00c9ffe0 ...H..t....`....
4004c0 c9c39090 554889e5 bfd80540 00e8e6fe ....UH.....@....
4004d0 ffffb800 000000c9 c3909090 90909090 ................
4004e0 f3c36666 6666662e 0f1f8400 00000000 ..fffff.........
4004f0 48896c24 d84c8964 24e0488d 2d830120 H.l$.L.d$.H.-..
400500 004c8d25 7c012000 4c896c24 e84c8974 .L.%|. .L.l$.L.t
400510 24f04c89 7c24f848 895c24d0 4883ec38 $.L.|$.H.\$.H..8
400520 4c29e541 89fd4989 f648c1fd 034989d7 L).A..I..H...I..
400530 e85bfeff ff4885ed 741c31db 0f1f4000 .[...H..t.1...@.
400540 4c89fa4c 89f64489 ef41ff14 dc4883c3 L..L..D..A...H..
400550 014839eb 72ea488b 5c240848 8b6c2410 .H9.r.H.\$.H.l$.
400560 4c8b6424 184c8b6c 24204c8b 7424284c L.d$.L.l$ L.t$(L
400570 8b7c2430 4883c438 c3909090 90909090 .|$0H..8........
400580 554889e5 534883ec 08488b05 f8002000 UH..SH...H.... .
400590 4883f8ff 7419bb88 0660000f 1f440000 H...t....`...D..
4005a0 4883eb08 ffd0488b 034883f8 ff75f148 H.....H..H...u.H
4005b0 83c4085b c9c39090 ...[....