Skip to content

Commit 349adba

Browse files
committed
[cfi] Take over existing __cfi_check in CrossDSOCFI.
https://reviews.llvm.org/D31796 will emit a dummy __cfi_check in the frontend. llvm-svn: 299805
1 parent bacee5c commit 349adba

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

llvm/lib/Transforms/IPO/CrossDSOCFI.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ void CrossDSOCFI::buildCFICheck(Module &M) {
100100
"__cfi_check", Type::getVoidTy(Ctx), Type::getInt64Ty(Ctx),
101101
Type::getInt8PtrTy(Ctx), Type::getInt8PtrTy(Ctx), nullptr);
102102
Function *F = dyn_cast<Function>(C);
103+
// Take over the existing function. The frontend emits a weak stub so that the
104+
// linker knows about the symbol; this pass replaces the function body.
105+
F->deleteBody();
103106
F->setAlignment(4096);
104107
auto args = F->arg_begin();
105108
Value &CallSiteTypeId = *(args++);

0 commit comments

Comments
 (0)