From 1a8030e73798920aee4868a1137a300b8bfd3ab3 Mon Sep 17 00:00:00 2001 From: Evgeniy Stepanov Date: Fri, 7 Apr 2017 23:00:38 +0000 Subject: [cfi] Emit __cfi_check stub in the frontend. Previously __cfi_check was created in LTO optimization pipeline, which means LLD has no way of knowing about the existence of this symbol without rescanning the LTO output object. As a result, LLD fails to export __cfi_check, even when given --export-dynamic-symbol flag. llvm-svn: 299806 --- clang/lib/CodeGen/CodeGenModule.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 479a390..6bc7d4f1 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -406,8 +406,10 @@ void CodeGenModule::Release() { EmitDeferredUnusedCoverageMappings(); if (CoverageMapping) CoverageMapping->emit(); - if (CodeGenOpts.SanitizeCfiCrossDso) + if (CodeGenOpts.SanitizeCfiCrossDso) { CodeGenFunction(*this).EmitCfiCheckFail(); + CodeGenFunction(*this).EmitCfiCheckStub(); + } emitAtAvailableLinkGuard(); emitLLVMUsed(); if (SanStats) -- cgit v1.1