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
14 # LLVM-NEXT: Owner: AMD
15 # LLVM-NEXT: Data size: 0x4
16 # LLVM-NEXT: Type: NT_AMD_HSA_CODE_OBJECT_VERSION (AMD HSA Code Object Version)
17 # LLVM-NEXT: AMD HSA Code Object Version: Invalid AMD HSA Code Object Version
20 # LLVM-NEXT: NoteSection {
21 # LLVM-NEXT: Name: .note.nt_amd_hsa_code_object_version_1
22 # LLVM-NEXT: Offset: 0x54
23 # LLVM-NEXT: Size: 0x1C
25 # LLVM-NEXT: Owner: AMD
26 # LLVM-NEXT: Data size: 0xC
27 # LLVM-NEXT: Type: NT_AMD_HSA_CODE_OBJECT_VERSION (AMD HSA Code Object Version)
28 # LLVM-NEXT: AMD HSA Code Object Version: Invalid AMD HSA Code Object Version
31 # LLVM-NEXT: NoteSection {
32 # LLVM-NEXT: Name: .note.nt_amd_hsa_hsail_0
33 # LLVM-NEXT: Offset: 0x70
34 # LLVM-NEXT: Size: 0x1C
36 # LLVM-NEXT: Owner: AMD
37 # LLVM-NEXT: Data size: 0xA
38 # LLVM-NEXT: Type: NT_AMD_HSA_HSAIL (AMD HSA HSAIL Properties)
39 # LLVM-NEXT: AMD HSA HSAIL Properties: Invalid AMD HSA HSAIL Properties
42 # LLVM-NEXT: NoteSection {
43 # LLVM-NEXT: Name: .note.nt_amd_hsa_hsail_1
44 # LLVM-NEXT: Offset: 0x8C
45 # LLVM-NEXT: Size: 0x24
47 # LLVM-NEXT: Owner: AMD
48 # LLVM-NEXT: Data size: 0x14
49 # LLVM-NEXT: Type: NT_AMD_HSA_HSAIL (AMD HSA HSAIL Properties)
50 # LLVM-NEXT: AMD HSA HSAIL Properties: Invalid AMD HSA HSAIL Properties
53 # LLVM-NEXT: NoteSection {
54 # LLVM-NEXT: Name: .note.nt_amd_hsa_isa_version_0
55 # LLVM-NEXT: Offset: 0xB0
56 # LLVM-NEXT: Size: 0x18
58 # LLVM-NEXT: Owner: AMD
59 # LLVM-NEXT: Data size: 0x8
60 # LLVM-NEXT: Type: NT_AMD_HSA_ISA_VERSION (AMD HSA ISA Version)
61 # LLVM-NEXT: AMD HSA ISA Version: Invalid AMD HSA ISA Version
64 # LLVM-NEXT: NoteSection {
65 # LLVM-NEXT: Name: .note.nt_amd_hsa_isa_version_1
66 # LLVM-NEXT: Offset: 0xC8
67 # LLVM-NEXT: Size: 0x28
69 # LLVM-NEXT: Owner: AMD
70 # LLVM-NEXT: Data size: 0x17
71 # LLVM-NEXT: Type: NT_AMD_HSA_ISA_VERSION (AMD HSA ISA Version)
72 # LLVM-NEXT: AMD HSA ISA Version: Invalid AMD HSA ISA Version
75 # LLVM-NEXT: NoteSection {
76 # LLVM-NEXT: Name: .note.nt_amd_hsa_isa_version_2
77 # LLVM-NEXT: Offset: 0xF0
78 # 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
86 # LLVM-NEXT: NoteSection {
87 # LLVM-NEXT: Name: .note.nt_amd_hsa_isa_version_3
88 # LLVM-NEXT: Offset: 0x118
89 # LLVM-NEXT: Size: 0x28
91 # LLVM-NEXT: Owner: AMD
92 # LLVM-NEXT: Data size: 0x17
93 # LLVM-NEXT: Type: NT_AMD_HSA_ISA_VERSION (AMD HSA ISA Version)
94 # LLVM-NEXT: AMD HSA ISA Version: Invalid AMD HSA ISA Version
97 # LLVM-NEXT: NoteSection {
98 # LLVM-NEXT: Name: .note.nt_amd_pal_metadata
99 # LLVM-NEXT: Offset: 0x140
100 # LLVM-NEXT: Size: 0x14
102 # LLVM-NEXT: Owner: AMD
103 # LLVM-NEXT: Data size: 0x4
104 # LLVM-NEXT: Type: NT_AMD_PAL_METADATA (AMD PAL Metadata)
105 # LLVM-NEXT: AMD PAL Metadata: Invalid AMD PAL Metadata
110 # GNU: Displaying notes found in: .note.nt_amd_hsa_code_object_version_0
111 # GNU-NEXT: Owner Data size Description
112 # GNU-NEXT: AMD 0x00000004 NT_AMD_HSA_CODE_OBJECT_VERSION (AMD HSA Code Object Version)
113 # GNU-NEXT: AMD HSA Code Object Version:
114 # GNU-NEXT: Invalid AMD HSA Code Object Version
116 # GNU-NEXT: Displaying notes found in: .note.nt_amd_hsa_code_object_version_1
117 # GNU-NEXT: Owner Data size Description
118 # GNU-NEXT: AMD 0x0000000c NT_AMD_HSA_CODE_OBJECT_VERSION (AMD HSA Code Object Version)
119 # GNU-NEXT: AMD HSA Code Object Version:
120 # GNU-NEXT: Invalid AMD HSA Code Object Version
122 # GNU-NEXT: Displaying notes found in: .note.nt_amd_hsa_hsail_0
123 # GNU-NEXT: Owner Data size Description
124 # GNU-NEXT: AMD 0x0000000a NT_AMD_HSA_HSAIL (AMD HSA HSAIL Properties)
125 # GNU-NEXT: AMD HSA HSAIL Properties:
126 # GNU-NEXT: Invalid AMD HSA HSAIL Properties
128 # GNU-NEXT: Displaying notes found in: .note.nt_amd_hsa_hsail_1
129 # GNU-NEXT: Owner Data size Description
130 # GNU-NEXT: AMD 0x00000014 NT_AMD_HSA_HSAIL (AMD HSA HSAIL Properties)
131 # GNU-NEXT: AMD HSA HSAIL Properties:
132 # GNU-NEXT: Invalid AMD HSA HSAIL Properties
134 # GNU-NEXT: Displaying notes found in: .note.nt_amd_hsa_isa_version_0
135 # GNU-NEXT: Owner Data size Description
136 # GNU-NEXT: AMD 0x00000008 NT_AMD_HSA_ISA_VERSION (AMD HSA ISA Version)
137 # GNU-NEXT: AMD HSA ISA Version:
138 # GNU-NEXT: Invalid AMD HSA ISA Version
140 # GNU-NEXT: Displaying notes found in: .note.nt_amd_hsa_isa_version_1
141 # GNU-NEXT: Owner Data size Description
142 # GNU-NEXT: AMD 0x00000017 NT_AMD_HSA_ISA_VERSION (AMD HSA ISA Version)
143 # GNU-NEXT: AMD HSA ISA Version:
144 # GNU-NEXT: Invalid AMD HSA ISA Version
146 # GNU-NEXT: Displaying notes found in: .note.nt_amd_hsa_isa_version_2
147 # GNU-NEXT: Owner Data size Description
148 # GNU-NEXT: AMD 0x00000017 NT_AMD_HSA_ISA_VERSION (AMD HSA ISA Version)
149 # GNU-NEXT: AMD HSA ISA Version:
150 # GNU-NEXT: Invalid AMD HSA ISA Version
152 # GNU-NEXT: Displaying notes found in: .note.nt_amd_hsa_isa_version_3
153 # GNU-NEXT: Owner Data size Description
154 # GNU-NEXT: AMD 0x00000017 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_pal_metadata
159 # GNU-NEXT: Owner Data size Description
160 # GNU-NEXT: AMD 0x00000004 NT_AMD_PAL_METADATA (AMD PAL Metadata)
161 # GNU-NEXT: AMD PAL Metadata:
162 # GNU-NEXT: Invalid AMD PAL Metadata
170 - Name: .note.nt_amd_hsa_code_object_version_0
174 Type: NT_AMD_HSA_CODE_OBJECT_VERSION
175 ## Desc size is too small (less than sizeof(CodeObjectVersion)).
177 - Name: .note.nt_amd_hsa_code_object_version_1
181 Type: NT_AMD_HSA_CODE_OBJECT_VERSION
182 ## Desc size is too large (more than sizeof(CodeObjectVersion)).
183 Desc: '020000000200000002000000'
184 - Name: .note.nt_amd_hsa_hsail_0
188 Type: NT_AMD_HSA_HSAIL
189 ## Desc size is too small (less than sizeof(HSAILProperties)).
190 Desc: '02000000010000000102'
191 - Name: .note.nt_amd_hsa_hsail_1
195 Type: NT_AMD_HSA_HSAIL
196 ## Desc size is too large (more than sizeof(HSAILProperties)).
197 Desc: '0200000001000000010202000000010200000001'
198 - Name: .note.nt_amd_hsa_isa_version_0
202 Type: NT_AMD_HSA_ISA_VERSION
203 ## Desc size is too small (less than sizeof(IsaVersion)).
204 Desc: '0400070008000000'
205 - Name: .note.nt_amd_hsa_isa_version_1
209 Type: NT_AMD_HSA_ISA_VERSION
210 ## Desc size is too small (less than sizeof(IsaVersion) +
211 ## VendorNameSize + ArchitectureNameSize).
212 Desc: '04000700080000000000000002000000414d4400414d44'
213 - Name: .note.nt_amd_hsa_isa_version_2
217 Type: NT_AMD_HSA_ISA_VERSION
218 ## VendorNameSize is 0.
219 Desc: '00000700080000000000000002000000414d4400414d44'
220 - Name: .note.nt_amd_hsa_isa_version_3
224 Type: NT_AMD_HSA_ISA_VERSION
225 ## ArchitectureNameSize is 0.
226 Desc: '04000000080000000000000002000000414d4400414d44'
227 - Name: .note.nt_amd_pal_metadata
231 Type: NT_AMD_PAL_METADATA
232 ## Desc size is not a multiple of sizeof(PALMetadata).