mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-04 14:48:47 +00:00
Merge pull request #4800 from laytan/make-use-separate-modules-corrected-linkage-hidden
make corrected linkage with -use-separate-modules apply hidden visibility
This commit is contained in:
@@ -169,11 +169,17 @@ gb_internal void lb_correct_entity_linkage(lbGenerator *gen) {
|
|||||||
other_global = LLVMGetNamedGlobal(ec.other_module->mod, ec.cname);
|
other_global = LLVMGetNamedGlobal(ec.other_module->mod, ec.cname);
|
||||||
if (other_global) {
|
if (other_global) {
|
||||||
LLVMSetLinkage(other_global, LLVMWeakAnyLinkage);
|
LLVMSetLinkage(other_global, LLVMWeakAnyLinkage);
|
||||||
|
if (!ec.e->Variable.is_export) {
|
||||||
|
LLVMSetVisibility(other_global, LLVMHiddenVisibility);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (ec.e->kind == Entity_Procedure) {
|
} else if (ec.e->kind == Entity_Procedure) {
|
||||||
other_global = LLVMGetNamedFunction(ec.other_module->mod, ec.cname);
|
other_global = LLVMGetNamedFunction(ec.other_module->mod, ec.cname);
|
||||||
if (other_global) {
|
if (other_global) {
|
||||||
LLVMSetLinkage(other_global, LLVMWeakAnyLinkage);
|
LLVMSetLinkage(other_global, LLVMWeakAnyLinkage);
|
||||||
|
if (!ec.e->Procedure.is_export) {
|
||||||
|
LLVMSetVisibility(other_global, LLVMHiddenVisibility);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user