[llvm-commits] [llvm] r116155 - in /llvm/trunk: lib/MC/WinCOFFObjectWriter.cpp test/MC/COFF/bss.s
Michael J. Spencer
bigcheesegs at gmail.com
Sat Oct 9 09:04:45 PDT 2010
Author: mspencer
Date: Sat Oct 9 11:04:45 2010
New Revision: 116155
URL: http://llvm.org/viewvc/llvm-project?rev=116155&view=rev
Log:
MC-COFF: Fix .bss section size. Fixes PR8335. Patch by NAKAMUTA Takumi!
Added:
llvm/trunk/test/MC/COFF/bss.s
Modified:
llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp
Modified: llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp?rev=116155&r1=116154&r2=116155&view=diff
==============================================================================
--- llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp (original)
+++ llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp Sat Oct 9 11:04:45 2010
@@ -801,7 +801,7 @@
if (Sec->Number == -1)
continue;
- Sec->Header.SizeOfRawData = Layout.getSectionFileSize(i);
+ Sec->Header.SizeOfRawData = Layout.getSectionAddressSize(i);
if (IsPhysicalSection(Sec)) {
Sec->Header.PointerToRawData = offset;
Added: llvm/trunk/test/MC/COFF/bss.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/COFF/bss.s?rev=116155&view=auto
==============================================================================
--- llvm/trunk/test/MC/COFF/bss.s (added)
+++ llvm/trunk/test/MC/COFF/bss.s Sat Oct 9 11:04:45 2010
@@ -0,0 +1,15 @@
+// The purpose of this test is to verify that bss sections are emited correctly.
+
+// RUN: llvm-mc -filetype=obj -triple i686-pc-win32 %s | coff-dump.py | FileCheck %s
+// RUN: llvm-mc -filetype=obj -triple x86_64-pc-win32 %s | coff-dump.py | FileCheck %s
+
+ .bss
+ .globl _g0
+ .align 4
+_g0:
+ .long 0
+
+// CHECK: Name = .bss
+// CHECK-NEXT: VirtualSize = 0
+// CHECK-NEXT: VirtualAddress = 0
+// CHECK-NEXT: SizeOfRawData = 4
More information about the llvm-commits
mailing list