[PATCH] D131618: [WIP][Do NOT review] LLD related changes for -ffat-lto-objects support
Arda Unal via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 11 11:31:42 PDT 2022
arda updated this revision to Diff 451933.
arda added a comment.
Fix the order of bitcode and fatLTO section check.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D131618/new/
https://reviews.llvm.org/D131618
Files:
lld/ELF/InputFiles.cpp
llvm/lib/Object/ObjectFile.cpp
Index: llvm/lib/Object/ObjectFile.cpp
===================================================================
--- llvm/lib/Object/ObjectFile.cpp
+++ llvm/lib/Object/ObjectFile.cpp
@@ -79,7 +79,7 @@
bool ObjectFile::isSectionBitcode(DataRefImpl Sec) const {
Expected<StringRef> NameOrErr = getSectionName(Sec);
if (NameOrErr)
- return *NameOrErr == ".llvmbc";
+ return *NameOrErr == ".llvmbc" || *NameOrErr == ".fatlto";
consumeError(NameOrErr.takeError());
return false;
}
Index: lld/ELF/InputFiles.cpp
===================================================================
--- lld/ELF/InputFiles.cpp
+++ lld/ELF/InputFiles.cpp
@@ -1715,6 +1715,11 @@
if (isBitcode(mb))
return make<BitcodeFile>(mb, archiveName, offsetInArchive, /*lazy=*/false);
+ // If it is a fatLTO object file
+ Expected<MemoryBufferRef> fatLTOData = IRObjectFile::findBitcodeInMemBuffer(mb);
+ if (!errorToBool(fatLTOData.takeError()))
+ return make<BitcodeFile>(*fatLTOData, archiveName, offsetInArchive, /*lazy=*/false);
+
switch (getELFKind(mb, archiveName)) {
case ELF32LEKind:
return make<ObjFile<ELF32LE>>(mb, archiveName);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131618.451933.patch
Type: text/x-patch
Size: 1142 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220811/c32673e0/attachment.bin>
More information about the llvm-commits
mailing list