diff --git a/projects/clr/rocclr/runtime/device/devprogram.cpp b/projects/clr/rocclr/runtime/device/devprogram.cpp index 2e6b7283f7..0073b3f667 100644 --- a/projects/clr/rocclr/runtime/device/devprogram.cpp +++ b/projects/clr/rocclr/runtime/device/devprogram.cpp @@ -259,7 +259,7 @@ amd_comgr_status_t Program::extractByteCodeBinary(const amd_comgr_data_set_t inD // save the binary to the file as output file name is specified if (!outFileName.empty()) { - std::ofstream f(outFileName.c_str(), std::ios::trunc); + std::ofstream f(outFileName.c_str(), std::ios::trunc | std::ios::binary); if (f.is_open()) { f.write(binary, binarySize); f.close();