From 30efdeeca1bd0d60412fdb9e88eba6336ffcacea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20=C3=81vila=20de=20Esp=C3=ADndola?= Date: Wed, 1 Jun 2011 15:45:31 -0400 Subject: [PATCH] Visibility is an ELF concept and protected visibility is not very well implemented, avoid using it for now. Instead, mark pairs that are not needed elsewhere as internal. --- src/comp/middle/trans.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs index 3e3f8654be3..78850d20fa1 100644 --- a/src/comp/middle/trans.rs +++ b/src/comp/middle/trans.rs @@ -7436,9 +7436,12 @@ fn register_fn_pair(&@crate_ctxt cx, str ps, TypeRef llpairty, ValueRef llfn, llvm::LLVMSetInitializer(gvar, pair); llvm::LLVMSetGlobalConstant(gvar, True); - llvm::LLVMSetVisibility(gvar, - lib::llvm::LLVMProtectedVisibility - as llvm::Visibility); + + // FIXME: We should also hide the unexported pairs in crates. + if (!cx.sess.get_opts().shared) { + llvm::LLVMSetLinkage(gvar, lib::llvm::LLVMInternalLinkage + as llvm::Linkage); + } cx.item_ids.insert(id, llfn); cx.item_symbols.insert(id, ps);