Skip to content

Commit

Permalink
Auto merge of #46563 - michaelwoerister:make-anon-globals-private, r=…
Browse files Browse the repository at this point in the history
…alexcrichton

Make CGU-local globals private so they don't show up in the local symbol table.

Should reduce binary sizes. Great find, @eddyb!

r? @alexcrichton
(I have not tested this locally. Better wait for travis to turn green before approving)
  • Loading branch information
bors committed Dec 8, 2017
2 parents ab79caa + 0bfc2b9 commit ad3543d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/librustc_trans/consts.rs
Expand Up @@ -74,7 +74,7 @@ pub fn addr_of_mut(ccx: &CrateContext,
});
llvm::LLVMSetInitializer(gv, cv);
set_global_alignment(ccx, gv, align);
llvm::LLVMRustSetLinkage(gv, llvm::Linkage::InternalLinkage);
llvm::LLVMRustSetLinkage(gv, llvm::Linkage::PrivateLinkage);
SetUnnamedAddr(gv, true);
gv
}
Expand Down

0 comments on commit ad3543d

Please sign in to comment.