From 852bd5c062fa1f86b99dc7e5256d4dd6020f48ac Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Thu, 1 Mar 2018 01:08:00 +0000 Subject: Simplify removing empty output sections. With this the meaning of the Live bit in output sections is clear: we have at some point added a input section into it. llvm-svn: 326401 --- lld/ELF/OutputSections.cpp | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'lld/ELF/OutputSections.cpp') diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp index 9b8ea2bb461..9d5ebe5fea7 100644 --- a/lld/ELF/OutputSections.cpp +++ b/lld/ELF/OutputSections.cpp @@ -78,25 +78,6 @@ OutputSection::OutputSection(StringRef Name, uint32_t Type, uint64_t Flags) Live = false; } -bool OutputSection::isAllSectionDescription() const { - // We do not remove empty sections that are explicitly - // assigned to any segment. - if (!Phdrs.empty()) - return false; - - // We do not want to remove sections that have custom address or align - // expressions set even if them are empty. We keep them because we - // want to be sure that any expressions can be evaluated and report - // an error otherwise. - if (AddrExpr || AlignExpr || LMAExpr) - return false; - - for (BaseCommand *Base : SectionCommands) - if (!isa(*Base)) - return false; - return true; -} - // We allow sections of types listed below to merged into a // single progbits section. This is typically done by linker // scripts. Merging nobits and progbits will force disk space -- cgit v1.2.3