
This defines a new kind of IR Constant that represents a ptrauth signed pointer, as used in AArch64 PAuth. It allows representing most kinds of signed pointer constants used thus far in the llvm ptrauth implementations, notably those used in the Darwin and ELF ABIs being implemented for c/c++. These signed pointer constants are then lowered to ELF/MachO relocations. These can be simply thought of as a constant `llvm.ptrauth.sign`, with the interesting addition of discriminator computation: the `ptrauth` constant can also represent a combined blend, when both address and integer discriminator operands are used. Both operands are otherwise optional, with default values 0/null.
7 lines
205 B
LLVM
7 lines
205 B
LLVM
; RUN: not llvm-as < %s 2>&1 | FileCheck %s
|
|
|
|
@var = global i32 0
|
|
|
|
; CHECK: error: constant ptrauth address discriminator must be a pointer
|
|
@auth_var = global ptr ptrauth (ptr @var, i32 2, i64 65535, i8 0)
|