[PATCH] [lld] COFF: Ignore debug symbols.
Peter Collingbourne
peter at pcc.me.uk
Tue Jun 23 17:10:11 PDT 2015
REPOSITORY
rL LLVM
http://reviews.llvm.org/D10675
Files:
lld/trunk/COFF/InputFiles.cpp
lld/trunk/test/COFF/debug.test
Index: lld/trunk/COFF/InputFiles.cpp
===================================================================
--- lld/trunk/COFF/InputFiles.cpp
+++ lld/trunk/COFF/InputFiles.cpp
@@ -193,6 +193,8 @@
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);
Index: lld/trunk/test/COFF/debug.test
===================================================================
--- lld/trunk/test/COFF/debug.test
+++ lld/trunk/test/COFF/debug.test
@@ -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
+...
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D10675.28308.patch
Type: text/x-patch
Size: 1855 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150624/fc936e08/attachment.bin>
More information about the llvm-commits
mailing list