[PATCH] D127148: [ELF] Support 'G' in lld and dwarf parser
Florian Mayer via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 6 13:40:35 PDT 2022
fmayer created this revision.
Herald added subscribers: hiraditya, arichardson, emaste.
Herald added a reviewer: MaskRay.
Herald added a project: All.
fmayer requested review of this revision.
Herald added subscribers: llvm-commits, StephenFan.
Herald added a project: LLVM.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D127148
Files:
lld/ELF/EhFrame.cpp
lld/test/ELF/stack-tagging-cfi.s
llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp
Index: llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp
===================================================================
--- llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp
+++ llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp
@@ -1138,6 +1138,10 @@
// B-Key is used for signing functions associated with this
// augmentation string
break;
+ // This stack frame contains MTE tagged data, so needs to be
+ // untagged on unwind.
+ case 'G':
+ break;
}
}
Index: lld/test/ELF/stack-tagging-cfi.s
===================================================================
--- /dev/null
+++ lld/test/ELF/stack-tagging-cfi.s
@@ -0,0 +1,24 @@
+# REQUIRES: aarch64
+
+# RUN: llvm-mc -filetype=obj -triple aarch64-generic-linux -mattr=+mte %s -o %t.o
+# RUN: ld.lld --eh-frame-hdr %t.o -o %t
+# RUN: llvm-objdump -s --dwarf=frames %t | FileCheck %s
+
+# CHECK: Augmentation: "zRG"
+
+ .text
+ .globl WithUnwind // -- Begin function WithUnwind
+ .p2align 2
+ .type WithUnwind, at function
+WithUnwind: // @WithUnwind
+ .cfi_startproc
+// %bb.0: // %entry
+ .cfi_mte_tagged_frame
+ ret
+.Lfunc_end0:
+ .size WithUnwind, .Lfunc_end0-WithUnwind
+ .cfi_endproc
+ // -- End function
+ .globl NoUnwind // -- Begin function NoUnwind
+ .p2align 2
+ .type NoUnwind, at function
Index: lld/ELF/EhFrame.cpp
===================================================================
--- lld/ELF/EhFrame.cpp
+++ lld/ELF/EhFrame.cpp
@@ -171,7 +171,7 @@
readByte();
else if (c == 'P')
skipAugP();
- else if (c != 'B' && c != 'S')
+ else if (c != 'B' && c != 'S' && c != 'G')
failOn(aug.data(), "unknown .eh_frame augmentation string: " + aug);
}
return DW_EH_PE_absptr;
@@ -188,7 +188,7 @@
skipAugP();
else if (c == 'R')
readByte();
- else if (c != 'B' && c != 'S')
+ else if (c != 'B' && c != 'S' && c != 'G')
failOn(aug.data(), "unknown .eh_frame augmentation string: " + aug);
}
return false;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D127148.434594.patch
Type: text/x-patch
Size: 2171 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220606/69d32543/attachment.bin>
More information about the llvm-commits
mailing list