Skip to content

Instantly share code, notes, and snippets.

@warabanshi
Created April 8, 2013 16:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save warabanshi/5338388 to your computer and use it in GitHub Desktop.
Save warabanshi/5338388 to your computer and use it in GitHub Desktop.
readelf -a test.out
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: EXEC (Executable file)
Machine: Advanced Micro Devices X86-64
Version: 0x1
Entry point address: 0x400340
Start of program headers: 64 (bytes into file)
Start of section headers: 4240 (bytes into file)
Flags: 0x0
Size of this header: 64 (bytes)
Size of program headers: 56 (bytes)
Number of program headers: 7
Size of section headers: 64 (bytes)
Number of section headers: 15
Section header string table index: 14
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 00000000004001c8 000001c8
000000000000001c 0000000000000000 A 0 0 1
[ 2] .note.gnu.build-i NOTE 00000000004001e4 000001e4
0000000000000024 0000000000000000 A 0 0 4
[ 3] .hash HASH 0000000000400208 00000208
0000000000000018 0000000000000004 A 5 0 8
[ 4] .gnu.hash GNU_HASH 0000000000400220 00000220
000000000000001c 0000000000000000 A 5 0 8
[ 5] .dynsym DYNSYM 0000000000400240 00000240
0000000000000048 0000000000000018 A 6 1 8
[ 6] .dynstr STRTAB 0000000000400288 00000288
0000000000000024 0000000000000000 A 0 0 1
[ 7] .gnu.version VERSYM 00000000004002ac 000002ac
0000000000000006 0000000000000002 A 5 0 2
[ 8] .gnu.version_r VERNEED 00000000004002b8 000002b8
0000000000000020 0000000000000000 A 6 1 8
[ 9] .rela.plt RELA 00000000004002d8 000002d8
0000000000000030 0000000000000018 A 5 10 8
[10] .plt PROGBITS 0000000000400308 00000308
0000000000000030 0000000000000010 AX 0 0 4
[11] .text PROGBITS 0000000000400340 00000340
0000000000000014 0000000000000000 AX 0 0 16
[12] .dynamic DYNAMIC 0000000000600e98 00000e98
0000000000000150 0000000000000010 WA 6 0 8
[13] .got.plt PROGBITS 0000000000600fe8 00000fe8
0000000000000028 0000000000000008 WA 0 0 8
[14] .shstrtab STRTAB 0000000000000000 00001010
000000000000007e 0000000000000000 0 0 1
Key to Flags:
W (write), A (alloc), X (execute), M (merge), S (strings), l (large)
I (info), L (link order), G (group), T (TLS), E (exclude), x (unknown)
O (extra OS processing required) o (OS specific), p (processor specific)
There are no section groups in this file.
Program Headers:
Type Offset VirtAddr PhysAddr
FileSiz MemSiz Flags Align
PHDR 0x0000000000000040 0x0000000000400040 0x0000000000400040
0x0000000000000188 0x0000000000000188 R E 8
INTERP 0x00000000000001c8 0x00000000004001c8 0x00000000004001c8
0x000000000000001c 0x000000000000001c R 1
[Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
LOAD 0x0000000000000000 0x0000000000400000 0x0000000000400000
0x0000000000000354 0x0000000000000354 R E 200000
LOAD 0x0000000000000e98 0x0000000000600e98 0x0000000000600e98
0x0000000000000178 0x0000000000000178 RW 200000
DYNAMIC 0x0000000000000e98 0x0000000000600e98 0x0000000000600e98
0x0000000000000150 0x0000000000000150 RW 8
NOTE 0x00000000000001e4 0x00000000004001e4 0x00000000004001e4
0x0000000000000024 0x0000000000000024 R 4
GNU_RELRO 0x0000000000000e98 0x0000000000600e98 0x0000000000600e98
0x0000000000000168 0x0000000000000168 R 1
Section to Segment mapping:
Segment Sections...
00
01 .interp
02 .interp .note.gnu.build-id .hash .gnu.hash .dynsym .dynstr .gnu.version .gnu.version_r .rela.plt .plt .text
03 .dynamic .got.plt
04 .dynamic
05 .note.gnu.build-id
06 .dynamic
Dynamic section at offset 0xe98 contains 16 entries:
Tag Type Name/Value
0x0000000000000001 (NEEDED) Shared library: [libc.so.6]
0x0000000000000004 (HASH) 0x400208
0x000000006ffffef5 (GNU_HASH) 0x400220
0x0000000000000005 (STRTAB) 0x400288
0x0000000000000006 (SYMTAB) 0x400240
0x000000000000000a (STRSZ) 36 (bytes)
0x000000000000000b (SYMENT) 24 (bytes)
0x0000000000000015 (DEBUG) 0x0
0x0000000000000003 (PLTGOT) 0x600fe8
0x0000000000000002 (PLTRELSZ) 48 (bytes)
0x0000000000000014 (PLTREL) RELA
0x0000000000000017 (JMPREL) 0x4002d8
0x000000006ffffffe (VERNEED) 0x4002b8
0x000000006fffffff (VERNEEDNUM) 1
0x000000006ffffff0 (VERSYM) 0x4002ac
0x0000000000000000 (NULL) 0x0
Relocation section '.rela.plt' at offset 0x2d8 contains 2 entries:
Offset Info Type Sym. Value Sym. Name + Addend
000000601000 000100000007 R_X86_64_JUMP_SLO 0000000000000000 exit + 0
000000601008 000200000007 R_X86_64_JUMP_SLO 0000000000000000 putchar + 0
There are no unwind sections in this file.
Symbol table '.dynsym' contains 3 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
1: 0000000000000000 0 FUNC GLOBAL DEFAULT UND exit@GLIBC_2.2.5 (2)
2: 0000000000000000 0 FUNC GLOBAL DEFAULT UND putchar@GLIBC_2.2.5 (2)
Histogram for bucket list length (total of 1 buckets):
Length Number % of total Coverage
0 0 ( 0.0%)
1 0 ( 0.0%) 0.0%
2 1 (100.0%) 100.0%
Version symbols section '.gnu.version' contains 3 entries:
Addr: 00000000004002ac Offset: 0x0002ac Link: 5 (.dynsym)
000: 0 (*local*) 2 (GLIBC_2.2.5) 2 (GLIBC_2.2.5)
Version needs section '.gnu.version_r' contains 1 entries:
Addr: 0x00000000004002b8 Offset: 0x0002b8 Link: 6 (.dynstr)
000000: Version: 1 File: libc.so.6 Cnt: 1
0x0010: Name: GLIBC_2.2.5 Flags: none Version: 2
Notes at offset 0x000001e4 with length 0x00000024:
Owner Data size Description
GNU 0x00000014 NT_GNU_BUILD_ID (unique build ID bitstring)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment