From 7773a72c0f8b746717781898388088eae3b07275 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 llvm-svn: 232982 --- llvm/lib/MC/ELFObjectWriter.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/llvm/lib/MC/ELFObjectWriter.cpp b/llvm/lib/MC/ELFObjectWriter.cpp index ea3dd45..c05241b 100644 --- a/llvm/lib/MC/ELFObjectWriter.cpp +++ b/llvm/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) { -- 2.7.4