[PATCH] D36379: LLVM: Make GNU COFF Aligncomm optional

Martell Malone via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 6 09:25:41 PDT 2017


martell updated this revision to Diff 109926.
martell added a comment.

updated to only use aligncomm for alignments > 32


Repository:
  rL LLVM

https://reviews.llvm.org/D36379

Files:
  lib/MC/MCWinCOFFStreamer.cpp
  test/MC/COFF/comm-align.s


Index: test/MC/COFF/comm-align.s
===================================================================
--- test/MC/COFF/comm-align.s
+++ test/MC/COFF/comm-align.s
@@ -2,8 +2,8 @@
 # RUN:    | llvm-readobj -coff-directives -symbols | FileCheck %s
 
 # NOTE: this test checks multiple things:
-# - that -aligncomm is not emitted for 1-byte alignment
-# - that -aligncomm is emitted for the various alignments (greater than 1)
+# - that -aligncomm is not emitted for 32-byte alignment
+# - that -aligncomm is emitted for the various alignments (greater than 32)
 # - that the alignment is represented as a log_2 of the alignment
 # - that the section switching occurs correctly
 # - that functions after the switch also are emitted into the correct section
@@ -20,11 +20,13 @@
 	.data
 
 	.comm _s_1,4,0                  # @s_1
-	.comm _s_2,4,1                  # @s_2
-	.comm _s_4,4,2                  # @s_3
-	.comm _s_8,4,3                  # @s_4
+	.comm _s_2,4,2                  # @s_2
+	.comm _s_3,4,4                  # @s_3
+	.comm _s_4,4,8                  # @s_4
+
+	.comm _s_5,4,1                  # @s_5
+	.comm _small_but_overalign,1,6  # @s_6
 
-	.comm _small_but_overaligned,1,3                  # @s_4
 
 	.text
 
@@ -43,7 +45,7 @@
 # CHECK:     Section: .text (1)
 # CHECK:   }
 # CHECK:   Symbol {
-# CHECK:     Name: _small_but_overaligned
+# CHECK:     Name: _small_but_overalign
 # CHECK-NEXT:Value: 1
 # CHECK-NEXT:Section: IMAGE_SYM_UNDEFINED (0)
 # CHECK:   }
@@ -53,5 +55,5 @@
 # CHECK:   }
 # CHECK: ]
 
-# CHECK: Directive(s): -aligncomm:"_s_2",1 -aligncomm:"_s_4",2 -aligncomm:"_s_8",3 -aligncomm:"_small_but_overaligned",3
+# CHECK: Directive(s): -aligncomm:"_s_4",8 -aligncomm:"_small_but_overalign",6
 
Index: lib/MC/MCWinCOFFStreamer.cpp
===================================================================
--- lib/MC/MCWinCOFFStreamer.cpp
+++ lib/MC/MCWinCOFFStreamer.cpp
@@ -234,7 +234,7 @@
   Symbol->setExternal(true);
   Symbol->setCommon(Size, ByteAlignment);
 
-  if (!T.isKnownWindowsMSVCEnvironment() && ByteAlignment > 1) {
+  if (!T.isKnownWindowsMSVCEnvironment() && ByteAlignment > 32) {
     SmallString<128> Directive;
     raw_svector_ostream OS(Directive);
     const MCObjectFileInfo *MFI = getContext().getObjectFileInfo();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36379.109926.patch
Type: text/x-patch
Size: 2270 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170806/28c4f24c/attachment.bin>


More information about the llvm-commits mailing list