[lld] r363724 - [PDB] Ignore .debug$S subsections with high bit set
Reid Kleckner via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 18 12:41:25 PDT 2019
Author: rnk
Date: Tue Jun 18 12:41:25 2019
New Revision: 363724
URL: http://llvm.org/viewvc/llvm-project?rev=363724&view=rev
Log:
[PDB] Ignore .debug$S subsections with high bit set
Some versions of the Visual C++ 2015 runtime have line tables with the
subsection kind of 0x800000F2. In cvinfo.h, 0x80000000 is documented to
be DEBUG_S_IGNORE. This appears to implement the intended behavior.
Modified:
lld/trunk/COFF/PDB.cpp
lld/trunk/test/COFF/pdb-unknown-subsection.s
Modified: lld/trunk/COFF/PDB.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/PDB.cpp?rev=363724&r1=363723&r2=363724&view=diff
==============================================================================
--- lld/trunk/COFF/PDB.cpp (original)
+++ lld/trunk/COFF/PDB.cpp Tue Jun 18 12:41:25 2019
@@ -1002,6 +1002,11 @@ void DebugSHandler::handleDebugS(lld::co
ExitOnErr(Reader.readArray(Subsections, RelocatedDebugContents.size()));
for (const DebugSubsectionRecord &SS : Subsections) {
+ // Ignore subsections with the 'ignore' bit. Some versions of the Visual C++
+ // runtime have subsections with this bit set.
+ if (uint32_t(SS.kind()) & codeview::SubsectionIgnoreFlag)
+ continue;
+
switch (SS.kind()) {
case DebugSubsectionKind::StringTable: {
assert(!CVStrTab.valid() &&
Modified: lld/trunk/test/COFF/pdb-unknown-subsection.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/COFF/pdb-unknown-subsection.s?rev=363724&r1=363723&r2=363724&view=diff
==============================================================================
--- lld/trunk/test/COFF/pdb-unknown-subsection.s (original)
+++ lld/trunk/test/COFF/pdb-unknown-subsection.s Tue Jun 18 12:41:25 2019
@@ -6,7 +6,9 @@
# RUN: lld-link -subsystem:console -debug -nodefaultlib -entry:foo -out:%t.exe -pdb:%t.pdb %t.obj 2>&1 | FileCheck %s --check-prefix=WARNING
# RUN: llvm-pdbutil dump -symbols %t.pdb | FileCheck %s
+# WARNING-NOT: ignoring unknown
# WARNING: ignoring unknown debug$S subsection kind 0xFF
+# WARNING-NOT: ignoring unknown
# CHECK: Symbols
# CHECK: 4 | S_COMPILE3 [size = 52]
@@ -44,3 +46,15 @@ ret
.long 0xFF # Unknown subsection kind
.long 4 # Subsection size
.long 0
+ .long 0x800000F1 # Unknown subsection kind
+ .long 4 # Subsection size
+ .long 0
+ .long 0x800000F2 # Unknown subsection kind
+ .long 4 # Subsection size
+ .long 0
+ .long 0x800000F3 # Unknown subsection kind
+ .long 4 # Subsection size
+ .long 0
+ .long 0x800000F4 # Unknown subsection kind
+ .long 4 # Subsection size
+ .long 0
More information about the llvm-commits
mailing list