aboutsummaryrefslogtreecommitdiff
path: root/src/llvm_backend.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/llvm_backend.cpp')
-rw-r--r--src/llvm_backend.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/llvm_backend.cpp b/src/llvm_backend.cpp
index 29fa67f3f..0896ea8c7 100644
--- a/src/llvm_backend.cpp
+++ b/src/llvm_backend.cpp
@@ -169,11 +169,17 @@ gb_internal void lb_correct_entity_linkage(lbGenerator *gen) {
other_global = LLVMGetNamedGlobal(ec.other_module->mod, ec.cname);
if (other_global) {
LLVMSetLinkage(other_global, LLVMWeakAnyLinkage);
+ if (!ec.e->Variable.is_export) {
+ LLVMSetVisibility(other_global, LLVMHiddenVisibility);
+ }
}
} else if (ec.e->kind == Entity_Procedure) {
other_global = LLVMGetNamedFunction(ec.other_module->mod, ec.cname);
if (other_global) {
LLVMSetLinkage(other_global, LLVMWeakAnyLinkage);
+ if (!ec.e->Procedure.is_export) {
+ LLVMSetVisibility(other_global, LLVMHiddenVisibility);
+ }
}
}
}