diff --git a/llvm/lib/Object/ObjectFile.cpp b/llvm/lib/Object/ObjectFile.cpp --- a/llvm/lib/Object/ObjectFile.cpp +++ b/llvm/lib/Object/ObjectFile.cpp @@ -79,7 +79,7 @@ bool ObjectFile::isSectionBitcode(DataRefImpl Sec) const { Expected NameOrErr = getSectionName(Sec); if (NameOrErr) - return *NameOrErr == ".llvmbc" || *NameOrErr == ".llvm.lto"; + return *NameOrErr == ".llvm.lto"; consumeError(NameOrErr.takeError()); return false; } diff --git a/llvm/test/LTO/X86/Inputs/bcsection.s b/llvm/test/LTO/X86/Inputs/bcsection.s --- a/llvm/test/LTO/X86/Inputs/bcsection.s +++ b/llvm/test/LTO/X86/Inputs/bcsection.s @@ -1,2 +1,2 @@ -.section .llvmbc +.section .llvm.lto .incbin "bcsection.bc" diff --git a/llvm/tools/gold/gold-plugin.cpp b/llvm/tools/gold/gold-plugin.cpp --- a/llvm/tools/gold/gold-plugin.cpp +++ b/llvm/tools/gold/gold-plugin.cpp @@ -538,14 +538,6 @@ 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);