summaryrefslogtreecommitdiffstats
path: root/lld/ELF/InputSection.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/ELF/InputSection.cpp')
-rw-r--r--lld/ELF/InputSection.cpp17
1 files changed, 0 insertions, 17 deletions
diff --git a/lld/ELF/InputSection.cpp b/lld/ELF/InputSection.cpp
index 2b883d5886a..b63c09a7ba7 100644
--- a/lld/ELF/InputSection.cpp
+++ b/lld/ELF/InputSection.cpp
@@ -76,22 +76,6 @@ static ArrayRef<uint8_t> getSectionContents(ObjFile<ELFT> *File,
return check(File->getObj().getSectionContents(Hdr));
}
-// Return true if a section with given section flags is live (will never be
-// GCed) by default. If a section can be GCed, this function returns false.
-static bool isLiveByDefault(uint64_t Flags, uint32_t Type) {
- // If GC is enabled, all memory-mapped sections are subject of GC.
- if (!Config->GcSections)
- return true;
- if (Flags & SHF_ALLOC)
- return false;
-
- // Besides that, relocation sections can also be GCed because their
- // relocation target sections may be GCed. This doesn't really matter
- // in most cases because the linker usually consumes relocation
- // sections instead of emitting them, but -emit-reloc needs this.
- return Type != SHT_REL && Type != SHT_RELA;
-}
-
InputSectionBase::InputSectionBase(InputFile *File, uint64_t Flags,
uint32_t Type, uint64_t Entsize,
uint32_t Link, uint32_t Info,
@@ -100,7 +84,6 @@ InputSectionBase::InputSectionBase(InputFile *File, uint64_t Flags,
: SectionBase(SectionKind, Name, Flags, Entsize, Alignment, Type, Info,
Link),
File(File), Data(Data), Repl(this) {
- Live = isLiveByDefault(Flags, Type);
Assigned = false;
NumRelocations = 0;
AreRelocsRela = false;
OpenPOWER on IntegriCloud