1 // The purpose of this test is to see if the COFF object writer is emitting the
2 // proper relocations for multiple pieces of data in
a single data fragment.
4 // RUN
: llvm-mc
-filetype
=obj
-triple i686-pc-win32
%s | coff-dump.py | FileCheck
%s
5 // I WOULD RUN
, BUT THIS FAILS
: llvm-mc
-filetype
=obj
-triple x86_64-pc-win32
%s
36 .asciz "I'm The Last Line."
39 // CHECK
: MachineType
= IMAGE_FILE_MACHINE_I386
(0x14C)
40 // CHECK
: NumberOfSections
= 2
41 // CHECK
: TimeDateStamp
= {{[0-9]+}}
42 // CHECK
: PointerToSymbolTable
= 0x
{{[0-9A-F
]+}}
43 // CHECK
: NumberOfSymbols
= 7
44 // CHECK
: SizeOfOptionalHeader
= 0
45 // CHECK
: Characteristics
= 0x0
46 // CHECK
: Sections
= [
48 // CHECK
: Name
= .text
49 // CHECK
: VirtualSize
= 0
50 // CHECK
: VirtualAddress
= 0
51 // CHECK
: SizeOfRawData
= {{[0-9]+}}
52 // CHECK
: PointerToRawData
= 0x
{{[0-9A-F
]+}}
53 // CHECK
: PointerToRelocations
= 0x
{{[0-9A-F
]+}}
54 // CHECK
: PointerToLineNumbers
= 0x0
55 // CHECK
: NumberOfRelocations
= 6
56 // CHECK
: NumberOfLineNumbers
= 0
57 // CHECK
: Charateristics
= 0x60500020
58 // CHECK
: IMAGE_SCN_CNT_CODE
59 // CHECK
: IMAGE_SCN_ALIGN_16BYTES
60 // CHECK
: IMAGE_SCN_MEM_EXECUTE
61 // CHECK
: IMAGE_SCN_MEM_READ
62 // CHECK
: SectionData
=
63 // CHECK
: 83 EC
04 C7
04 24 00 00 - 00 00 E8
00 00 00 00 C7 |
.....$..........|
64 // CHECK
: 04 24 07 00 00 00 E8
00 - 00 00 00 C7
04 24 10 00 |
.$...........$..|
65 // CHECK
: 00 00 E8
00 00 00 00 31 - C0
83 C4
04 C3 |
.......1.....|
66 // CHECK
: Relocations
= [
68 // CHECK
: VirtualAddress
= 0x6
69 // CHECK
: SymbolTableIndex
= 2
70 // CHECK
: Type
= IMAGE_REL_I386_DIR32
(6)
71 // CHECK
: SymbolName
= .data
74 // CHECK
: VirtualAddress
= 0xB
75 // CHECK
: SymbolTableIndex
= 5
76 // CHECK
: Type
= IMAGE_REL_I386_REL32
(20)
77 // CHECK
: SymbolName
= _printf
80 // CHECK
: VirtualAddress
= 0x12
81 // CHECK
: SymbolTableIndex
= 2
82 // CHECK
: Type
= IMAGE_REL_I386_DIR32
(6)
83 // CHECK
: SymbolName
= .data
86 // CHECK
: VirtualAddress
= 0x17
87 // CHECK
: SymbolTableIndex
= 6
88 // CHECK
: Type
= IMAGE_REL_I386_REL32
(20)
89 // CHECK
: SymbolName
= _puts
92 // CHECK
: VirtualAddress
= 0x1E
93 // CHECK
: SymbolTableIndex
= 2
94 // CHECK
: Type
= IMAGE_REL_I386_DIR32
(6)
95 // CHECK
: SymbolName
= .data
98 // CHECK
: VirtualAddress
= 0x23
99 // CHECK
: SymbolTableIndex
= 6
100 // CHECK
: Type
= IMAGE_REL_I386_REL32
(20)
101 // CHECK
: SymbolName
= _puts
106 // CHECK
: Name
= .data
107 // CHECK
: VirtualSize
= 0
108 // CHECK
: VirtualAddress
= 0
109 // CHECK
: SizeOfRawData
= {{[0-9]+}}
110 // CHECK
: PointerToRawData
= 0x
{{[0-9A-F
]+}}
111 // CHECK
: PointerToRelocations
= 0x0
112 // CHECK
: PointerToLineNumbers
= 0x0
113 // CHECK
: NumberOfRelocations
= 0
114 // CHECK
: NumberOfLineNumbers
= 0
115 // CHECK
: Charateristics
= 0xC0500040
116 // CHECK
: IMAGE_SCN_CNT_INITIALIZED_DATA
117 // CHECK
: IMAGE_SCN_ALIGN_16BYTES
118 // CHECK
: IMAGE_SCN_MEM_READ
119 // CHECK
: IMAGE_SCN_MEM_WRITE
120 // CHECK
: SectionData
=
121 // CHECK
: 48 65 6C
6C
6F
20 00 57 - 6F
72 6C
64 21 00 00 00 |Hello
.World!...|
122 // CHECK
: 49 27 6D
20 54 68 65 20 - 4C
61 73 74 20 4C
69 6E |I
'm The Last Lin|
123 // CHECK: 65 2E 00 |e..|
124 // CHECK: Relocations = None
127 // CHECK: Symbols = [
129 // CHECK: Name = .text
131 // CHECK: SectionNumber = 1
132 // CHECK: SimpleType = IMAGE_SYM_TYPE_NULL (0)
133 // CHECK: ComplexType = IMAGE_SYM_DTYPE_NULL (0)
134 // CHECK: StorageClass = IMAGE_SYM_CLASS_STATIC (3)
135 // CHECK: NumberOfAuxSymbols = 1
136 // CHECK: AuxillaryData =
137 // CHECK: 2D 00 00 00 06 00 00 00 - 00 00 00 00 01 00 00 00 |-...............|
142 // CHECK: Name = .data
144 // CHECK: SectionNumber = 2
145 // CHECK: SimpleType = IMAGE_SYM_TYPE_NULL (0)
146 // CHECK: ComplexType = IMAGE_SYM_DTYPE_NULL (0)
147 // CHECK: StorageClass = IMAGE_SYM_CLASS_STATIC (3)
148 // CHECK: NumberOfAuxSymbols = 1
149 // CHECK: AuxillaryData =
150 // CHECK: 23 00 00 00 00 00 00 00 - 00 00 00 00 02 00 00 00 |#...............|
155 // CHECK: Name = _main
157 // CHECK: SectionNumber = 1
158 // CHECK: SimpleType = IMAGE_SYM_TYPE_NULL (0)
159 // CHECK: ComplexType = IMAGE_SYM_DTYPE_FUNCTION (2)
160 // CHECK: StorageClass = IMAGE_SYM_CLASS_EXTERNAL (2)
161 // CHECK: NumberOfAuxSymbols = 0
162 // CHECK: AuxillaryData =
165 // CHECK: Name = _printf
167 // CHECK: SectionNumber = 0
168 // CHECK: SimpleType = IMAGE_SYM_TYPE_NULL (0)
169 // CHECK: ComplexType = IMAGE_SYM_DTYPE_NULL (0)
170 // CHECK: StorageClass = IMAGE_SYM_CLASS_EXTERNAL (2)
171 // CHECK: NumberOfAuxSymbols = 0
172 // CHECK: AuxillaryData =
176 // CHECK: Name = _puts
178 // CHECK: SectionNumber = 0
179 // CHECK: SimpleType = IMAGE_SYM_TYPE_NULL (0)
180 // CHECK: ComplexType = IMAGE_SYM_DTYPE_NULL (0)
181 // CHECK: StorageClass = IMAGE_SYM_CLASS_EXTERNAL (2)
182 // CHECK: NumberOfAuxSymbols = 0
183 // CHECK: AuxillaryData =