[ELF] Simplify InputSectionBase::getSize
authorFangrui Song <i@maskray.me>
Mon, 21 Nov 2022 00:02:36 +0000 (00:02 +0000)
committerFangrui Song <i@maskray.me>
Mon, 21 Nov 2022 00:02:36 +0000 (00:02 +0000)
lld/ELF/InputSection.cpp

index f08db55..5238639 100644 (file)
@@ -103,9 +103,7 @@ InputSectionBase::InputSectionBase(ObjFile<ELFT> &file,
 size_t InputSectionBase::getSize() const {
   if (auto *s = dyn_cast<SyntheticSection>(this))
     return s->getSize();
-  if (compressed)
-    return size;
-  return content().size() - bytesDropped;
+  return size - bytesDropped;
 }
 
 template <class ELFT>