Skip to content

Instantly share code, notes, and snippets.

@olegslavkin
Created November 6, 2013 13:30
Show Gist options
  • Save olegslavkin/7336092 to your computer and use it in GitHub Desktop.
Save olegslavkin/7336092 to your computer and use it in GitHub Desktop.
readelf -a helloworld >> hello_elf_headers.txt on board Tion-Pro28 (Freescale iMX.28 (Freescale MX28EVK board)
ELF Header:
Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: EXEC (Executable file)
Machine: ARM
Version: 0x1
Entry point address: 0x830c
Start of program headers: 52 (bytes into file)
Start of section headers: 4452 (bytes into file)
Flags: 0x5000002, has entry point, Version5 EABI
Size of this header: 52 (bytes)
Size of program headers: 32 (bytes)
Number of program headers: 10
Size of section headers: 40 (bytes)
Number of section headers: 29
Section header string table index: 26
Section Headers:
[Nr] Name Type Addr Off Size ES Flg Lk Inf Al
[ 0] NULL 00000000 000000 000000 00 0 0 0
[ 1] .interp PROGBITS 00008174 000174 000013 00 A 0 0 1
[ 2] .note.ABI-tag NOTE 00008188 000188 000020 00 A 0 0 4
[ 3] .hash HASH 000081a8 0001a8 000028 04 A 4 0 4
[ 4] .dynsym DYNSYM 000081d0 0001d0 000050 10 A 5 1 4
[ 5] .dynstr STRTAB 00008220 000220 000049 00 A 0 0 1
[ 6] .gnu.version VERSYM 0000826a 00026a 00000a 02 A 4 0 2
[ 7] .gnu.version_r VERNEED 00008274 000274 000020 00 A 5 1 4
[ 8] .rel.dyn REL 00008294 000294 000008 08 A 4 0 4
[ 9] .rel.plt REL 0000829c 00029c 000020 08 A 4 11 4
[10] .init PROGBITS 000082bc 0002bc 00000c 00 AX 0 0 4
[11] .plt PROGBITS 000082c8 0002c8 000044 04 AX 0 0 4
[12] .text PROGBITS 0000830c 00030c 000134 00 AX 0 0 4
[13] .fini PROGBITS 00008440 000440 000008 00 AX 0 0 4
[14] .rodata PROGBITS 00008448 000448 000014 00 A 0 0 4
[15] .ARM.exidx ARM_EXIDX 0000845c 00045c 000008 00 AL 12 0 4
[16] .eh_frame PROGBITS 00008464 000464 000004 00 A 0 0 4
[17] .init_array INIT_ARRAY 00010f0c 000f0c 000004 00 WA 0 0 4
[18] .fini_array FINI_ARRAY 00010f10 000f10 000004 00 WA 0 0 4
[19] .jcr PROGBITS 00010f14 000f14 000004 00 WA 0 0 4
[20] .dynamic DYNAMIC 00010f18 000f18 0000e8 08 WA 5 0 4
[21] .got PROGBITS 00011000 001000 000020 04 WA 0 0 4
[22] .data PROGBITS 00011020 001020 000008 00 WA 0 0 4
[23] .bss NOBITS 00011028 001028 000004 00 WA 0 0 1
[24] .ARM.attributes ARM_ATTRIBUTES 00000000 001028 000029 00 0 0 1
[25] .comment PROGBITS 00000000 001051 00001e 01 MS 0 0 1
[26] .shstrtab STRTAB 00000000 00106f 0000f3 00 0 0 1
[27] .symtab SYMTAB 00000000 0015ec 0005c0 10 28 68 4
[28] .strtab STRTAB 00000000 001bac 00022c 00 0 0 1
Key to Flags:
W (write), A (alloc), X (execute), M (merge), S (strings)
I (info), L (link order), G (group), 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 Flg Align
EXIDX 0x00045c 0x0000845c 0x0000845c 0x00008 0x00008 R 0x4
PHDR 0x000034 0x00008034 0x00008034 0x00140 0x00140 R E 0x4
INTERP 0x000174 0x00008174 0x00008174 0x00013 0x00013 R 0x1
[Requesting program interpreter: /lib/ld-linux.so.3]
LOAD 0x000000 0x00008000 0x00008000 0x00468 0x00468 R E 0x8000
LOAD 0x000f0c 0x00010f0c 0x00010f0c 0x0011c 0x00120 RW 0x8000
DYNAMIC 0x000f18 0x00010f18 0x00010f18 0x000e8 0x000e8 RW 0x4
NOTE 0x000188 0x00008188 0x00008188 0x00020 0x00020 R 0x4
GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RWE 0x4
GNU_RELRO 0x000f0c 0x00010f0c 0x00010f0c 0x000f4 0x000f4 R 0x1
LOOS+5041580 0x000000 0x00000000 0x00000000 0x00000 0x00000 0x4
Section to Segment mapping:
Segment Sections...
00 .ARM.exidx
01
02 .interp
03 .interp .note.ABI-tag .hash .dynsym .dynstr .gnu.version .gnu.version_r .rel.dyn .rel.plt .init .plt .text .fini .rodata .ARM.exidx .eh_frame
04 .init_array .fini_array .jcr .dynamic .got .data .bss
05 .dynamic
06 .note.ABI-tag
07
08 .init_array .fini_array .jcr .dynamic
09
Dynamic section at offset 0xf18 contains 24 entries:
Tag Type Name/Value
0x00000001 (NEEDED) Shared library: [libc.so.6]
0x0000000c (INIT) 0x82bc
0x0000000d (FINI) 0x8440
0x00000019 (INIT_ARRAY) 0x10f0c
0x0000001b (INIT_ARRAYSZ) 4 (bytes)
0x0000001a (FINI_ARRAY) 0x10f10
0x0000001c (FINI_ARRAYSZ) 4 (bytes)
0x00000004 (HASH) 0x81a8
0x00000005 (STRTAB) 0x8220
0x00000006 (SYMTAB) 0x81d0
0x0000000a (STRSZ) 73 (bytes)
0x0000000b (SYMENT) 16 (bytes)
0x00000015 (DEBUG) 0x0
0x00000003 (PLTGOT) 0x11000
0x00000002 (PLTRELSZ) 32 (bytes)
0x00000014 (PLTREL) REL
0x00000017 (JMPREL) 0x829c
0x00000011 (REL) 0x8294
0x00000012 (RELSZ) 8 (bytes)
0x00000013 (RELENT) 8 (bytes)
0x6ffffffe (VERNEED) 0x8274
0x6fffffff (VERNEEDNUM) 1
0x6ffffff0 (VERSYM) 0x826a
0x00000000 (NULL) 0x0
Relocation section '.rel.dyn' at offset 0x294 contains 1 entries:
Offset Info Type Sym.Value Sym. Name
0001101c 00000315 R_ARM_GLOB_DAT 00000000 __gmon_start__
Relocation section '.rel.plt' at offset 0x29c contains 4 entries:
Offset Info Type Sym.Value Sym. Name
0001100c 00000116 R_ARM_JUMP_SLOT 000082dc abort
00011010 00000216 R_ARM_JUMP_SLOT 000082e8 __libc_start_main
00011014 00000316 R_ARM_JUMP_SLOT 00000000 __gmon_start__
00011018 00000416 R_ARM_JUMP_SLOT 00008300 __printf_chk
There are no unwind sections in this file.
Symbol table '.dynsym' contains 5 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 00000000 0 NOTYPE LOCAL DEFAULT UND
1: 000082dc 0 FUNC GLOBAL DEFAULT UND abort@GLIBC_2.4 (2)
2: 000082e8 0 FUNC GLOBAL DEFAULT UND __libc_start_main@GLIBC_2.4 (2)
3: 00000000 0 NOTYPE WEAK DEFAULT UND __gmon_start__
4: 00008300 0 FUNC GLOBAL DEFAULT UND __printf_chk@GLIBC_2.4 (2)
Symbol table '.symtab' contains 92 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 00000000 0 NOTYPE LOCAL DEFAULT UND
1: 00008348 0 NOTYPE LOCAL DEFAULT 12 $a
2: 00008348 0 FUNC LOCAL DEFAULT 12 call_gmon_start
3: 00008364 0 NOTYPE LOCAL DEFAULT 12 $d
4: 000082bc 0 NOTYPE LOCAL DEFAULT 10 $a
5: 00008440 0 NOTYPE LOCAL DEFAULT 13 $a
6: 00008188 0 NOTYPE LOCAL DEFAULT 2 $d
7: 0000830c 0 NOTYPE LOCAL DEFAULT 12 $a
8: 0000845c 0 NOTYPE LOCAL DEFAULT 15 $d
9: 0000833c 0 NOTYPE LOCAL DEFAULT 12 $d
10: 00008448 0 NOTYPE LOCAL DEFAULT 14 $d
11: 000082c4 0 NOTYPE LOCAL DEFAULT 10 $a
12: 00008444 0 NOTYPE LOCAL DEFAULT 13 $a
13: 00010f14 0 OBJECT LOCAL DEFAULT 19 __JCR_LIST__
14: 00011024 0 NOTYPE LOCAL DEFAULT 22 $d
15: 0000836c 0 NOTYPE LOCAL DEFAULT 12 $a
16: 0000836c 0 FUNC LOCAL DEFAULT 12 __do_global_dtors_aux
17: 00008384 0 NOTYPE LOCAL DEFAULT 12 $d
18: 00011028 1 OBJECT LOCAL DEFAULT 23 completed.6598
19: 00010f10 0 NOTYPE LOCAL DEFAULT 18 $d
20: 00010f10 0 OBJECT LOCAL DEFAULT 18 __do_global_dtors_aux_fin
21: 00008388 0 NOTYPE LOCAL DEFAULT 12 $a
22: 00008388 0 FUNC LOCAL DEFAULT 12 frame_dummy
23: 000083b0 0 NOTYPE LOCAL DEFAULT 12 $d
24: 00010f0c 0 NOTYPE LOCAL DEFAULT 17 $d
25: 00010f0c 0 OBJECT LOCAL DEFAULT 17 __frame_dummy_init_array_
26: 00011028 0 NOTYPE LOCAL DEFAULT 23 $d
27: 000083b8 0 NOTYPE LOCAL DEFAULT 12 $a
28: 000083d0 0 NOTYPE LOCAL DEFAULT 12 $d
29: 0000844c 0 NOTYPE LOCAL DEFAULT 14 $d
30: 000083d4 0 NOTYPE LOCAL DEFAULT 12 $a
31: 00008434 0 NOTYPE LOCAL DEFAULT 12 $d
32: 00008464 0 NOTYPE LOCAL DEFAULT 16 $d
33: 00008464 0 OBJECT LOCAL DEFAULT 16 __FRAME_END__
34: 00010f14 0 NOTYPE LOCAL DEFAULT 19 $d
35: 00010f14 0 OBJECT LOCAL DEFAULT 19 __JCR_END__
36: 00011000 0 OBJECT LOCAL HIDDEN 21 _GLOBAL_OFFSET_TABLE_
37: 00010f10 0 NOTYPE LOCAL HIDDEN 17 __init_array_end
38: 00010f0c 0 NOTYPE LOCAL HIDDEN 17 __init_array_start
39: 00010f18 0 OBJECT LOCAL HIDDEN 20 _DYNAMIC
40: 000082c8 0 NOTYPE LOCAL DEFAULT 11 $a
41: 000082d8 0 NOTYPE LOCAL DEFAULT 11 $d
42: 000082dc 0 NOTYPE LOCAL DEFAULT 11 $a
43: 00008174 0 SECTION LOCAL DEFAULT 1
44: 00008188 0 SECTION LOCAL DEFAULT 2
45: 000081a8 0 SECTION LOCAL DEFAULT 3
46: 000081d0 0 SECTION LOCAL DEFAULT 4
47: 00008220 0 SECTION LOCAL DEFAULT 5
48: 0000826a 0 SECTION LOCAL DEFAULT 6
49: 00008274 0 SECTION LOCAL DEFAULT 7
50: 00008294 0 SECTION LOCAL DEFAULT 8
51: 0000829c 0 SECTION LOCAL DEFAULT 9
52: 000082bc 0 SECTION LOCAL DEFAULT 10
53: 000082c8 0 SECTION LOCAL DEFAULT 11
54: 0000830c 0 SECTION LOCAL DEFAULT 12
55: 00008440 0 SECTION LOCAL DEFAULT 13
56: 00008448 0 SECTION LOCAL DEFAULT 14
57: 0000845c 0 SECTION LOCAL DEFAULT 15
58: 00008464 0 SECTION LOCAL DEFAULT 16
59: 00010f0c 0 SECTION LOCAL DEFAULT 17
60: 00010f10 0 SECTION LOCAL DEFAULT 18
61: 00010f14 0 SECTION LOCAL DEFAULT 19
62: 00010f18 0 SECTION LOCAL DEFAULT 20
63: 00011000 0 SECTION LOCAL DEFAULT 21
64: 00011020 0 SECTION LOCAL DEFAULT 22
65: 00011028 0 SECTION LOCAL DEFAULT 23
66: 00000000 0 SECTION LOCAL DEFAULT 24
67: 00000000 0 SECTION LOCAL DEFAULT 25
68: 00011020 0 NOTYPE WEAK DEFAULT 22 data_start
69: 000082dc 0 FUNC GLOBAL DEFAULT UND abort@@GLIBC_2.4
70: 000083d4 4 FUNC GLOBAL DEFAULT 12 __libc_csu_fini
71: 0000830c 0 FUNC GLOBAL DEFAULT 12 _start
72: 000082e8 0 FUNC GLOBAL DEFAULT UND __libc_start_main@@GLIBC_
73: 00000000 0 NOTYPE WEAK DEFAULT UND __gmon_start__
74: 00000000 0 NOTYPE WEAK DEFAULT UND _Jv_RegisterClasses
75: 00008440 0 FUNC GLOBAL DEFAULT 13 _fini
76: 00008300 0 FUNC GLOBAL DEFAULT UND __printf_chk@@GLIBC_2.4
77: 00008448 4 OBJECT GLOBAL DEFAULT 14 _IO_stdin_used
78: 00011020 0 NOTYPE GLOBAL DEFAULT 22 __data_start
79: 00011028 0 NOTYPE GLOBAL DEFAULT ABS __bss_start__
80: 00008464 0 NOTYPE GLOBAL DEFAULT ABS __exidx_end
81: 00011024 0 OBJECT GLOBAL HIDDEN 22 __dso_handle
82: 0001102c 0 NOTYPE GLOBAL DEFAULT ABS __end__
83: 000083d8 104 FUNC GLOBAL DEFAULT 12 __libc_csu_init
84: 0001102c 0 NOTYPE GLOBAL DEFAULT ABS __bss_end__
85: 00011028 0 NOTYPE GLOBAL DEFAULT ABS __bss_start
86: 0001102c 0 NOTYPE GLOBAL DEFAULT ABS _bss_end__
87: 0001102c 0 NOTYPE GLOBAL DEFAULT ABS _end
88: 00011028 0 NOTYPE GLOBAL DEFAULT ABS _edata
89: 0000845c 0 NOTYPE GLOBAL DEFAULT ABS __exidx_start
90: 000083b8 28 FUNC GLOBAL DEFAULT 12 main
91: 000082bc 0 FUNC GLOBAL DEFAULT 10 _init
Histogram for bucket list length (total of 3 buckets):
Length Number % of total Coverage
0 0 ( 0.0%)
1 2 ( 66.7%) 50.0%
2 1 ( 33.3%) 100.0%
Version symbols section '.gnu.version' contains 5 entries:
Addr: 000000000000826a Offset: 0x00026a Link: 4 (.dynsym)
000: 0 (*local*) 2 (GLIBC_2.4) 2 (GLIBC_2.4) 0 (*local*)
004: 2 (GLIBC_2.4)
Version needs section '.gnu.version_r' contains 1 entries:
Addr: 0x0000000000008274 Offset: 0x000274 Link: 5 (.dynstr)
000000: Version: 1 File: libc.so.6 Cnt: 1
0x0010: Name: GLIBC_2.4 Flags: none Version: 2
Notes at offset 0x00000188 with length 0x00000020:
Owner Data size Description
GNU 0x00000010 NT_GNU_ABI_TAG (ABI version tag)
Attribute Section: aeabi
File Attributes
Tag_CPU_name: "5TE"
Tag_CPU_arch: v5TE
Tag_ARM_ISA_use: Yes
Tag_THUMB_ISA_use: Thumb-1
Tag_ABI_PCS_wchar_t: 4
Tag_ABI_FP_denormal: Needed
Tag_ABI_FP_exceptions: Needed
Tag_ABI_FP_number_model: IEEE 754
Tag_ABI_align8_needed: Yes
Tag_ABI_align8_preserved: Yes, except leaf SP
Tag_ABI_enum_size: int
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment