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.
This commit is contained in:
Rafael Ávila de Espíndola 2011-06-01 15:45:31 -04:00
parent 2ef2bda276
commit 30efdeeca1

View File

@ -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);