diff --git a/projects/clr/rocclr/runtime/device/devprogram.cpp b/projects/clr/rocclr/runtime/device/devprogram.cpp index e9cd42114f..9945830ea8 100644 --- a/projects/clr/rocclr/runtime/device/devprogram.cpp +++ b/projects/clr/rocclr/runtime/device/devprogram.cpp @@ -1568,16 +1568,17 @@ bool Program::linkImplLC(amd::option::Options* options) { return false; } - if (!setKernels(options, executable, executableSize)) { - return false; - } - // Save the binary and type clBinary()->saveBIFBinary(executable, executableSize); // Destroy original memory with executable after compilation delete[] executable; + if (!setKernels(options, const_cast(clBinary()->data().first), + clBinary()->data().second)) { + return false; + } + setType(TYPE_EXECUTABLE); return true;