1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00

[sancov] Name the global containing the main source file name

If the global name doesn't start with __sancov_gen, ASan will insert
unecessary red zones around it.

llvm-svn: 287117
This commit is contained in:
Reid Kleckner 2016-11-16 16:50:43 +00:00
parent a488959025
commit 7f2f1a4146
2 changed files with 4 additions and 4 deletions

View File

@ -357,9 +357,9 @@ bool SanitizerCoverageModule::runOnModule(Module &M) {
// Create variable for module (compilation unit) name
Constant *ModNameStrConst =
ConstantDataArray::getString(M.getContext(), M.getName(), true);
GlobalVariable *ModuleName =
new GlobalVariable(M, ModNameStrConst->getType(), true,
GlobalValue::PrivateLinkage, ModNameStrConst);
GlobalVariable *ModuleName = new GlobalVariable(
M, ModNameStrConst->getType(), true, GlobalValue::PrivateLinkage,
ModNameStrConst, "__sancov_gen_modname");
if (Options.TracePCGuard) {
if (HasSancovGuardsSection) {
Function *CtorFunc;

View File

@ -49,7 +49,7 @@ entry:
; CHECK1-LABEL: define internal void @sancov.module_ctor
; CHECK1-NOT: ret
; CHECK1: call void @__sanitizer_cov_module_init({{.*}}, i64 2,
; CHECK1: call void @__sanitizer_cov_module_init({{.*}}, i64 2, {{.*}}@__sancov_gen_modname
; CHECK1: ret
; CHECK_WITH_CHECK-LABEL: define void @foo