From 6b539f5eb8ef1d3a3c87873caa2dbd5147e1adbd Mon Sep 17 00:00:00 2001 From: Paul Kirth Date: Thu, 20 Jul 2023 20:58:22 +0000 Subject: Reland "[gold] Add preliminary FatLTO support to the Gold plugin"" This changes the definition if isSectionBitcode to only be valid for the .llvm.lto section, since this API is only called from LTO, and the .llvmbc section was not intended to be used for LTO. This allows the gold plugin to keep its existing behavior without introducing any significant changes. Reviewed By: MaskRay, nikic Differential Revision: https://reviews.llvm.org/D152973 --- llvm/tools/gold/gold-plugin.cpp | 8 -------- 1 file changed, 8 deletions(-) (limited to 'llvm/tools/gold') diff --git a/llvm/tools/gold/gold-plugin.cpp b/llvm/tools/gold/gold-plugin.cpp index a47dba3..59bd3f6 100644 --- a/llvm/tools/gold/gold-plugin.cpp +++ b/llvm/tools/gold/gold-plugin.cpp @@ -538,14 +538,6 @@ static ld_plugin_status claim_file_hook(const ld_plugin_input_file *file, BufferRef = Buffer->getMemBufferRef(); } - // Only use bitcode files for LTO. InputFile::create() will load bitcode - // from the .llvmbc section within a binary object, this bitcode is typically - // generated by -fembed-bitcode and is not to be used by LLVMgold.so for LTO. - if (identify_magic(BufferRef.getBuffer()) != file_magic::bitcode) { - *claimed = 0; - return LDPS_OK; - } - *claimed = 1; Expected> ObjOrErr = InputFile::create(BufferRef); -- cgit v1.1