[llvm-branch-commits] [lld] aed8454 - ELF: Teach the linker about the 'B' augmentation string character.

Peter Collingbourne via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Jan 5 19:56:19 PST 2021


Author: Peter Collingbourne
Date: 2021-01-05T19:51:11-08:00
New Revision: aed84542d5a05b415a9a7f54494107aea8bd7e89

URL: https://github.com/llvm/llvm-project/commit/aed84542d5a05b415a9a7f54494107aea8bd7e89
DIFF: https://github.com/llvm/llvm-project/commit/aed84542d5a05b415a9a7f54494107aea8bd7e89.diff

LOG: 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

Added: 
    lld/test/ELF/eh-frame-cfi-b-key.s

Modified: 
    lld/ELF/EhFrame.cpp

Removed: 
    


################################################################################
diff  --git a/lld/ELF/EhFrame.cpp b/lld/ELF/EhFrame.cpp
index 13f0484ff9e4..578c640f0214 100644
--- a/lld/ELF/EhFrame.cpp
+++ b/lld/ELF/EhFrame.cpp
@@ -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;

diff  --git a/lld/test/ELF/eh-frame-cfi-b-key.s b/lld/test/ELF/eh-frame-cfi-b-key.s
new file mode 100644
index 000000000000..406674e8b5c8
--- /dev/null
+++ b/lld/test/ELF/eh-frame-cfi-b-key.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


        


More information about the llvm-branch-commits mailing list