Do not use Decompressor::isCompressedELFSection. NFC.
authorRui Ueyama <ruiu@google.com>
Mon, 12 Feb 2018 22:32:57 +0000 (22:32 +0000)
committerRui Ueyama <ruiu@google.com>
Mon, 12 Feb 2018 22:32:57 +0000 (22:32 +0000)
In order to identify a compressed section, we check if a section name
starts with ".zdebug" or the section has SHF_COMPRESSED flag. We already
use the knowledge in this function. So hiding that check in
isCompressedELFSection doesn't make sense.

llvm-svn: 324951

lld/ELF/InputSection.cpp

index 769cc09..6766c00 100644 (file)
@@ -178,7 +178,9 @@ OutputSection *SectionBase::getOutputSection() {
 // Decompress section contents if required. Note that this function
 // is called from parallelForEach, so it must be thread-safe.
 void InputSectionBase::maybeDecompress() {
-  if (DecompressBuf || !Decompressor::isCompressedELFSection(Flags, Name))
+  if (DecompressBuf)
+    return;
+  if (!(Flags & SHF_COMPRESSED) && !Name.startswith(".zdebug"))
     return;
 
   // Decompress a section.