1 ## This test is checking the handling of invalid/malformed note entries for
2 ## AMDGPU code object v2.
4 # RUN: yaml2obj %s -o %t.o
5 # RUN: llvm-readobj --notes %t.o | FileCheck %s --match-full-lines --check-prefix=LLVM
6 # RUN: llvm-readelf --notes %t.o | FileCheck %s --match-full-lines --check-prefix=GNU
9 # LLVM-NEXT: NoteSection {
10 # LLVM-NEXT: Name: .note.nt_amd_hsa_code_object_version_0
11 # LLVM-NEXT: Offset: 0x40
12 # LLVM-NEXT: Size: 0x14
15 # LLVM-NEXT: Owner: AMD
16 # LLVM-NEXT: Data size: 0x4
17 # LLVM-NEXT: Type: NT_AMD_HSA_CODE_OBJECT_VERSION (AMD HSA Code Object Version)
18 # LLVM-NEXT: AMD HSA Code Object Version: Invalid AMD HSA Code Object Version
22 # LLVM-NEXT: NoteSection {
23 # LLVM-NEXT: Name: .note.nt_amd_hsa_code_object_version_1
24 # LLVM-NEXT: Offset: 0x54
25 # LLVM-NEXT: Size: 0x1C
28 # LLVM-NEXT: Owner: AMD
29 # LLVM-NEXT: Data size: 0xC
30 # LLVM-NEXT: Type: NT_AMD_HSA_CODE_OBJECT_VERSION (AMD HSA Code Object Version)
31 # LLVM-NEXT: AMD HSA Code Object Version: Invalid AMD HSA Code Object Version
35 # LLVM-NEXT: NoteSection {
36 # LLVM-NEXT: Name: .note.nt_amd_hsa_hsail_0
37 # LLVM-NEXT: Offset: 0x70
38 # LLVM-NEXT: Size: 0x1C
41 # LLVM-NEXT: Owner: AMD
42 # LLVM-NEXT: Data size: 0xA
43 # LLVM-NEXT: Type: NT_AMD_HSA_HSAIL (AMD HSA HSAIL Properties)
44 # LLVM-NEXT: AMD HSA HSAIL Properties: Invalid AMD HSA HSAIL Properties
48 # LLVM-NEXT: NoteSection {
49 # LLVM-NEXT: Name: .note.nt_amd_hsa_hsail_1
50 # LLVM-NEXT: Offset: 0x8C
51 # LLVM-NEXT: Size: 0x24
54 # LLVM-NEXT: Owner: AMD
55 # LLVM-NEXT: Data size: 0x14
56 # LLVM-NEXT: Type: NT_AMD_HSA_HSAIL (AMD HSA HSAIL Properties)
57 # LLVM-NEXT: AMD HSA HSAIL Properties: Invalid AMD HSA HSAIL Properties
61 # LLVM-NEXT: NoteSection {
62 # LLVM-NEXT: Name: .note.nt_amd_hsa_isa_version_0
63 # LLVM-NEXT: Offset: 0xB0
64 # LLVM-NEXT: Size: 0x18
67 # LLVM-NEXT: Owner: AMD
68 # LLVM-NEXT: Data size: 0x8
69 # LLVM-NEXT: Type: NT_AMD_HSA_ISA_VERSION (AMD HSA ISA Version)
70 # LLVM-NEXT: AMD HSA ISA Version: Invalid AMD HSA ISA Version
74 # LLVM-NEXT: NoteSection {
75 # LLVM-NEXT: Name: .note.nt_amd_hsa_isa_version_1
76 # LLVM-NEXT: Offset: 0xC8
77 # LLVM-NEXT: Size: 0x28
80 # LLVM-NEXT: Owner: AMD
81 # LLVM-NEXT: Data size: 0x17
82 # LLVM-NEXT: Type: NT_AMD_HSA_ISA_VERSION (AMD HSA ISA Version)
83 # LLVM-NEXT: AMD HSA ISA Version: Invalid AMD HSA ISA Version
87 # LLVM-NEXT: NoteSection {
88 # LLVM-NEXT: Name: .note.nt_amd_hsa_isa_version_2
89 # LLVM-NEXT: Offset: 0xF0
90 # LLVM-NEXT: Size: 0x28
93 # LLVM-NEXT: Owner: AMD
94 # LLVM-NEXT: Data size: 0x17
95 # LLVM-NEXT: Type: NT_AMD_HSA_ISA_VERSION (AMD HSA ISA Version)
96 # LLVM-NEXT: AMD HSA ISA Version: Invalid AMD HSA ISA Version
100 # LLVM-NEXT: NoteSection {
101 # LLVM-NEXT: Name: .note.nt_amd_hsa_isa_version_3
102 # LLVM-NEXT: Offset: 0x118
103 # LLVM-NEXT: Size: 0x28
106 # LLVM-NEXT: Owner: AMD
107 # LLVM-NEXT: Data size: 0x17
108 # LLVM-NEXT: Type: NT_AMD_HSA_ISA_VERSION (AMD HSA ISA Version)
109 # LLVM-NEXT: AMD HSA ISA Version: Invalid AMD HSA ISA Version
113 # LLVM-NEXT: NoteSection {
114 # LLVM-NEXT: Name: .note.nt_amd_pal_metadata
115 # LLVM-NEXT: Offset: 0x140
116 # LLVM-NEXT: Size: 0x14
119 # LLVM-NEXT: Owner: AMD
120 # LLVM-NEXT: Data size: 0x4
121 # LLVM-NEXT: Type: NT_AMD_PAL_METADATA (AMD PAL Metadata)
122 # LLVM-NEXT: AMD PAL Metadata: Invalid AMD PAL Metadata
128 # GNU: Displaying notes found in: .note.nt_amd_hsa_code_object_version_0
129 # GNU-NEXT: Owner Data size Description
130 # GNU-NEXT: AMD 0x00000004 NT_AMD_HSA_CODE_OBJECT_VERSION (AMD HSA Code Object Version)
131 # GNU-NEXT: AMD HSA Code Object Version:
132 # GNU-NEXT: Invalid AMD HSA Code Object Version
134 # GNU-NEXT: Displaying notes found in: .note.nt_amd_hsa_code_object_version_1
135 # GNU-NEXT: Owner Data size Description
136 # GNU-NEXT: AMD 0x0000000c NT_AMD_HSA_CODE_OBJECT_VERSION (AMD HSA Code Object Version)
137 # GNU-NEXT: AMD HSA Code Object Version:
138 # GNU-NEXT: Invalid AMD HSA Code Object Version
140 # GNU-NEXT: Displaying notes found in: .note.nt_amd_hsa_hsail_0
141 # GNU-NEXT: Owner Data size Description
142 # GNU-NEXT: AMD 0x0000000a NT_AMD_HSA_HSAIL (AMD HSA HSAIL Properties)
143 # GNU-NEXT: AMD HSA HSAIL Properties:
144 # GNU-NEXT: Invalid AMD HSA HSAIL Properties
146 # GNU-NEXT: Displaying notes found in: .note.nt_amd_hsa_hsail_1
147 # GNU-NEXT: Owner Data size Description
148 # GNU-NEXT: AMD 0x00000014 NT_AMD_HSA_HSAIL (AMD HSA HSAIL Properties)
149 # GNU-NEXT: AMD HSA HSAIL Properties:
150 # GNU-NEXT: Invalid AMD HSA HSAIL Properties
152 # GNU-NEXT: Displaying notes found in: .note.nt_amd_hsa_isa_version_0
153 # GNU-NEXT: Owner Data size Description
154 # GNU-NEXT: AMD 0x00000008 NT_AMD_HSA_ISA_VERSION (AMD HSA ISA Version)
155 # GNU-NEXT: AMD HSA ISA Version:
156 # GNU-NEXT: Invalid AMD HSA ISA Version
158 # GNU-NEXT: Displaying notes found in: .note.nt_amd_hsa_isa_version_1
159 # GNU-NEXT: Owner Data size Description
160 # GNU-NEXT: AMD 0x00000017 NT_AMD_HSA_ISA_VERSION (AMD HSA ISA Version)
161 # GNU-NEXT: AMD HSA ISA Version:
162 # GNU-NEXT: Invalid AMD HSA ISA Version
164 # GNU-NEXT: Displaying notes found in: .note.nt_amd_hsa_isa_version_2
165 # GNU-NEXT: Owner Data size Description
166 # GNU-NEXT: AMD 0x00000017 NT_AMD_HSA_ISA_VERSION (AMD HSA ISA Version)
167 # GNU-NEXT: AMD HSA ISA Version:
168 # GNU-NEXT: Invalid AMD HSA ISA Version
170 # GNU-NEXT: Displaying notes found in: .note.nt_amd_hsa_isa_version_3
171 # GNU-NEXT: Owner Data size Description
172 # GNU-NEXT: AMD 0x00000017 NT_AMD_HSA_ISA_VERSION (AMD HSA ISA Version)
173 # GNU-NEXT: AMD HSA ISA Version:
174 # GNU-NEXT: Invalid AMD HSA ISA Version
176 # GNU-NEXT: Displaying notes found in: .note.nt_amd_pal_metadata
177 # GNU-NEXT: Owner Data size Description
178 # GNU-NEXT: AMD 0x00000004 NT_AMD_PAL_METADATA (AMD PAL Metadata)
179 # GNU-NEXT: AMD PAL Metadata:
180 # GNU-NEXT: Invalid AMD PAL Metadata
188 - Name: .note.nt_amd_hsa_code_object_version_0
192 Type: NT_AMD_HSA_CODE_OBJECT_VERSION
193 ## Desc size is too small (less than sizeof(CodeObjectVersion)).
195 - Name: .note.nt_amd_hsa_code_object_version_1
199 Type: NT_AMD_HSA_CODE_OBJECT_VERSION
200 ## Desc size is too large (more than sizeof(CodeObjectVersion)).
201 Desc: '020000000200000002000000'
202 - Name: .note.nt_amd_hsa_hsail_0
206 Type: NT_AMD_HSA_HSAIL
207 ## Desc size is too small (less than sizeof(HSAILProperties)).
208 Desc: '02000000010000000102'
209 - Name: .note.nt_amd_hsa_hsail_1
213 Type: NT_AMD_HSA_HSAIL
214 ## Desc size is too large (more than sizeof(HSAILProperties)).
215 Desc: '0200000001000000010202000000010200000001'
216 - Name: .note.nt_amd_hsa_isa_version_0
220 Type: NT_AMD_HSA_ISA_VERSION
221 ## Desc size is too small (less than sizeof(IsaVersion)).
222 Desc: '0400070008000000'
223 - Name: .note.nt_amd_hsa_isa_version_1
227 Type: NT_AMD_HSA_ISA_VERSION
228 ## Desc size is too small (less than sizeof(IsaVersion) +
229 ## VendorNameSize + ArchitectureNameSize).
230 Desc: '04000700080000000000000002000000414d4400414d44'
231 - Name: .note.nt_amd_hsa_isa_version_2
235 Type: NT_AMD_HSA_ISA_VERSION
236 ## VendorNameSize is 0.
237 Desc: '00000700080000000000000002000000414d4400414d44'
238 - Name: .note.nt_amd_hsa_isa_version_3
242 Type: NT_AMD_HSA_ISA_VERSION
243 ## ArchitectureNameSize is 0.
244 Desc: '04000000080000000000000002000000414d4400414d44'
245 - Name: .note.nt_amd_pal_metadata
249 Type: NT_AMD_PAL_METADATA
250 ## Desc size is not a multiple of sizeof(PALMetadata).