[AARCH64][FIX] Emit data symbol for constant pool data

The ARM64 elf emitter would omit printing data
symbol for zero filled constant data. This patch
overrides the emitFill method as to enforce that
the symbol is correctly printed.

Differential revision: https://reviews.llvm.org/D53132

llvm-svn: 344248
This commit is contained in:
Diogo N. Sampaio 2018-10-11 14:10:32 +00:00
parent 6380d8976c
commit 352a2fa1e7
2 changed files with 20 additions and 0 deletions

View File

@ -154,6 +154,11 @@ public:
MCELFStreamer::EmitValueImpl(Value, Size, Loc);
}
void emitFill(const MCExpr &NumBytes, uint64_t FillValue,
SMLoc Loc) override {
EmitDataMappingSymbol();
MCObjectStreamer::emitFill(NumBytes, FillValue, Loc);
}
private:
enum ElfMappingSymbol {
EMS_None,

View File

@ -0,0 +1,15 @@
# RUN: llvm-mc -filetype=obj -assemble \
# RUN: -triple=aarch64- %s -o - \
# RUN: | llvm-readobj -s -t - | FileCheck %s
# CHECK: Name: $d.1 ({{[1-9][0-9]+}})
# CHECK-NEXT: Value: 0x4
# CHECK-NEXT: Size: 0
# CHECK-NEXT: Binding: Local (0x0)
# CHECK-NEXT: Type: None (0x0)
# CHECK-NEXT: Other: 0
# CHECK-NEXT: Section: .text (0x2)
# CHECK-NEXT: }
.text
nop
.zero 4