summaryrefslogtreecommitdiff
path: root/tools/llvm-ld
diff options
context:
space:
mode:
authorJeff Cohen <jeffc@jolt-lang.org>2005-01-22 17:36:17 +0000
committerJeff Cohen <jeffc@jolt-lang.org>2005-01-22 17:36:17 +0000
commit5fb6ed4ae608c6f7ef589f1069b5dd5c7bdbd60b (patch)
tree1a699df0388afa1ed3d3acc4e4cd91085adbed10 /tools/llvm-ld
parent695c9bdbd0ad9d540dea68e201cd616afb4320d4 (diff)
downloadllvm-5fb6ed4ae608c6f7ef589f1069b5dd5c7bdbd60b.tar.gz
llvm-5fb6ed4ae608c6f7ef589f1069b5dd5c7bdbd60b.tar.bz2
llvm-5fb6ed4ae608c6f7ef589f1069b5dd5c7bdbd60b.tar.xz
Use binary mode for reading/writing bytecode files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19751 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-ld')
-rw-r--r--tools/llvm-ld/llvm-ld.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/llvm-ld/llvm-ld.cpp b/tools/llvm-ld/llvm-ld.cpp
index 07879acbc1..f8287f8e8d 100644
--- a/tools/llvm-ld/llvm-ld.cpp
+++ b/tools/llvm-ld/llvm-ld.cpp
@@ -186,7 +186,9 @@ static void RemoveEnv(const char * name, char ** const envp) {
void GenerateBytecode(Module* M, const std::string& FileName) {
// Create the output file.
- std::ofstream Out(FileName.c_str());
+ std::ios::openmode io_mode = std::ios::out | std::ios::trunc |
+ std::ios::binary;
+ std::ofstream Out(FileName.c_str(), io_mode);
if (!Out.good()) {
PrintAndReturn("error opening '" + FileName + "' for writing!");
return;