diff options
Diffstat (limited to 'lld/ELF/InputSection.cpp')
| -rw-r--r-- | lld/ELF/InputSection.cpp | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/lld/ELF/InputSection.cpp b/lld/ELF/InputSection.cpp index 260dddf7441..fccfe500969 100644 --- a/lld/ELF/InputSection.cpp +++ b/lld/ELF/InputSection.cpp @@ -45,32 +45,6 @@ std::string lld::toString(const InputSectionBase *Sec) { return (toString(Sec->File) + ":(" + Sec->Name + ")").str(); } -DenseMap<SectionBase *, int> elf::buildSectionOrder() { - DenseMap<SectionBase *, int> SectionOrder; - if (Config->SymbolOrderingFile.empty()) - return SectionOrder; - - // Build a map from symbols to their priorities. Symbols that didn't - // appear in the symbol ordering file have the lowest priority 0. - // All explicitly mentioned symbols have negative (higher) priorities. - DenseMap<StringRef, int> SymbolOrder; - int Priority = -Config->SymbolOrderingFile.size(); - for (StringRef S : Config->SymbolOrderingFile) - SymbolOrder.insert({S, Priority++}); - - // Build a map from sections to their priorities. - for (InputFile *File : ObjectFiles) { - for (Symbol *Sym : File->getSymbols()) { - auto *D = dyn_cast<Defined>(Sym); - if (!D || !D->Section) - continue; - int &Priority = SectionOrder[D->Section]; - Priority = std::min(Priority, SymbolOrder.lookup(D->getName())); - } - } - return SectionOrder; -} - template <class ELFT> static ArrayRef<uint8_t> getSectionContents(ObjFile<ELFT> &File, const typename ELFT::Shdr &Hdr) { |

