[lld] r240487 - COFF: Ignore debug symbols.
Peter Collingbourne
peter at pcc.me.uk
Tue Jun 23 17:05:50 PDT 2015
Author: pcc
Date: Tue Jun 23 19:05:50 2015
New Revision: 240487
URL: http://llvm.org/viewvc/llvm-project?rev=240487&view=rev
Log:
COFF: Ignore debug symbols.
Differential Revision: http://reviews.llvm.org/D10675
Added:
lld/trunk/test/COFF/debug.test
Modified:
lld/trunk/COFF/InputFiles.cpp
Modified: lld/trunk/COFF/InputFiles.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/InputFiles.cpp?rev=240487&r1=240486&r2=240487&view=diff
==============================================================================
--- lld/trunk/COFF/InputFiles.cpp (original)
+++ lld/trunk/COFF/InputFiles.cpp Tue Jun 23 19:05:50 2015
@@ -193,6 +193,8 @@ SymbolBody *ObjectFile::createSymbolBody
return nullptr;
return new (Alloc) DefinedAbsolute(Name, Sym.getValue());
}
+ if (Sym.getSectionNumber() == llvm::COFF::IMAGE_SYM_DEBUG)
+ return nullptr;
// TODO: Handle IMAGE_WEAK_EXTERN_SEARCH_ALIAS
if (Sym.isWeakExternal()) {
COFFObj->getSymbolName(Sym, Name);
Added: lld/trunk/test/COFF/debug.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/COFF/debug.test?rev=240487&view=auto
==============================================================================
--- lld/trunk/test/COFF/debug.test (added)
+++ lld/trunk/test/COFF/debug.test Tue Jun 23 19:05:50 2015
@@ -0,0 +1,38 @@
+# RUN: yaml2obj %s > %t.obj
+# RUN: lld -flavor link2 /out:%t.exe /entry:main /subsystem:console %t.obj
+
+---
+header:
+ Machine: IMAGE_FILE_MACHINE_AMD64
+ Characteristics: []
+sections:
+ - Name: .text
+ Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
+ Alignment: 4
+ SectionData: B82A000000C3
+symbols:
+ - Name: .text
+ Value: 0
+ SectionNumber: 1
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_NULL
+ StorageClass: IMAGE_SYM_CLASS_STATIC
+ SectionDefinition:
+ Length: 6
+ NumberOfRelocations: 0
+ NumberOfLinenumbers: 0
+ CheckSum: 0
+ Number: 0
+ - Name: main
+ Value: 0
+ SectionNumber: 1
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_NULL
+ StorageClass: IMAGE_SYM_CLASS_EXTERNAL
+ - Name: debug
+ Value: 0
+ SectionNumber: -2
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_NULL
+ StorageClass: IMAGE_SYM_CLASS_EXTERNAL
+...
More information about the llvm-commits
mailing list