summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-ld/llvm-ld.cpp
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
commitc8f1f4bc8e569a71f0067b8825f3bdb77dcd56fd (patch)
tree55b1d008e1cf3c87f4bd6accbe2299dacdb7e907 /llvm/tools/llvm-ld/llvm-ld.cpp
parente90b0c546976065cb6e09b29081e27e263159fef (diff)
downloadbcm5719-llvm-c8f1f4bc8e569a71f0067b8825f3bdb77dcd56fd.tar.gz
bcm5719-llvm-c8f1f4bc8e569a71f0067b8825f3bdb77dcd56fd.zip
Use binary mode for reading/writing bytecode files
llvm-svn: 19751
Diffstat (limited to 'llvm/tools/llvm-ld/llvm-ld.cpp')
-rw-r--r--llvm/tools/llvm-ld/llvm-ld.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/tools/llvm-ld/llvm-ld.cpp b/llvm/tools/llvm-ld/llvm-ld.cpp
index 07879acbc18..f8287f8e8d4 100644
--- a/llvm/tools/llvm-ld/llvm-ld.cpp
+++ b/llvm/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;
OpenPOWER on IntegriCloud