ELF: Teach the linker about the 'B' augmentation string character.

This character indicates that when return pointer authentication is
being used, the function signs the return address using the B key.

Differential Revision: https://reviews.llvm.org/D93954
This commit is contained in:
Peter Collingbourne 2020-12-30 22:11:45 -08:00
parent cdfd4c5c1a
commit aed84542d5
2 changed files with 11 additions and 2 deletions

View File

@ -194,7 +194,7 @@ uint8_t EhReader::getFdeEncoding() {
readByte();
else if (c == 'P')
skipAugP();
else if (c != 'S')
else if (c != 'B' && c != 'S')
failOn(aug.data(), "unknown .eh_frame augmentation string: " + aug);
}
return DW_EH_PE_absptr;
@ -211,7 +211,7 @@ bool EhReader::hasLSDA() {
skipAugP();
else if (c == 'R')
readByte();
else if (c != 'S')
else if (c != 'B' && c != 'S')
failOn(aug.data(), "unknown .eh_frame augmentation string: " + aug);
}
return false;

View File

@ -0,0 +1,9 @@
// REQUIRES: aarch64
// RUN: llvm-mc -filetype=obj -triple aarch64-arm-none-eabi %s -o %t.o
// RUN: ld.lld %t.o -o %t --icf=all --eh-frame-hdr
.globl _start
_start:
.cfi_startproc
.cfi_b_key_frame
.cfi_endproc