diff --git a/lld/MachO/MapFile.cpp b/lld/MachO/MapFile.cpp --- a/lld/MachO/MapFile.cpp +++ b/lld/MachO/MapFile.cpp @@ -125,12 +125,15 @@ } // Dump table of symbols + auto writeSymbols = [&](const std::vector &syms) { + os << "# Address\t File Name\n"; + for (Symbol *sym : syms) { + os << format("0x%08llX\t[%3u] %s\n", sym->getVA(), + readerToFileOrdinal[sym->getFile()], symStr[sym].c_str()); + } + }; + os << "# Symbols:\n"; - os << "# Address\t File Name\n"; - for (Symbol *sym : syms) { - os << format("0x%08llX\t[%3u] %s\n", sym->getVA(), - readerToFileOrdinal[sym->getFile()], symStr[sym].c_str()); - } - + writeSymbols(syms); // TODO: when we implement -dead_strip, we should dump dead stripped symbols }