Skip to content

Commit 30efdee

Browse files
committed
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.
1 parent 2ef2bda commit 30efdee

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/comp/middle/trans.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7436,9 +7436,12 @@ fn register_fn_pair(&@crate_ctxt cx, str ps, TypeRef llpairty, ValueRef llfn,
74367436

74377437
llvm::LLVMSetInitializer(gvar, pair);
74387438
llvm::LLVMSetGlobalConstant(gvar, True);
7439-
llvm::LLVMSetVisibility(gvar,
7440-
lib::llvm::LLVMProtectedVisibility
7441-
as llvm::Visibility);
7439+
7440+
// FIXME: We should also hide the unexported pairs in crates.
7441+
if (!cx.sess.get_opts().shared) {
7442+
llvm::LLVMSetLinkage(gvar, lib::llvm::LLVMInternalLinkage
7443+
as llvm::Linkage);
7444+
}
74427445

74437446
cx.item_ids.insert(id, llfn);
74447447
cx.item_symbols.insert(id, ps);

0 commit comments

Comments
 (0)