[PATCH] D110609: [CodeGen] Fix wrapping personality symbol on ARM
Shoaib Meenai via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 28 13:01:00 PDT 2021
smeenai updated this revision to Diff 375676.
smeenai added a comment.
Add comment to test about unrelated wrapping LTO bug
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D110609/new/
https://reviews.llvm.org/D110609
Files:
lld/test/ELF/lto/arm-wrap-personality.ll
llvm/lib/CodeGen/AsmPrinter/ARMException.cpp
Index: llvm/lib/CodeGen/AsmPrinter/ARMException.cpp
===================================================================
--- llvm/lib/CodeGen/AsmPrinter/ARMException.cpp
+++ llvm/lib/CodeGen/AsmPrinter/ARMException.cpp
@@ -75,7 +75,6 @@
// Emit references to personality.
if (Per) {
MCSymbol *PerSym = Asm->getSymbol(Per);
- Asm->OutStreamer->emitSymbolAttribute(PerSym, MCSA_Global);
ATS.emitPersonality(PerSym);
}
Index: lld/test/ELF/lto/arm-wrap-personality.ll
===================================================================
--- /dev/null
+++ lld/test/ELF/lto/arm-wrap-personality.ll
@@ -0,0 +1,34 @@
+; Wrapped symbols are marked as weak for LTO to inhibit IPO. The ARM backend was
+; previously explicitly marking the personality function as global, so if we
+; attempted to wrap the personality function, its initial binding would be weak
+; and then the ARM backend would attempt to change it to global, causing an
+; error. Verify that the ARM backend no longer does this and we can successfully
+; wrap the personality symbol.
+
+; REQUIRES: arm
+
+; RUN: llvm-as -o %t.bc %s
+; RUN: ld.lld -shared --wrap __gxx_personality_v0 %t.bc -o %t.so
+; RUN: llvm-readelf --dyn-syms %t.so | FileCheck %s
+
+; CHECK: GLOBAL {{.*}} __wrap___gxx_personality_v0
+; this should be GLOBAL when PR52004 is fixed.
+; CHECK: WEAK {{.*}} __gxx_personality_v0
+
+target datalayout = "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64"
+target triple = "armv7-none-linux-android"
+
+define i32 @__gxx_personality_v0(...) {
+ ret i32 0
+}
+
+define void @dummy() optnone noinline personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
+ invoke void @dummy() to label %cont unwind label %lpad
+
+cont:
+ ret void
+
+lpad:
+ %lp = landingpad { i8*, i32 } cleanup
+ resume { i8*, i32 } %lp
+}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110609.375676.patch
Type: text/x-patch
Size: 1836 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210928/fd6dd55d/attachment.bin>
More information about the llvm-commits
mailing list