From 8b9cc2da07c481baf41799ea21309ff0b6b85cd8 Mon Sep 17 00:00:00 2001 From: Yaron Keren Date: Mon, 23 Mar 2015 18:35:01 +0000 Subject: [PATCH] Add missing ELFObjectWriter::reset() override, like other MC classes. See detailed discussion at http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20140915/235418.html and r217907, r217948: http://llvm.org/viewvc/llvm-project?view=revision&revision=217907 http://llvm.org/viewvc/llvm-project?view=revision&revision=217948 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232982 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/MC/ELFObjectWriter.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/MC/ELFObjectWriter.cpp b/lib/MC/ELFObjectWriter.cpp index ea3dd450c86..c05241b53f7 100644 --- a/lib/MC/ELFObjectWriter.cpp +++ b/lib/MC/ELFObjectWriter.cpp @@ -190,6 +190,20 @@ class ELFObjectWriter : public MCObjectWriter { : MCObjectWriter(OS, IsLittleEndian), FWriter(IsLittleEndian), TargetObjectWriter(MOTW), NeedsGOT(false) {} + void reset() override { + UsedInReloc.clear(); + WeakrefUsedInReloc.clear(); + Renames.clear(); + Relocations.clear(); + ShStrTabBuilder.clear(); + StrTabBuilder.clear(); + FileSymbolData.clear(); + LocalSymbolData.clear(); + ExternalSymbolData.clear(); + UndefinedSymbolData.clear(); + MCObjectWriter::reset(); + } + virtual ~ELFObjectWriter(); void WriteWord(uint64_t W) {