[llvm] r207851 - MC: place .file records into the correct section
Saleem Abdulrasool
compnerd at compnerd.org
Fri May 2 10:45:25 PDT 2014
Author: compnerd
Date: Fri May 2 12:45:24 2014
New Revision: 207851
URL: http://llvm.org/viewvc/llvm-project?rev=207851&view=rev
Log:
MC: place .file records into the correct section
.file records are supposed to have a section identifier of 65534
(IMAGE_SCN_DEBUG) rather than 0. This is spelt out clearly within the PE/COFF
specification. Fix this minor oversight with the implementation for support for
.file records.
Modified:
llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp
llvm/trunk/test/MC/ARM/coff-file.s
llvm/trunk/test/MC/COFF/file.s
Modified: llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp?rev=207851&r1=207850&r2=207851&view=diff
==============================================================================
--- llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp (original)
+++ llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp Fri May 2 12:45:24 2014
@@ -649,6 +649,7 @@ void WinCOFFObjectWriter::ExecutePostLay
unsigned Count = (FI->size() + COFF::SymbolSize - 1) / COFF::SymbolSize;
COFFSymbol *file = createSymbol(".file");
+ file->Data.SectionNumber = COFF::IMAGE_SYM_DEBUG;
file->Data.StorageClass = COFF::IMAGE_SYM_CLASS_FILE;
file->Aux.resize(Count);
Modified: llvm/trunk/test/MC/ARM/coff-file.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ARM/coff-file.s?rev=207851&r1=207850&r2=207851&view=diff
==============================================================================
--- llvm/trunk/test/MC/ARM/coff-file.s (original)
+++ llvm/trunk/test/MC/ARM/coff-file.s Fri May 2 12:45:24 2014
@@ -1,6 +1,9 @@
// RUN: llvm-mc -triple thumbv7-windows -filetype obj %s -o - | llvm-objdump -t - \
// RUN: | FileCheck %s
+// RUN: llvm-mc -triple thumbv7-windows -filetype obj %s -o - \
+// RUN: | llvm-readobj -symbols | FileCheck %s -check-prefix CHECK-SCN
+
.file "null-padded.asm"
// CHECK: (nx 1) {{0x[0-9]+}} .file
// CHECK-NEXT: AUX null-padded.asm{{$}}
@@ -15,3 +18,30 @@
// CHECK: (nx 2) {{0x[0-9]+}} .file
// CHECK-NEXT: AUX multiple-auxiliary-entries.asm{{$}}
+// CHECK-SCN: Symbols [
+// CHECK-SCN: Symbol {
+// CHECK-SCN: Name: .file
+// CHECK-SCN: Section: (65534)
+// CHECK-SCN: StorageClass: File
+// CHECK-SCN: AuxFileRecord {
+// CHECK-SCN: FileName: null-padded.asm
+// CHECK-SCN: }
+// CHECK-SCN: }
+// CHECK-SCN: Symbol {
+// CHECK-SCN: Name: .file
+// CHECK-SCN: Section: (65534)
+// CHECK-SCN: StorageClass: File
+// CHECK-SCN: AuxFileRecord {
+// CHECK-SCN: FileName: eighteen-chars.asm
+// CHECK-SCN: }
+// CHECK-SCN: }
+// CHECK-SCN: Symbol {
+// CHECK-SCN: Name: .file
+// CHECK-SCN: Section: (65534)
+// CHECK-SCN: StorageClass: File
+// CHECK-SCN: AuxFileRecord {
+// CHECK-SCN: FileName: multiple-auxiliary-entries.asm
+// CHECK-SCN: }
+// CHECK-SCN: }
+// CHECK-SCN: ]
+
Modified: llvm/trunk/test/MC/COFF/file.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/COFF/file.s?rev=207851&r1=207850&r2=207851&view=diff
==============================================================================
--- llvm/trunk/test/MC/COFF/file.s (original)
+++ llvm/trunk/test/MC/COFF/file.s Fri May 2 12:45:24 2014
@@ -1,6 +1,9 @@
// RUN: llvm-mc -triple i686-windows -filetype obj %s -o - | llvm-objdump -t - \
// RUN: | FileCheck %s
+// RUN: llvm-mc -triple i686-windows -filetype obj %s -o - \
+// RUN: | llvm-readobj -symbols | FileCheck %s -check-prefix CHECK-SCN
+
.file "null-padded.asm"
// CHECK: (nx 1) {{0x[0-9]+}} .file
// CHECK-NEXT: AUX null-padded.asm{{$}}
@@ -15,3 +18,30 @@
// CHECK: (nx 2) {{0x[0-9]+}} .file
// CHECK-NEXT: AUX multiple-auxiliary-entries.asm{{$}}
+// CHECK-SCN: Symbols [
+// CHECK-SCN: Symbol {
+// CHECK-SCN: Name: .file
+// CHECK-SCN: Section: (65534)
+// CHECK-SCN: StorageClass: File
+// CHECK-SCN: AuxFileRecord {
+// CHECK-SCN: FileName: null-padded.asm
+// CHECK-SCN: }
+// CHECK-SCN: }
+// CHECK-SCN: Symbol {
+// CHECK-SCN: Name: .file
+// CHECK-SCN: Section: (65534)
+// CHECK-SCN: StorageClass: File
+// CHECK-SCN: AuxFileRecord {
+// CHECK-SCN: FileName: eighteen-chars.asm
+// CHECK-SCN: }
+// CHECK-SCN: }
+// CHECK-SCN: Symbol {
+// CHECK-SCN: Name: .file
+// CHECK-SCN: Section: (65534)
+// CHECK-SCN: StorageClass: File
+// CHECK-SCN: AuxFileRecord {
+// CHECK-SCN: FileName: multiple-auxiliary-entries.asm
+// CHECK-SCN: }
+// CHECK-SCN: }
+// CHECK-SCN: ]
+
More information about the llvm-commits
mailing list