xref: /llvm-project/llvm/test/tools/llvm-readobj/ELF/note-generic.s (revision ab930ee7cad8b8bf7968bb8d0c0d72524e2313c4)
1// REQUIRES: x86-registered-target
2// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o %t.o
3
4// RUN: llvm-readobj --notes %t.o | FileCheck %s --check-prefix=LLVM --strict-whitespace
5// RUN: llvm-readelf --notes %t.o | FileCheck %s --check-prefix=GNU --strict-whitespace
6
7// GNU:      Displaying notes found in: .note.version{{$}}
8// GNU-NEXT:   Owner                Data size 	Description
9// GNU-NEXT:   XYZ                  0x00000000	NT_VERSION (version)
10// GNU-EMPTY:
11// GNU-NEXT: Displaying notes found in: .note.arch{{$}}
12// GNU-NEXT:   Owner                Data size 	Description
13// GNU-NEXT:   XYZ                  0x00000000	NT_ARCH (architecture)
14// GNU-EMPTY:
15// GNU-NEXT: Displaying notes found in: .note.open{{$}}
16// GNU-NEXT:   Owner                Data size 	Description
17// GNU-NEXT:   XYZ                  0x00000000	OPEN
18// GNU-EMPTY:
19// GNU-NEXT: Displaying notes found in: .note.func{{$}}
20// GNU-NEXT:   Owner                Data size 	Description
21// GNU-NEXT:   XYZ                  0x00000000	func
22
23// LLVM:      NoteSections [
24// LLVM-NEXT:   NoteSection {
25// LLVM-NEXT:     Name: .note.version
26// LLVM-NEXT:     Offset: 0x40
27// LLVM-NEXT:     Size: 0x10
28// LLVM-NEXT:	  Notes [
29// LLVM-NEXT:		{
30// LLVM-NEXT:			Owner: XYZ
31// LLVM-NEXT:			Data size: 0x0
32// LLVM-NEXT:			Type: NT_VERSION (version)
33// LLVM-NEXT:		}
34// LLVM-NEXT:	  ]
35// LLVM-NEXT:   }
36// LLVM-NEXT:   NoteSection {
37// LLVM-NEXT:     Name: .note.arch
38// LLVM-NEXT:     Offset: 0x50
39// LLVM-NEXT:     Size: 0x10
40// LLVM-NEXT:	  Notes [
41// LLVM-NEXT:		{
42// LLVM-NEXT:			Owner: XYZ
43// LLVM-NEXT:			Data size: 0x0
44// LLVM-NEXT:			Type: NT_ARCH (architecture)
45// LLVM-NEXT:		}
46// LLVM-NEXT:	  ]
47// LLVM-NEXT:   }
48// LLVM-NEXT:   NoteSection {
49// LLVM-NEXT:     Name: .note.open
50// LLVM-NEXT:     Offset: 0x60
51// LLVM-NEXT:     Size: 0x10
52// LLVM-NEXT:	  Notes [
53// LLVM-NEXT:		{
54// LLVM-NEXT:			Owner: XYZ
55// LLVM-NEXT:			Data size: 0x0
56// LLVM-NEXT:			Type: OPEN
57// LLVM-NEXT:		}
58// LLVM-NEXT:	  ]
59// LLVM-NEXT:   }
60// LLVM-NEXT:   NoteSection {
61// LLVM-NEXT:     Name: .note.func
62// LLVM-NEXT:     Offset: 0x70
63// LLVM-NEXT:     Size: 0x10
64// LLVM-NEXT:	  Notes [
65// LLVM-NEXT:		{
66// LLVM-NEXT:			Owner: XYZ
67// LLVM-NEXT:			Data size: 0x0
68// LLVM-NEXT:			Type: func
69// LLVM-NEXT:		}
70// LLVM-NEXT:	 ]
71// LLVM-NEXT:   }
72// LLVM-NEXT: ]
73
74.section ".note.version", "a"
75	.align 4
76	.long 4 /* namesz */
77	.long 0 /* descsz */
78	.long 1 /* type = NT_VERSION */
79	.asciz "XYZ"
80.section ".note.arch", "a"
81	.align 4
82	.long 4 /* namesz */
83	.long 0 /* descsz */
84	.long 2 /* type = NT_ARCH*/
85	.asciz "XYZ"
86.section ".note.open", "a"
87	.align 4
88	.long 4 /* namesz */
89	.long 0 /* descsz */
90	.long 0x100 /* type = NT_GNU_BUILD_ATTRIBUTE_OPEN*/
91	.asciz "XYZ"
92.section ".note.func", "a"
93	.align 4
94	.long 4 /* namesz */
95	.long 0 /* descsz */
96	.long 0x101 /* type = NT_GNU_BUILD_ATTRIBUTE_FUNC*/
97	.asciz "XYZ"
98