summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.cpp8
-rw-r--r--llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp2
2 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.cpp b/llvm/lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.cpp
index 1e8a07aea8a..8ee627d50df 100644
--- a/llvm/lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.cpp
+++ b/llvm/lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.cpp
@@ -102,6 +102,14 @@ public:
MCELFStreamer::ChangeSection(Section, Subsection);
}
+ // Reset state between object emissions
+ void reset() override {
+ MappingSymbolCounter = 0;
+ MCELFStreamer::reset();
+ LastMappingSymbols.clear();
+ LastEMS = EMS_None;
+ }
+
/// This function is the one used to emit instruction data into the ELF
/// streamer. We override it to add the appropriate mapping symbol if
/// necessary.
diff --git a/llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp b/llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
index 1f995ddba7d..8cfa18f58b6 100644
--- a/llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
+++ b/llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
@@ -1171,6 +1171,8 @@ void ARMELFStreamer::reset() {
ATS.reset();
MappingSymbolCounter = 0;
MCELFStreamer::reset();
+ LastMappingSymbols.clear();
+ LastEMSInfo.reset();
// MCELFStreamer clear's the assembler's e_flags. However, for
// arm we manually set the ABI version on streamer creation, so
// do the same here
OpenPOWER on IntegriCloud