1 ## Test that note values are interpreted correctly for FreeBSD executables.
2 # RUN: yaml2obj %s -o %t.o
3 # RUN: llvm-readelf --notes %t.o | FileCheck %s --check-prefixes=GNU --strict-whitespace
4 # RUN: llvm-readobj --notes %t.o | FileCheck %s --check-prefix=LLVM --strict-whitespace
15 AddressAlign: 0x0000000000000004
19 Type: NT_FREEBSD_ABI_TAG
21 Desc: '6C' # Invalid data (should be 4 bytes)
22 Type: NT_FREEBSD_ABI_TAG
24 Desc: '61617263683634'
25 Type: NT_FREEBSD_ARCH_TAG
28 Type: NT_FREEBSD_FEATURE_CTL
30 Desc: '00' # Invalid data (should be 4 bytes)
31 Type: NT_FREEBSD_FEATURE_CTL
34 Type: NT_FREEBSD_NOINIT_TAG
40 Type: NT_FREEBSD_PROCSTAT_RLIMIT # Only valid for coredumps.
42 # GNU: Displaying notes found in: .note.tag
43 # GNU-NEXT: Owner Data size Description
44 # GNU-NEXT: FreeBSD 0x00000004 NT_FREEBSD_ABI_TAG (ABI version tag)
45 # GNU-NEXT: ABI tag: 1300076
46 # GNU-NEXT: FreeBSD 0x00000001 NT_FREEBSD_ABI_TAG (ABI version tag)
47 # GNU-NEXT: description data: 6c
48 # GNU-NEXT: FreeBSD 0x00000007 NT_FREEBSD_ARCH_TAG (architecture tag)
49 # GNU-NEXT: Arch tag: aarch64
50 # GNU-NEXT: FreeBSD 0x00000004 NT_FREEBSD_FEATURE_CTL (FreeBSD feature control)
51 # GNU-NEXT: Feature flags: ASLR_DISABLE PROTMAX_DISABLE STKGAP_DISABLE WXNEEDED LA48 ASG_DISABLE (0xFFFFFFFF)
52 # GNU-NEXT: FreeBSD 0x00000001 NT_FREEBSD_FEATURE_CTL (FreeBSD feature control)
53 # GNU-NEXT: description data: 00
54 # GNU-NEXT: FreeBSD 0x00000004 NT_FREEBSD_NOINIT_TAG (no .init tag)
55 # GNU-NEXT: description data: 00 00 00 00
56 # GNU-NEXT: FreeBSD 0x00000006 Unknown note type: (0x00abcdef)
57 # GNU-NEXT: description data: 61 62 63 64 65 66
58 ## NT_FREEBSD_PROCSTAT_RLIMIT is only a valid type for coredumps and should therefore not be decoded.
59 ## Note: Binutils prints NT_PROCSTAT_RLIMIT, but this seems incorrect
60 # GNU-NEXT: FreeBSD 0x00000006 Unknown note type: (0x0000000d)
61 # GNU-NEXT: description data: 61 62 63 64 65 66
64 # LLVM: NoteSections [
65 # LLVM-NEXT: NoteSection {
66 # LLVM-NEXT: Name: .note.tag
67 # LLVM-NEXT: Offset: 0x40
68 # LLVM-NEXT: Size: 0xCC
71 # LLVM-NEXT: Owner: FreeBSD
72 # LLVM-NEXT: Data size: 0x4
73 # LLVM-NEXT: Type: NT_FREEBSD_ABI_TAG (ABI version tag)
74 # LLVM-NEXT: ABI tag: 1300076
77 # LLVM-NEXT: Owner: FreeBSD
78 # LLVM-NEXT: Data size: 0x1
79 # LLVM-NEXT: Type: NT_FREEBSD_ABI_TAG (ABI version tag)
80 # LLVM-NEXT: Description data (
81 # LLVM-NEXT: 0000: 6C |l|
85 # LLVM-NEXT: Owner: FreeBSD
86 # LLVM-NEXT: Data size: 0x7
87 # LLVM-NEXT: Type: NT_FREEBSD_ARCH_TAG (architecture tag)
88 # LLVM-NEXT: Arch tag: aarch64
91 # LLVM-NEXT: Owner: FreeBSD
92 # LLVM-NEXT: Data size: 0x4
93 # LLVM-NEXT: Type: NT_FREEBSD_FEATURE_CTL (FreeBSD feature control)
94 # LLVM-NEXT: Feature flags: ASLR_DISABLE PROTMAX_DISABLE STKGAP_DISABLE WXNEEDED LA48 ASG_DISABLE (0xFFFFFFFF)
97 # LLVM-NEXT: Owner: FreeBSD
98 # LLVM-NEXT: Data size: 0x1
99 # LLVM-NEXT: Type: NT_FREEBSD_FEATURE_CTL (FreeBSD feature control)
100 # LLVM-NEXT: Description data (
101 # LLVM-NEXT: 0000: 00 |.|
105 # LLVM-NEXT: Owner: FreeBSD
106 # LLVM-NEXT: Data size: 0x4
107 # LLVM-NEXT: Type: NT_FREEBSD_NOINIT_TAG (no .init tag)
108 # LLVM-NEXT: Description data (
109 # LLVM-NEXT: 0000: 00000000 |....|
113 # LLVM-NEXT: Owner: FreeBSD
114 # LLVM-NEXT: Data size: 0x6
115 # LLVM-NEXT: Type: Unknown (0x00abcdef)
116 # LLVM-NEXT: Description data (
117 # LLVM-NEXT: 0000: 61626364 6566 |abcdef|
121 # LLVM-NEXT: Owner: FreeBSD
122 # LLVM-NEXT: Data size: 0x6
123 # LLVM-NEXT: Type: Unknown (0x0000000d)
124 # LLVM-NEXT: Description data (
125 # LLVM-NEXT: 0000: 61626364 6566 |abcdef|