|
28 | 28 | #include "llvm/MC/MCExpr.h"
|
29 | 29 | #include "llvm/MC/MCInst.h"
|
30 | 30 | #include "llvm/MC/MCObjectWriter.h"
|
31 |
| -#include "llvm/MC/MCSectionELF.h" |
| 31 | +#include "llvm/MC/MCSection.h" |
32 | 32 | #include "llvm/MC/MCStreamer.h"
|
33 | 33 | #include "llvm/MC/MCSubtargetInfo.h"
|
34 | 34 | #include "llvm/MC/MCSymbolELF.h"
|
@@ -183,7 +183,7 @@ class AArch64ELFStreamer : public MCELFStreamer {
|
183 | 183 | std::move(Emitter)),
|
184 | 184 | MappingSymbolCounter(0), LastEMS(EMS_None) {}
|
185 | 185 |
|
186 |
| - void changeSection(MCSection *Section, uint32_t Subsection = 0) override { |
| 186 | + void changeSection(MCSection *Section, uint32_t Subsection) override { |
187 | 187 | // We have to keep track of the mapping symbol state of any sections we
|
188 | 188 | // use. Each one should start off as EMS_None, which is provided as the
|
189 | 189 | // default constructor by DenseMap::lookup.
|
@@ -248,9 +248,6 @@ class AArch64ELFStreamer : public MCELFStreamer {
|
248 | 248 | emitDataMappingSymbol();
|
249 | 249 | MCObjectStreamer::emitFill(NumBytes, FillValue, Loc);
|
250 | 250 | }
|
251 |
| - |
252 |
| - void finishImpl() override; |
253 |
| - |
254 | 251 | private:
|
255 | 252 | enum ElfMappingSymbol {
|
256 | 253 | EMS_None,
|
@@ -287,27 +284,6 @@ class AArch64ELFStreamer : public MCELFStreamer {
|
287 | 284 | ElfMappingSymbol LastEMS;
|
288 | 285 | };
|
289 | 286 |
|
290 |
| -void AArch64ELFStreamer::finishImpl() { |
291 |
| - MCContext &Ctx = getContext(); |
292 |
| - auto &Asm = getAssembler(); |
293 |
| - MCSectionELF *MemtagSec = nullptr; |
294 |
| - const auto *Zero = MCConstantExpr::create(0, Ctx); |
295 |
| - for (const MCSymbol &Symbol : Asm.symbols()) { |
296 |
| - const auto &Sym = cast<MCSymbolELF>(Symbol); |
297 |
| - if (!Sym.isMemtag()) |
298 |
| - continue; |
299 |
| - if (!MemtagSec) { |
300 |
| - MemtagSec = Ctx.getELFSection(".memtag.globals.static", |
301 |
| - ELF::SHT_AARCH64_MEMTAG_GLOBALS_STATIC, 0); |
302 |
| - switchSection(MemtagSec); |
303 |
| - } |
304 |
| - auto *SRE = MCSymbolRefExpr::create(&Sym, MCSymbolRefExpr::VK_None, Ctx); |
305 |
| - (void)MCObjectStreamer::emitRelocDirective( |
306 |
| - *Zero, "BFD_RELOC_NONE", SRE, SMLoc(), *Ctx.getSubtargetInfo()); |
307 |
| - } |
308 |
| - MCELFStreamer::finishImpl(); |
309 |
| -} |
310 |
| - |
311 | 287 | } // end anonymous namespace
|
312 | 288 |
|
313 | 289 | AArch64ELFStreamer &AArch64TargetELFStreamer::getStreamer() {
|
|
0 commit comments