diff --git a/tools/gold/gold-plugin.cpp b/tools/gold/gold-plugin.cpp index bb0488a2fc1..f65cdf2f0d1 100644 --- a/tools/gold/gold-plugin.cpp +++ b/tools/gold/gold-plugin.cpp @@ -278,7 +278,7 @@ static ld_plugin_status claim_file_hook(const ld_plugin_input_file *file, message(LDPL_ERROR, "Failed to get a view of %s", file->name); return LDPS_ERR; } - BufferRef = MemoryBufferRef(StringRef((char *)view, file->filesize), ""); + BufferRef = MemoryBufferRef(StringRef((const char *)view, file->filesize), ""); } else { int64_t offset = 0; // Gold has found what might be IR part-way inside of a file, such as