[PATCH] D93954: ELF: Teach the linker about the 'B' augmentation string character.
Peter Collingbourne via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 30 23:10:33 PST 2020
pcc created this revision.
pcc added reviewers: MaskRay, psmith.
Herald added subscribers: arichardson, emaste.
Herald added a reviewer: espindola.
pcc requested review of this revision.
Herald added a project: LLVM.
This character indicates that when return pointer authentication is
being used, the function signs the return address using the B key.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D93954
Files:
lld/ELF/EhFrame.cpp
lld/test/ELF/cfi-b-key-frame.s
Index: lld/test/ELF/cfi-b-key-frame.s
===================================================================
--- /dev/null
+++ lld/test/ELF/cfi-b-key-frame.s
@@ -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
Index: lld/ELF/EhFrame.cpp
===================================================================
--- lld/ELF/EhFrame.cpp
+++ lld/ELF/EhFrame.cpp
@@ -194,7 +194,7 @@
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 @@
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;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D93954.314172.patch
Type: text/x-patch
Size: 1024 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201231/48ba4a81/attachment.bin>
More information about the llvm-commits
mailing list