[lld] r196332 - [PECOFF] Do not strip .debug section.
Rui Ueyama
ruiu at google.com
Tue Dec 3 15:52:10 PST 2013
Author: ruiu
Date: Tue Dec 3 17:52:10 2013
New Revision: 196332
URL: http://llvm.org/viewvc/llvm-project?rev=196332&view=rev
Log:
[PECOFF] Do not strip .debug section.
Modified:
lld/trunk/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp
lld/trunk/test/pecoff/Inputs/hello.obj.yaml
lld/trunk/test/pecoff/Inputs/main.obj.yaml
lld/trunk/test/pecoff/Inputs/nop.obj.yaml
lld/trunk/test/pecoff/lib.test
Modified: lld/trunk/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp?rev=196332&r1=196331&r2=196332&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp Tue Dec 3 17:52:10 2013
@@ -587,13 +587,6 @@ FileCOFF::AtomizeDefinedSymbolsInSection
if (error_code ec = _obj->getSectionContents(section, secData))
return ec;
- // We do not support debug information yet. We could keep data in ".debug$S"
- // section in the resultant binary by copying as opaque bytes, but it would
- // make the binary hard to debug because of extraneous data. So we'll skip
- // the debug info.
- if (sectionName == ".debug$S")
- return error_code::success();
-
// A section with IMAGE_SCN_LNK_{INFO,REMOVE} attribute will never become
// a part of the output image. That's what the COFF spec says.
if (section->Characteristics & llvm::COFF::IMAGE_SCN_LNK_INFO ||
Modified: lld/trunk/test/pecoff/Inputs/hello.obj.yaml
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/pecoff/Inputs/hello.obj.yaml?rev=196332&r1=196331&r2=196332&view=diff
==============================================================================
--- lld/trunk/test/pecoff/Inputs/hello.obj.yaml (original)
+++ lld/trunk/test/pecoff/Inputs/hello.obj.yaml Tue Dec 3 17:52:10 2013
@@ -24,14 +24,6 @@ sections:
Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
Alignment: 4
SectionData: 48656C6C6F0048656C6C6F20576F726C6400
- - Name: .debug$S
- Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ]
- Alignment: 1
- SectionData: 04000000F1000000650000002A00011100000000433A5C63796777696E5C686F6D655C727569755C72656C6F635C68656C6C6F2E6F626A0037003C1103020000030000000000000000000A0000001B9D01004D6963726F736F667420285229204D6163726F20417373656D626C65720000000000
- Relocations:
- - VirtualAddress: 4
- SymbolName: ignored
- Type: IMAGE_REL_I386_DIR32
- Name: .drectve
Characteristics: [ IMAGE_SCN_LNK_INFO, IMAGE_SCN_LNK_REMOVE ]
Alignment: 2147483648
@@ -59,14 +51,6 @@ symbols:
StorageClass: IMAGE_SYM_CLASS_STATIC
NumberOfAuxSymbols: 1
AuxiliaryData: 120000000000000000000000000000000000
- - Name: .debug$S
- Value: 0
- SectionNumber: 3
- SimpleType: IMAGE_SYM_TYPE_NULL
- ComplexType: IMAGE_SYM_DTYPE_NULL
- StorageClass: IMAGE_SYM_CLASS_STATIC
- NumberOfAuxSymbols: 1
- AuxiliaryData: 740000000000000000000000000000000000
- Name: _MessageBoxA at 16
Value: 0
SectionNumber: 0
@@ -99,7 +83,7 @@ symbols:
StorageClass: IMAGE_SYM_CLASS_STATIC
- Name: .drectve
Value: 0
- SectionNumber: 4
+ SectionNumber: 3
SimpleType: IMAGE_SYM_TYPE_NULL
ComplexType: IMAGE_SYM_DTYPE_NULL
StorageClass: IMAGE_SYM_CLASS_STATIC
Modified: lld/trunk/test/pecoff/Inputs/main.obj.yaml
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/pecoff/Inputs/main.obj.yaml?rev=196332&r1=196331&r2=196332&view=diff
==============================================================================
--- lld/trunk/test/pecoff/Inputs/main.obj.yaml (original)
+++ lld/trunk/test/pecoff/Inputs/main.obj.yaml Tue Dec 3 17:52:10 2013
@@ -18,10 +18,6 @@ sections:
Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
Alignment: 4
SectionData: ""
- - Name: ".debug$S"
- Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ]
- Alignment: 1
- SectionData: 04000000F10000006E0000003300011100000000433A5C63796777696E5C686F6D655C727569755C7374617469635C7374617469632D696D706F72742E6F626A0037003C1103020000030000000000000000000A0000001B9D01004D6963726F736F667420285229204D6163726F20417373656D626C657200000000
symbols:
- Name: "@comp.id"
Value: 10394907
@@ -45,14 +41,6 @@ symbols:
StorageClass: IMAGE_SYM_CLASS_STATIC
NumberOfAuxSymbols: 1
AuxiliaryData: 000000000000000000000000000000000000
- - Name: ".debug$S"
- Value: 0
- SectionNumber: 3
- SimpleType: IMAGE_SYM_TYPE_NULL
- ComplexType: IMAGE_SYM_DTYPE_NULL
- StorageClass: IMAGE_SYM_CLASS_STATIC
- NumberOfAuxSymbols: 1
- AuxiliaryData: 7C0000000000000000000000000000000000
- Name: _val1
Value: 0
SectionNumber: 0
Modified: lld/trunk/test/pecoff/Inputs/nop.obj.yaml
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/pecoff/Inputs/nop.obj.yaml?rev=196332&r1=196331&r2=196332&view=diff
==============================================================================
--- lld/trunk/test/pecoff/Inputs/nop.obj.yaml (original)
+++ lld/trunk/test/pecoff/Inputs/nop.obj.yaml Tue Dec 3 17:52:10 2013
@@ -11,10 +11,6 @@ sections:
Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
Alignment: 4
SectionData: ""
- - Name: ".debug$S"
- Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ]
- Alignment: 1
- SectionData: 04000000F10000005D0000002200011100000000433A5C63796777696E5C686F6D655C727569755C6E6F702E6F626A0037003C1103020000030000000000000000000A0000001B9D01004D6963726F736F667420285229204D6163726F20417373656D626C65720000000000
symbols:
- Name: "@comp.id"
Value: 10394907
@@ -38,14 +34,6 @@ symbols:
StorageClass: IMAGE_SYM_CLASS_STATIC
NumberOfAuxSymbols: 1
AuxiliaryData: 000000000000000000000000000000000000
- - Name: ".debug$S"
- Value: 0
- SectionNumber: 3
- SimpleType: IMAGE_SYM_TYPE_NULL
- ComplexType: IMAGE_SYM_DTYPE_NULL
- StorageClass: IMAGE_SYM_CLASS_STATIC
- NumberOfAuxSymbols: 1
- AuxiliaryData: 6C0000000000000000000000000000000000
- Name: _start
Value: 0
SectionNumber: 1
Modified: lld/trunk/test/pecoff/lib.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/pecoff/lib.test?rev=196332&r1=196331&r2=196332&view=diff
==============================================================================
--- lld/trunk/test/pecoff/lib.test (original)
+++ lld/trunk/test/pecoff/lib.test Tue Dec 3 17:52:10 2013
@@ -7,6 +7,6 @@
CHECK: Disassembly of section .text:
CHECK: .text:
-CHECK: 2000: a1 04 10 40 00 movl 4198404, %eax
-CHECK: 2005: 03 05 00 10 40 00 addl 4198400, %eax
-CHECK: 200b: c3 ret
+CHECK: 3000: a1 04 10 40 00 movl 4198404, %eax
+CHECK: 3005: 03 05 00 10 40 00 addl 4198400, %eax
+CHECK: 300b: c3 ret
More information about the llvm-commits
mailing list