Executable Linkable Format
$ readelf -h /bin/ls
ELF Header:
Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
Class: ELF64
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: DYN (Shared object file)
Machine: Advanced Micro Devices X86-64
Version: 0x1
Entry point address: 0x5850
Start of program headers: 64 (bytes into file)
Start of section headers: 132000 (bytes into file)
Flags: 0x0
Size of this header: 64 (bytes)
Size of program headers: 56 (bytes)
Number of program headers: 9
Size of section headers: 64 (bytes)
Number of section headers: 28
Section header string table index: 27
$ readelf --segments -h /bin/ls
ELF Header:
Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
Class: ELF64
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: DYN (Shared object file)
Machine: Advanced Micro Devices X86-64
Version: 0x1
Entry point address: 0x5850
Start of program headers: 64 (bytes into file)
Start of section headers: 132000 (bytes into file)
Flags: 0x0
Size of this header: 64 (bytes)
Size of program headers: 56 (bytes)
Number of program headers: 9
Size of section headers: 64 (bytes)
Number of section headers: 28
Section header string table index: 27
Program Headers:
Type Offset VirtAddr PhysAddr
FileSiz MemSiz Flags Align
PHDR 0x0000000000000040 0x0000000000000040 0x0000000000000040
0x00000000000001f8 0x00000000000001f8 R E 0x8
INTERP 0x0000000000000238 0x0000000000000238 0x0000000000000238
0x000000000000001c 0x000000000000001c R 0x1
[Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
LOAD 0x0000000000000000 0x0000000000000000 0x0000000000000000
0x000000000001e6e8 0x000000000001e6e8 R E 0x200000
LOAD 0x000000000001eff0 0x000000000021eff0 0x000000000021eff0
0x0000000000001278 0x0000000000002570 RW 0x200000
DYNAMIC 0x000000000001fa38 0x000000000021fa38 0x000000000021fa38
0x0000000000000200 0x0000000000000200 RW 0x8
NOTE 0x0000000000000254 0x0000000000000254 0x0000000000000254
0x0000000000000044 0x0000000000000044 R 0x4
GNU_EH_FRAME 0x000000000001b1a0 0x000000000001b1a0 0x000000000001b1a0
0x0000000000000884 0x0000000000000884 R 0x4
GNU_STACK 0x0000000000000000 0x0000000000000000 0x0000000000000000
0x0000000000000000 0x0000000000000000 RW 0x10
GNU_RELRO 0x000000000001eff0 0x000000000021eff0 0x000000000021eff0
0x0000000000001010 0x0000000000001010 R 0x1
Section to Segment mapping:
Segment Sections...
00
01 .interp
02 .interp .note.ABI-tag .note.gnu.build-id .gnu.hash .dynsym .dynstr .gnu.version .gnu.version_r .rela.dyn .rela.plt .init .plt .plt.got .text .fini .rodata .eh_frame_hdr .eh_frame
03 .init_array .fini_array .data.rel.ro .dynamic .got .data .bss
04 .dynamic
05 .note.ABI-tag .note.gnu.build-id
06 .eh_frame_hdr
07
08 .init_array .fini_array .data.rel.ro .dynamic .got
$ readelf --sections -h /bin/ls
ELF Header:
Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
Class: ELF64
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: DYN (Shared object file)
Machine: Advanced Micro Devices X86-64
Version: 0x1
Entry point address: 0x5850
Start of program headers: 64 (bytes into file)
Start of section headers: 132000 (bytes into file)
Flags: 0x0
Size of this header: 64 (bytes)
Size of program headers: 56 (bytes)
Number of program headers: 9
Size of section headers: 64 (bytes)
Number of section headers: 28
Section header string table index: 27
Section Headers:
[Nr] Name Type Address Offset
Size EntSize Flags Link Info Align
[ 0] NULL 0000000000000000 00000000
0000000000000000 0000000000000000 0 0 0
[ 1] .interp PROGBITS 0000000000000238 00000238
000000000000001c 0000000000000000 A 0 0 1
[ 2] .note.ABI-tag NOTE 0000000000000254 00000254
0000000000000020 0000000000000000 A 0 0 4
[ 3] .note.gnu.build-i NOTE 0000000000000274 00000274
0000000000000024 0000000000000000 A 0 0 4
[ 4] .gnu.hash GNU_HASH 0000000000000298 00000298
00000000000000ec 0000000000000000 A 5 0 8
[ 5] .dynsym DYNSYM 0000000000000388 00000388
0000000000000df8 0000000000000018 A 6 1 8
[ 6] .dynstr STRTAB 0000000000001180 00001180
0000000000000682 0000000000000000 A 0 0 1
[ 7] .gnu.version VERSYM 0000000000001802 00001802
000000000000012a 0000000000000002 A 5 0 2
[ 8] .gnu.version_r VERNEED 0000000000001930 00001930
0000000000000070 0000000000000000 A 6 1 8
[ 9] .rela.dyn RELA 00000000000019a0 000019a0
0000000000001350 0000000000000018 A 5 0 8
[10] .rela.plt RELA 0000000000002cf0 00002cf0
0000000000000a68 0000000000000018 AI 5 23 8
[11] .init PROGBITS 0000000000003758 00003758
0000000000000017 0000000000000000 AX 0 0 4
[12] .plt PROGBITS 0000000000003770 00003770
0000000000000700 0000000000000010 AX 0 0 16
[13] .plt.got PROGBITS 0000000000003e70 00003e70
0000000000000018 0000000000000008 AX 0 0 8
[14] .text PROGBITS 0000000000003e90 00003e90
00000000000124d9 0000000000000000 AX 0 0 16
[15] .fini PROGBITS 000000000001636c 0001636c
0000000000000009 0000000000000000 AX 0 0 4
[16] .rodata PROGBITS 0000000000016380 00016380
0000000000004e1d 0000000000000000 A 0 0 32
[17] .eh_frame_hdr PROGBITS 000000000001b1a0 0001b1a0
0000000000000884 0000000000000000 A 0 0 4
[18] .eh_frame PROGBITS 000000000001ba28 0001ba28
0000000000002cc0 0000000000000000 A 0 0 8
[19] .init_array INIT_ARRAY 000000000021eff0 0001eff0
0000000000000008 0000000000000008 WA 0 0 8
[20] .fini_array FINI_ARRAY 000000000021eff8 0001eff8
0000000000000008 0000000000000008 WA 0 0 8
[21] .data.rel.ro PROGBITS 000000000021f000 0001f000
0000000000000a38 0000000000000000 WA 0 0 32
[22] .dynamic DYNAMIC 000000000021fa38 0001fa38
0000000000000200 0000000000000010 WA 6 0 8
[23] .got PROGBITS 000000000021fc38 0001fc38
00000000000003c8 0000000000000008 WA 0 0 8
[24] .data PROGBITS 0000000000220000 00020000
0000000000000268 0000000000000000 WA 0 0 32
[25] .bss NOBITS 0000000000220280 00020268
00000000000012e0 0000000000000000 WA 0 0 32
[26] .gnu_debuglink PROGBITS 0000000000000000 00020268
0000000000000034 0000000000000000 0 0 4
[27] .shstrtab STRTAB 0000000000000000 0002029c
0000000000000101 0000000000000000 0 0 1
Key to Flags:
W (write), A (alloc), X (execute), M (merge), S (strings), I (info),
L (link order), O (extra OS processing required), G (group), T (TLS),
C (compressed), x (unknown), o (OS specific), E (exclude),
l (large), p (processor specific)