brintos

brintos / llvm-project-archived public Read only

0
0
Text · 13.2 KiB · aaf28ed Raw
281 lines · plain
1# RUN: rm -rf %t && split-file %s %t && cd %t2 3#--- gnu-42-1.s4.section ".note.gnu.property", "a"5  .long 4           // Name length is always 4 ("GNU")6  .long end - begin // Data length7  .long 5           // Type: NT_GNU_PROPERTY_TYPE_08  .asciz "GNU"      // Name9  .p2align 310begin:11  # PAuth ABI property note12  .long 0xc0000001  // Type: GNU_PROPERTY_AARCH64_FEATURE_PAUTH13  .long 16          // Data size14  .quad 42          // PAuth ABI platform15  .quad 1           // PAuth ABI version16  .p2align 3        // Align to 8 byte for 64 bit17end:18 19# RUN: llvm-mc -filetype=obj -triple aarch64-linux-gnu gnu-42-1.s -o gnu-42-1.o20# RUN: llvm-readelf --notes gnu-42-1.o | \21# RUN:   FileCheck --check-prefix=ELF -DPLATFORM="0x2a (unknown)" -DVERSION=0x1 %s22# RUN: llvm-readobj --notes gnu-42-1.o | \23# RUN:   FileCheck --check-prefix=OBJ -DPLATFORM="0x2a (unknown)" -DVERSION=0x1 %s24 25# ELF: Displaying notes found in: .note.gnu.property26# ELF-NEXT:   Owner                 Data size	Description27# ELF-NEXT:   GNU                   0x00000018	NT_GNU_PROPERTY_TYPE_0 (property note)28# ELF-NEXT:   AArch64 PAuth ABI core info: platform [[PLATFORM]], version [[VERSION]]29 30# OBJ:      NoteSections [31# OBJ-NEXT:   NoteSection {32# OBJ-NEXT:     Name: .note.gnu.property33# OBJ-NEXT:     Offset: 0x4034# OBJ-NEXT:     Size: 0x2835# OBJ-NEXT:     Notes [36# OBJ-NEXT:     {37# OBJ-NEXT:       Owner: GNU38# OBJ-NEXT:       Data size: 0x1839# OBJ-NEXT:       Type: NT_GNU_PROPERTY_TYPE_0 (property note)40# OBJ-NEXT:       Property [41# OBJ-NEXT:         AArch64 PAuth ABI core info: platform [[PLATFORM]], version [[VERSION]]42# OBJ-NEXT:       ]43# OBJ-NEXT:     }44# OBJ-NEXT:    ]45# OBJ-NEXT:   }46# OBJ-NEXT: ]47 48#--- gnu-0-0.s49.section ".note.gnu.property", "a"50  .long 4           // Name length is always 4 ("GNU")51  .long end - begin // Data length52  .long 5           // Type: NT_GNU_PROPERTY_TYPE_053  .asciz "GNU"      // Name54  .p2align 355begin:56  # PAuth ABI property note57  .long 0xc0000001  // Type: GNU_PROPERTY_AARCH64_FEATURE_PAUTH58  .long 16          // Data size59  .quad 0           // PAuth ABI platform60  .quad 0           // PAuth ABI version61  .p2align 3        // Align to 8 byte for 64 bit62end:63 64# RUN: llvm-mc -filetype=obj -triple aarch64-linux-gnu gnu-0-0.s -o gnu-0-0.o65# RUN: llvm-readelf --notes gnu-0-0.o | \66# RUN:   FileCheck --check-prefix=ELF -DPLATFORM="0x0 (invalid)" -DVERSION=0x0 %s67# RUN: llvm-readobj --notes gnu-0-0.o | \68# RUN:   FileCheck --check-prefix=OBJ -DPLATFORM="0x0 (invalid)" -DVERSION=0x0 %s69 70#--- gnu-1-0.s71.section ".note.gnu.property", "a"72  .long 4           // Name length is always 4 ("GNU")73  .long end - begin // Data length74  .long 5           // Type: NT_GNU_PROPERTY_TYPE_075  .asciz "GNU"      // Name76  .p2align 377begin:78  # PAuth ABI property note79  .long 0xc0000001  // Type: GNU_PROPERTY_AARCH64_FEATURE_PAUTH80  .long 16          // Data size81  .quad 1           // PAuth ABI platform82  .quad 0           // PAuth ABI version83  .p2align 3        // Align to 8 byte for 64 bit84end:85 86# RUN: llvm-mc -filetype=obj -triple aarch64-linux-gnu gnu-1-0.s -o gnu-1-0.o87# RUN: llvm-readelf --notes gnu-1-0.o | \88# RUN:   FileCheck --check-prefix=ELF -DPLATFORM="0x1 (baremetal)" -DVERSION=0x0 %s89# RUN: llvm-readobj --notes gnu-1-0.o | \90# RUN:   FileCheck --check-prefix=OBJ -DPLATFORM="0x1 (baremetal)" -DVERSION=0x0 %s91 92#--- gnu-0x10000002-0.s93.section ".note.gnu.property", "a"94  .long 4           // Name length is always 4 ("GNU")95  .long end - begin // Data length96  .long 5           // Type: NT_GNU_PROPERTY_TYPE_097  .asciz "GNU"      // Name98  .p2align 399begin:100  # PAuth ABI property note101  .long 0xc0000001  // Type: GNU_PROPERTY_AARCH64_FEATURE_PAUTH102  .long 16          // Data size103  .quad 0x10000002  // PAuth ABI platform104  .quad 0           // PAuth ABI version105  .p2align 3        // Align to 8 byte for 64 bit106end:107 108# RUN: llvm-mc -filetype=obj -triple aarch64-linux-gnu gnu-0x10000002-0.s -o gnu-0x10000002-0.o109# RUN: llvm-readelf --notes gnu-0x10000002-0.o | \110# RUN:   FileCheck --check-prefix=ELF -DPLATFORM="0x10000002 (llvm_linux)" \111# RUN:   -DVERSION="0x0 (!PointerAuthIntrinsics, !PointerAuthCalls, !PointerAuthReturns, !PointerAuthAuthTraps, !PointerAuthVTPtrAddressDiscrimination, !PointerAuthVTPtrTypeDiscrimination, !PointerAuthInitFini, !PointerAuthInitFiniAddressDiscrimination, !PointerAuthELFGOT, !PointerAuthIndirectGotos, !PointerAuthTypeInfoVTPtrDiscrimination, !PointerAuthFPtrTypeDiscrimination)" %s112# RUN: llvm-readobj --notes gnu-0x10000002-0.o | \113# RUN:   FileCheck --check-prefix=OBJ -DPLATFORM="0x10000002 (llvm_linux)" \114# RUN:   -DVERSION="0x0 (!PointerAuthIntrinsics, !PointerAuthCalls, !PointerAuthReturns, !PointerAuthAuthTraps, !PointerAuthVTPtrAddressDiscrimination, !PointerAuthVTPtrTypeDiscrimination, !PointerAuthInitFini, !PointerAuthInitFiniAddressDiscrimination, !PointerAuthELFGOT, !PointerAuthIndirectGotos, !PointerAuthTypeInfoVTPtrDiscrimination, !PointerAuthFPtrTypeDiscrimination)" %s115 116#--- gnu-0x10000002-1365.s117.section ".note.gnu.property", "a"118  .long 4           // Name length is always 4 ("GNU")119  .long end - begin // Data length120  .long 5           // Type: NT_GNU_PROPERTY_TYPE_0121  .asciz "GNU"      // Name122  .p2align 3123begin:124  # PAuth ABI property note125  .long 0xc0000001  // Type: GNU_PROPERTY_AARCH64_FEATURE_PAUTH126  .long 16          // Data size127  .quad 0x10000002  // PAuth ABI platform128  .quad 1365        // PAuth ABI version129  .p2align 3        // Align to 8 byte for 64 bit130end:131 132# RUN: llvm-mc -filetype=obj -triple aarch64-linux-gnu gnu-0x10000002-1365.s -o gnu-0x10000002-1365.o133# RUN: llvm-readelf --notes gnu-0x10000002-1365.o | \134# RUN:   FileCheck --check-prefix=ELF -DPLATFORM="0x10000002 (llvm_linux)" \135# RUN:   -DVERSION="0x555 (PointerAuthIntrinsics, !PointerAuthCalls, PointerAuthReturns, !PointerAuthAuthTraps, PointerAuthVTPtrAddressDiscrimination, !PointerAuthVTPtrTypeDiscrimination, PointerAuthInitFini, !PointerAuthInitFiniAddressDiscrimination, PointerAuthELFGOT, !PointerAuthIndirectGotos, PointerAuthTypeInfoVTPtrDiscrimination, !PointerAuthFPtrTypeDiscrimination)" %s136# RUN: llvm-readobj --notes gnu-0x10000002-1365.o | \137# RUN:   FileCheck --check-prefix=OBJ -DPLATFORM="0x10000002 (llvm_linux)" \138# RUN:   -DVERSION="0x555 (PointerAuthIntrinsics, !PointerAuthCalls, PointerAuthReturns, !PointerAuthAuthTraps, PointerAuthVTPtrAddressDiscrimination, !PointerAuthVTPtrTypeDiscrimination, PointerAuthInitFini, !PointerAuthInitFiniAddressDiscrimination, PointerAuthELFGOT, !PointerAuthIndirectGotos, PointerAuthTypeInfoVTPtrDiscrimination, !PointerAuthFPtrTypeDiscrimination)" %s139 140#--- gnu-0x10000002-2730.s141.section ".note.gnu.property", "a"142  .long 4           // Name length is always 4 ("GNU")143  .long end - begin // Data length144  .long 5           // Type: NT_GNU_PROPERTY_TYPE_0145  .asciz "GNU"      // Name146  .p2align 3147begin:148  # PAuth ABI property note149  .long 0xc0000001  // Type: GNU_PROPERTY_AARCH64_FEATURE_PAUTH150  .long 16          // Data size151  .quad 0x10000002  // PAuth ABI platform152  .quad 2730        // PAuth ABI version153  .p2align 3        // Align to 8 byte for 64 bit154end:155 156# RUN: llvm-mc -filetype=obj -triple aarch64-linux-gnu gnu-0x10000002-2730.s -o gnu-0x10000002-2730.o157# RUN: llvm-readelf --notes gnu-0x10000002-2730.o | \158# RUN:   FileCheck --check-prefix=ELF -DPLATFORM="0x10000002 (llvm_linux)" \159# RUN:   -DVERSION="0xaaa (!PointerAuthIntrinsics, PointerAuthCalls, !PointerAuthReturns, PointerAuthAuthTraps, !PointerAuthVTPtrAddressDiscrimination, PointerAuthVTPtrTypeDiscrimination, !PointerAuthInitFini, PointerAuthInitFiniAddressDiscrimination, !PointerAuthELFGOT, PointerAuthIndirectGotos, !PointerAuthTypeInfoVTPtrDiscrimination, PointerAuthFPtrTypeDiscrimination)" %s160# RUN: llvm-readobj --notes gnu-0x10000002-2730.o | \161# RUN:   FileCheck --check-prefix=OBJ -DPLATFORM="0x10000002 (llvm_linux)" \162# RUN:   -DVERSION="0xaaa (!PointerAuthIntrinsics, PointerAuthCalls, !PointerAuthReturns, PointerAuthAuthTraps, !PointerAuthVTPtrAddressDiscrimination, PointerAuthVTPtrTypeDiscrimination, !PointerAuthInitFini, PointerAuthInitFiniAddressDiscrimination, !PointerAuthELFGOT, PointerAuthIndirectGotos, !PointerAuthTypeInfoVTPtrDiscrimination, PointerAuthFPtrTypeDiscrimination)" %s163 164#--- gnu-0x10000002-4095.s165.section ".note.gnu.property", "a"166  .long 4           // Name length is always 4 ("GNU")167  .long end - begin // Data length168  .long 5           // Type: NT_GNU_PROPERTY_TYPE_0169  .asciz "GNU"      // Name170  .p2align 3171begin:172  # PAuth ABI property note173  .long 0xc0000001  // Type: GNU_PROPERTY_AARCH64_FEATURE_PAUTH174  .long 16          // Data size175  .quad 0x10000002  // PAuth ABI platform176  .quad 4095        // PAuth ABI version177  .p2align 3        // Align to 8 byte for 64 bit178end:179 180# RUN: llvm-mc -filetype=obj -triple aarch64-linux-gnu gnu-0x10000002-4095.s -o gnu-0x10000002-4095.o181# RUN: llvm-readelf --notes gnu-0x10000002-4095.o | \182# RUN:   FileCheck --check-prefix=ELF -DPLATFORM="0x10000002 (llvm_linux)" \183# RUN:   -DVERSION="0xfff (PointerAuthIntrinsics, PointerAuthCalls, PointerAuthReturns, PointerAuthAuthTraps, PointerAuthVTPtrAddressDiscrimination, PointerAuthVTPtrTypeDiscrimination, PointerAuthInitFini, PointerAuthInitFiniAddressDiscrimination, PointerAuthELFGOT, PointerAuthIndirectGotos, PointerAuthTypeInfoVTPtrDiscrimination, PointerAuthFPtrTypeDiscrimination)" %s184# RUN: llvm-readobj --notes gnu-0x10000002-4095.o | \185# RUN:   FileCheck --check-prefix=OBJ -DPLATFORM="0x10000002 (llvm_linux)" \186# RUN:   -DVERSION="0xfff (PointerAuthIntrinsics, PointerAuthCalls, PointerAuthReturns, PointerAuthAuthTraps, PointerAuthVTPtrAddressDiscrimination, PointerAuthVTPtrTypeDiscrimination, PointerAuthInitFini, PointerAuthInitFiniAddressDiscrimination, PointerAuthELFGOT, PointerAuthIndirectGotos, PointerAuthTypeInfoVTPtrDiscrimination, PointerAuthFPtrTypeDiscrimination)" %s187 188#--- gnu-0x10000002-4096.s189.section ".note.gnu.property", "a"190  .long 4           // Name length is always 4 ("GNU")191  .long end - begin // Data length192  .long 5           // Type: NT_GNU_PROPERTY_TYPE_0193  .asciz "GNU"      // Name194  .p2align 3195begin:196  # PAuth ABI property note197  .long 0xc0000001  // Type: GNU_PROPERTY_AARCH64_FEATURE_PAUTH198  .long 16          // Data size199  .quad 0x10000002  // PAuth ABI platform200  .quad 4096        // PAuth ABI version201  .p2align 3        // Align to 8 byte for 64 bit202end:203 204# RUN: llvm-mc -filetype=obj -triple aarch64-linux-gnu gnu-0x10000002-4096.s -o gnu-0x10000002-4096.o205# RUN: llvm-readelf --notes gnu-0x10000002-4096.o | \206# RUN:   FileCheck --check-prefix=ELF -DPLATFORM="0x10000002 (llvm_linux)" -DVERSION="0x1000 (unknown)" %s207# RUN: llvm-readobj --notes gnu-0x10000002-4096.o | \208# RUN:   FileCheck --check-prefix=OBJ -DPLATFORM="0x10000002 (llvm_linux)" -DVERSION="0x1000 (unknown)" %s209 210#--- gnu-short.s211.section ".note.gnu.property", "a"212  .long 4           // Name length is always 4 ("GNU")213  .long end - begin // Data length214  .long 5           // Type: NT_GNU_PROPERTY_TYPE_0215  .asciz "GNU"      // Name216  .p2align 3217begin:218  # PAuth ABI property note219  .long 0xc0000001  // Type: GNU_PROPERTY_AARCH64_FEATURE_PAUTH220  .long 12          // Data size221  .quad 42          // PAuth ABI platform222  .word 1           // PAuth ABI version223  .p2align 3        // Align to 8 byte for 64 bit224end:225 226# RUN: llvm-mc -filetype=obj -triple aarch64-linux-gnu gnu-short.s -o gnu-short.o227# RUN: llvm-readelf --notes gnu-short.o | \228# RUN:   FileCheck --check-prefix=ELF-ERR -DSIZE=28 -DDATASIZE=18 \229# RUN:   -DERR="<corrupted size: expected 16, got 12>" %s230# RUN: llvm-readobj --notes gnu-short.o | \231# RUN:   FileCheck --check-prefix=OBJ-ERR -DSIZE=28 -DDATASIZE=18 \232# RUN:   -DERR="<corrupted size: expected 16, got 12>" %s233 234# ELF-ERR: Displaying notes found in: .note.gnu.property235# ELF-ERR-NEXT:   Owner                 Data size	Description236# ELF-ERR-NEXT:   GNU                   0x000000[[DATASIZE]]	NT_GNU_PROPERTY_TYPE_0 (property note)237# ELF-ERR-NEXT:   AArch64 PAuth ABI core info: [[ERR]]238 239# OBJ-ERR:      NoteSections [240# OBJ-ERR-NEXT:   NoteSection {241# OBJ-ERR-NEXT:     Name: .note.gnu.property242# OBJ-ERR-NEXT:     Offset: 0x40243# OBJ-ERR-NEXT:     Size: 0x[[SIZE]]244# OBJ-ERR-NEXT:     Notes [245# OBJ-ERR-NEXT:     {246# OBJ-ERR-NEXT:       Owner: GNU247# OBJ-ERR-NEXT:       Data size: 0x[[DATASIZE]]248# OBJ-ERR-NEXT:       Type: NT_GNU_PROPERTY_TYPE_0 (property note)249# OBJ-ERR-NEXT:       Property [250# OBJ-ERR-NEXT:         AArch64 PAuth ABI core info: [[ERR]]251# OBJ-ERR-NEXT:       ]252# OBJ-ERR-NEXT:     }253# OBJ-ERR-NEXT:    ]254# OBJ-ERR-NEXT:   }255# OBJ-ERR-NEXT: ]256 257#--- gnu-long.s258.section ".note.gnu.property", "a"259  .long 4           // Name length is always 4 ("GNU")260  .long end - begin // Data length261  .long 5           // Type: NT_GNU_PROPERTY_TYPE_0262  .asciz "GNU"      // Name263  .p2align 3264begin:265  # PAuth ABI property note266  .long 0xc0000001  // Type: GNU_PROPERTY_AARCH64_FEATURE_PAUTH267  .long 24          // Data size268  .quad 42          // PAuth ABI platform269  .quad 1           // PAuth ABI version270  .quad 0x0123456789ABCDEF271  .p2align 3        // Align to 8 byte for 64 bit272end:273 274# RUN: llvm-mc -filetype=obj -triple aarch64-linux-gnu gnu-long.s -o gnu-long.o275# RUN: llvm-readelf --notes gnu-long.o | \276# RUN:   FileCheck --check-prefix=ELF-ERR -DSIZE=30 -DDATASIZE=20 \277# RUN:   -DERR="<corrupted size: expected 16, got 24>" %s278# RUN: llvm-readobj --notes gnu-long.o | \279# RUN:   FileCheck --check-prefix=OBJ-ERR -DSIZE=30 -DDATASIZE=20 \280# RUN:   -DERR="<corrupted size: expected 16, got 24>" %s281