[llvm] r214754 - Allow .lcomm with alignment on ELF targets.

Joerg Sonnenberger joerg at bec.de
Mon Aug 4 11:45:10 PDT 2014


Author: joerg
Date: Mon Aug  4 13:45:10 2014
New Revision: 214754

URL: http://llvm.org/viewvc/llvm-project?rev=214754&view=rev
Log:
Allow .lcomm with alignment on ELF targets.

Added:
    llvm/trunk/test/MC/PowerPC/lcomm.s
Modified:
    llvm/trunk/lib/Target/PowerPC/MCTargetDesc/PPCMCAsmInfo.cpp

Modified: llvm/trunk/lib/Target/PowerPC/MCTargetDesc/PPCMCAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/MCTargetDesc/PPCMCAsmInfo.cpp?rev=214754&r1=214753&r2=214754&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/MCTargetDesc/PPCMCAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/MCTargetDesc/PPCMCAsmInfo.cpp Mon Aug  4 13:45:10 2014
@@ -73,6 +73,7 @@ PPCLinuxMCAsmInfo::PPCLinuxMCAsmInfo(boo
   ZeroDirective = "\t.space\t";
   Data64bitsDirective = is64Bit ? "\t.quad\t" : nullptr;
   AssemblerDialect = 1;           // New-Style mnemonics.
+  LCOMMDirectiveAlignmentType = LCOMM::ByteAlignment;
 
   if (T.getOS() == llvm::Triple::FreeBSD ||
       (T.getOS() == llvm::Triple::NetBSD && !is64Bit) ||

Added: llvm/trunk/test/MC/PowerPC/lcomm.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/PowerPC/lcomm.s?rev=214754&view=auto
==============================================================================
--- llvm/trunk/test/MC/PowerPC/lcomm.s (added)
+++ llvm/trunk/test/MC/PowerPC/lcomm.s Mon Aug  4 13:45:10 2014
@@ -0,0 +1,22 @@
+# RUN: llvm-mc -triple powerpc-unknown-unknown -filetype=obj %s | \
+# RUN: llvm-readobj -s -sd | FileCheck %s
+# RUN: llvm-mc -triple powerpc64-unknown-unknown -filetype=obj %s | \
+# RUN: llvm-readobj -s -sd | FileCheck %s
+
+.lcomm foo, 16, 16
+
+// CHECK:        Section {
+// CHECK:          Name: .bss
+// CHECK-NEXT:     Type: SHT_NOBITS
+// CHECK-NEXT:     Flags [
+// CHECK-NEXT:       SHF_ALLOC
+// CHECK-NEXT:       SHF_WRITE
+// CHECK-NEXT:     ]
+// CHECK-NEXT:     Address: 0x0
+// CHECK-NEXT:     Offset: 0x40
+// CHECK-NEXT:     Size: 16
+// CHECK-NEXT:     Link: 0
+// CHECK-NEXT:     Info: 0
+// CHECK-NEXT:     AddressAlignment: 16
+// CHECK-NEXT:     EntrySize: 0
+// CHECK-NEXT:     SectionData (





More information about the llvm-commits mailing list