1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
| # RUN: yaml2obj %s | llvm-readobj --file-headers -r --expand-relocs - | FileCheck %s --check-prefix COFF-I386
# RUN: yaml2obj -o %t %s
# RUN: llvm-readobj --file-headers -r --expand-relocs %t | FileCheck %s --check-prefix COFF-I386
# COFF-I386: Characteristics [ (0x200)
# COFF-I386-NEXT: IMAGE_FILE_DEBUG_STRIPPED (0x200)
# COFF-I386-NEXT: ]
# COFF-I386: Relocations [
# COFF-I386-NEXT: Section (1) .text {
# COFF-I386-NEXT: Relocation {
# COFF-I386-NEXT: Offset: 0xE
# COFF-I386-NEXT: Type: IMAGE_REL_I386_DIR32 (6)
# COFF-I386-NEXT: Symbol: L_.str
# COFF-I386-NEXT: SymbolIndex: 5
# COFF-I386-NEXT: }
# COFF-I386-NEXT: Relocation {
# COFF-I386-NEXT: Offset: 0x13
# COFF-I386-NEXT: Type: IMAGE_REL_I386_REL32 (20)
# COFF-I386-NEXT: Symbol: _puts
# COFF-I386-NEXT: SymbolIndex: 6
# COFF-I386-NEXT: }
# COFF-I386-NEXT: Relocation {
# COFF-I386-NEXT: Offset: 0x18
# COFF-I386-NEXT: Type: IMAGE_REL_I386_REL32 (20)
# COFF-I386-NEXT: Symbol: _SomeOtherFunction
# COFF-I386-NEXT: SymbolIndex: 7
# COFF-I386-NEXT: }
# COFF-I386-NEXT: }
# COFF-I386-NEXT: ]
!COFF
header: !Header
Machine: IMAGE_FILE_MACHINE_I386 # (0x14c)
Characteristics: [ IMAGE_FILE_DEBUG_STRIPPED ]
sections:
- !Section
Name: .text
Alignment: 16
Characteristics: [IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ, ] # 0x60500020
SectionData: !hex "83EC0CC744240800000000C7042400000000E800000000E8000000008B44240883C40CC3" # |....D$.......$...............D$.....|
Relocations:
- !Relocation
VirtualAddress: 0xe
SymbolName: L_.str
Type: IMAGE_REL_I386_DIR32
- !Relocation
VirtualAddress: 0x13
SymbolName: _puts
Type: IMAGE_REL_I386_REL32
- !Relocation
VirtualAddress: 0x18
SymbolName: _SomeOtherFunction
Type: IMAGE_REL_I386_REL32
- !Section
Name: .data
Alignment: 1
Characteristics: [IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE, ] # 0xc0100040
SectionData: !hex "48656C6C6F20576F726C642100" # |Hello World!.|
symbols:
- !Symbol
Name: .text
Value: 0
SectionNumber: 1
SimpleType: IMAGE_SYM_TYPE_NULL # (0)
ComplexType: IMAGE_SYM_DTYPE_NULL # (0)
StorageClass: IMAGE_SYM_CLASS_STATIC # (3)
SectionDefinition:
Length: 36
NumberOfRelocations: 3
NumberOfLinenumbers: 0
CheckSum: 0
Number: 1
- !Symbol
Name: .data
Value: 0
SectionNumber: 2
SimpleType: IMAGE_SYM_TYPE_NULL # (0)
ComplexType: IMAGE_SYM_DTYPE_NULL # (0)
StorageClass: IMAGE_SYM_CLASS_STATIC # (3)
SectionDefinition:
Length: 13
NumberOfRelocations: 0
NumberOfLinenumbers: 0
CheckSum: 0
Number: 2
- !Symbol
Name: _main
Value: 0
SectionNumber: 1
SimpleType: IMAGE_SYM_TYPE_NULL # (0)
ComplexType: IMAGE_SYM_DTYPE_FUNCTION # (2)
StorageClass: IMAGE_SYM_CLASS_EXTERNAL # (2)
- !Symbol
Name: L_.str
Value: 0
SectionNumber: 2
SimpleType: IMAGE_SYM_TYPE_NULL # (0)
ComplexType: IMAGE_SYM_DTYPE_NULL # (0)
StorageClass: IMAGE_SYM_CLASS_STATIC # (3)
- !Symbol
Name: _puts
Value: 0
SectionNumber: 0
SimpleType: IMAGE_SYM_TYPE_NULL # (0)
ComplexType: IMAGE_SYM_DTYPE_NULL # (0)
StorageClass: IMAGE_SYM_CLASS_EXTERNAL # (2)
- !Symbol
Name: _SomeOtherFunction
Value: 0
SectionNumber: 0
SimpleType: IMAGE_SYM_TYPE_NULL # (0)
ComplexType: IMAGE_SYM_DTYPE_NULL # (0)
StorageClass: IMAGE_SYM_CLASS_EXTERNAL # (2)
|