Skip to content

Commit aed5b9c

Browse files
Declare embedded LLVM bitcode section readonly.
1 parent 427c548 commit aed5b9c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/librustc_trans/back/write.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -848,6 +848,7 @@ unsafe fn embed_bitcode(cgcx: &CodegenContext,
848848
};
849849
llvm::LLVMSetSection(llglobal, section.as_ptr() as *const _);
850850
llvm::LLVMRustSetLinkage(llglobal, llvm::Linkage::PrivateLinkage);
851+
llvm::LLVMSetGlobalConstant(llglobal, llvm::True);
851852

852853
let llconst = C_bytes_in_context(llcx, &[]);
853854
let llglobal = llvm::LLVMAddGlobal(

0 commit comments

Comments
 (0)