-
Notifications
You must be signed in to change notification settings - Fork 12.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PAC][clang][ELF] Support PAuth ABI compatibility tag
Emit PAuth ABI compatibility tag values as llvm module flags: - `aarch64-elf-pauthabi-platform` - `aarch64-elf-pauthabi-version`
- Loading branch information
Showing
2 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// RUN: %clang -target aarch64-linux -S -emit-llvm -o - \ | ||
// RUN: -fptrauth-intrinsics \ | ||
// RUN: -fptrauth-calls \ | ||
// RUN: -fptrauth-returns \ | ||
// RUN: -fptrauth-auth-traps \ | ||
// RUN: -fptrauth-vtable-pointer-address-discrimination \ | ||
// RUN: -fptrauth-vtable-pointer-type-discrimination \ | ||
// RUN: -fptrauth-init-fini %s | \ | ||
// RUN: FileCheck %s --check-prefix=ALL | ||
|
||
// RUN: %clang -target aarch64-linux -S -emit-llvm -o - \ | ||
// RUN: -fptrauth-intrinsics %s | FileCheck %s --check-prefix=INTRIN | ||
|
||
// RUN: %clang -target aarch64-linux -S -emit-llvm -o - \ | ||
// RUN: -fptrauth-calls %s | FileCheck %s --check-prefix=CALL | ||
|
||
// RUN: %clang -target aarch64-linux -S -emit-llvm -o - \ | ||
// RUN: -fptrauth-returns %s | FileCheck %s --check-prefix=RET | ||
|
||
// RUN: %clang -target aarch64-linux -S -emit-llvm -o - \ | ||
// RUN: -fptrauth-auth-traps %s | FileCheck %s --check-prefix=TRAP | ||
|
||
// RUN: %clang -target aarch64-linux -S -emit-llvm -o - \ | ||
// RUN: -fptrauth-calls -fptrauth-vtable-pointer-address-discrimination %s | \ | ||
// RUN: FileCheck %s --check-prefix=VPTRADDR | ||
|
||
// RUN: %clang -target aarch64-linux -S -emit-llvm -o - \ | ||
// RUN: -fptrauth-calls -fptrauth-vtable-pointer-type-discrimination %s | \ | ||
// RUN: FileCheck %s --check-prefix=VPTRTYPE | ||
|
||
// RUN: %clang -target aarch64-linux -S -emit-llvm -o - \ | ||
// RUN: -fptrauth-calls -fptrauth-init-fini %s | \ | ||
// RUN: FileCheck %s --check-prefix=INITFINI | ||
|
||
// REQUIRES: aarch64-registered-target | ||
|
||
// ALL: !{i32 1, !"aarch64-elf-pauthabi-platform", i32 268435458} | ||
// ALL: !{i32 1, !"aarch64-elf-pauthabi-version", i32 127} | ||
|
||
// INTRIN: !{i32 1, !"aarch64-elf-pauthabi-platform", i32 268435458} | ||
// INTRIN: !{i32 1, !"aarch64-elf-pauthabi-version", i32 1} | ||
|
||
// CALL: !{i32 1, !"aarch64-elf-pauthabi-platform", i32 268435458} | ||
// CALL: !{i32 1, !"aarch64-elf-pauthabi-version", i32 2} | ||
|
||
// RET: !{i32 1, !"aarch64-elf-pauthabi-platform", i32 268435458} | ||
// RET: !{i32 1, !"aarch64-elf-pauthabi-version", i32 4} | ||
|
||
// TRAP: !{i32 1, !"aarch64-elf-pauthabi-platform", i32 268435458} | ||
// TRAP: !{i32 1, !"aarch64-elf-pauthabi-version", i32 8} | ||
|
||
// VPTRADDR: !{i32 1, !"aarch64-elf-pauthabi-platform", i32 268435458} | ||
// VPTRADDR: !{i32 1, !"aarch64-elf-pauthabi-version", i32 18} | ||
|
||
// VPTRTYPE: !{i32 1, !"aarch64-elf-pauthabi-platform", i32 268435458} | ||
// VPTRTYPE: !{i32 1, !"aarch64-elf-pauthabi-version", i32 34} | ||
|
||
// INITFINI: !{i32 1, !"aarch64-elf-pauthabi-platform", i32 268435458} | ||
// INITFINI: !{i32 1, !"aarch64-elf-pauthabi-version", i32 66} | ||
|
||
void foo() {} |