1// RUN: llvm-mc -filetype=obj -triple aarch64-linux-gnu %s -o %t
2// RUN: llvm-readelf --notes %t | FileCheck %s --check-prefix=GNU
3// RUN: llvm-readobj --notes %t | FileCheck %s --check-prefix=LLVM
4
5// GNU: Displaying notes found in: .note.gnu.property
6// GNU-NEXT:   Owner                 Data size	Description
7// GNU-NEXT:   GNU                   0x00000010	NT_GNU_PROPERTY_TYPE_0 (property note)
8// GNU-NEXT:     Properties:    aarch64 feature: BTI, PAC
9
10// LLVM:      Notes [
11// LLVM-NEXT:   NoteSection {
12// LLVM-NEXT:     Name: .note.gnu.property
13// LLVM-NEXT:     Offset: 0x40
14// LLVM-NEXT:     Size: 0x20
15// LLVM-NEXT:     Note {
16// LLVM-NEXT:       Owner: GNU
17// LLVM-NEXT:       Data size: 0x10
18// LLVM-NEXT:       Type: NT_GNU_PROPERTY_TYPE_0 (property note)
19// LLVM-NEXT:       Property [
20// LLVM-NEXT:         aarch64 feature: BTI, PAC
21// LLVM-NEXT:       ]
22// LLVM-NEXT:     }
23// LLVM-NEXT:   }
24// LLVM-NEXT: ]
25
26.section ".note.gnu.property", "a"
27.align 4
28  .long 4           /* Name length is always 4 ("GNU") */
29  .long end - begin /* Data length */
30  .long 5           /* Type: NT_GNU_PROPERTY_TYPE_0 */
31  .asciz "GNU"      /* Name */
32  .p2align 3
33begin:
34  /* BTI and PAC property note */
35  .long 0xc0000000  /* Type: GNU_PROPERTY_AARCH64_FEATURE_1_AND */
36  .long 4           /* Data size */
37  .long 3           /* BTI and PAC */
38  .p2align 3        /* Align to 8 byte for 64 bit */
39end:
40