diff options
Diffstat (limited to 'contrib/llvm-project/llvm/lib/ObjCopy/ELF/ELFObject.cpp')
-rw-r--r-- | contrib/llvm-project/llvm/lib/ObjCopy/ELF/ELFObject.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/llvm-project/llvm/lib/ObjCopy/ELF/ELFObject.cpp b/contrib/llvm-project/llvm/lib/ObjCopy/ELF/ELFObject.cpp index 5352736bdcb9..c8b66d6fcb5e 100644 --- a/contrib/llvm-project/llvm/lib/ObjCopy/ELF/ELFObject.cpp +++ b/contrib/llvm-project/llvm/lib/ObjCopy/ELF/ELFObject.cpp @@ -2638,7 +2638,7 @@ template <class ELFT> Error ELFWriter<ELFT>::finalize() { Error BinaryWriter::write() { SmallVector<const SectionBase *, 30> SectionsToWrite; for (const SectionBase &Sec : Obj.allocSections()) { - if (Sec.Type != SHT_NOBITS) + if (Sec.Type != SHT_NOBITS && Sec.Size > 0) SectionsToWrite.push_back(&Sec); } |