[llvm] r344248 - [AARCH64][FIX] Emit data symbol for constant pool data
Diogo N. Sampaio via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 11 07:10:32 PDT 2018
Author: dnsampaio
Date: Thu Oct 11 07:10:32 2018
New Revision: 344248
URL: http://llvm.org/viewvc/llvm-project?rev=344248&view=rev
Log:
[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
Added:
llvm/trunk/test/MC/AArch64/CheckDataSymbol.s
Modified:
llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.cpp
Modified: llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.cpp?rev=344248&r1=344247&r2=344248&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.cpp Thu Oct 11 07:10:32 2018
@@ -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,
Added: llvm/trunk/test/MC/AArch64/CheckDataSymbol.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AArch64/CheckDataSymbol.s?rev=344248&view=auto
==============================================================================
--- llvm/trunk/test/MC/AArch64/CheckDataSymbol.s (added)
+++ llvm/trunk/test/MC/AArch64/CheckDataSymbol.s Thu Oct 11 07:10:32 2018
@@ -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
More information about the llvm-commits
mailing list