diff --git a/lib/MC/ELFObjectWriter.cpp b/lib/MC/ELFObjectWriter.cpp index e5a59968a09..11eef6489f1 100644 --- a/lib/MC/ELFObjectWriter.cpp +++ b/lib/MC/ELFObjectWriter.cpp @@ -112,9 +112,6 @@ class ELFObjectWriter : public MCObjectWriter { /// @{ StringTableBuilder StrTabBuilder; - std::vector LocalSymbolData; - std::vector ExternalSymbolData; - std::vector UndefinedSymbolData; /// @} @@ -152,9 +149,6 @@ class ELFObjectWriter : public MCObjectWriter { Renames.clear(); Relocations.clear(); StrTabBuilder.clear(); - LocalSymbolData.clear(); - ExternalSymbolData.clear(); - UndefinedSymbolData.clear(); SectionTable.clear(); MCObjectWriter::reset(); } @@ -820,6 +814,10 @@ void ELFObjectWriter::computeSymbolTable( // The first entry is the undefined symbol entry. Writer.writeSymbol(0, 0, 0, 0, 0, 0, false); + std::vector LocalSymbolData; + std::vector ExternalSymbolData; + std::vector UndefinedSymbolData; + // Add the data for the symbols. bool HasLargeSectionIndex = false; for (const MCSymbol &Symbol : Asm.symbols()) {