aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/ModuleUtils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms/Utils/ModuleUtils.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/ModuleUtils.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/ModuleUtils.cpp b/llvm/lib/Transforms/Utils/ModuleUtils.cpp
index 61cf42d..032ea80 100644
--- a/llvm/lib/Transforms/Utils/ModuleUtils.cpp
+++ b/llvm/lib/Transforms/Utils/ModuleUtils.cpp
@@ -271,9 +271,10 @@ void llvm::embedBufferInModule(Module &M, MemoryBufferRef Buf,
Constant *ModuleConstant = ConstantDataArray::get(
M.getContext(), makeArrayRef(Buf.getBufferStart(), Buf.getBufferSize()));
GlobalVariable *GV = new GlobalVariable(
- M, ModuleConstant->getType(), true, GlobalValue::PrivateLinkage,
- ModuleConstant, "llvm.embedded.object");
+ M, ModuleConstant->getType(), true, GlobalValue::ExternalLinkage,
+ ModuleConstant, SectionName.drop_front());
GV->setSection(SectionName);
+ GV->setVisibility(GlobalValue::HiddenVisibility);
appendToCompilerUsed(M, GV);
}