[lld] r307598 - [lld/pdb] Create an empty public symbol record stream.

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 10 15:40:20 PDT 2017


Author: zturner
Date: Mon Jul 10 15:40:20 2017
New Revision: 307598

URL: http://llvm.org/viewvc/llvm-project?rev=307598&view=rev
Log:
[lld/pdb] Create an empty public symbol record stream.

This is part of the continuing effort to increase parity between
LLD and MSVC PDBs.  link still doesn't like our PDBs, so the most
obvious thing to check was whether adding an empty publics stream
would get it to do something else.  It still fails in the same way
but at least this removes one more variable from the equation.
The next logical step would be to try creating an empty globals
stream.

Differential Revision: https://reviews.llvm.org/D35224

Modified:
    lld/trunk/COFF/PDB.cpp
    lld/trunk/test/COFF/pdb-diff.test

Modified: lld/trunk/COFF/PDB.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/PDB.cpp?rev=307598&r1=307597&r2=307598&view=diff
==============================================================================
--- lld/trunk/COFF/PDB.cpp (original)
+++ lld/trunk/COFF/PDB.cpp Mon Jul 10 15:40:20 2017
@@ -481,6 +481,13 @@ void coff::createPDB(SymbolTable *Symtab
   TypeTableBuilder IDTable(BAlloc);
   addObjectsToPDB(Alloc, Symtab, Builder, TypeTable, IDTable);
 
+  // Add public and symbol records stream.
+
+  // For now we don't actually write any thing useful to the publics stream, but
+  // the act of "getting" it also creates it lazily so that we write an empty
+  // stream.
+  (void)Builder.getPublicsBuilder();
+
   // Add Section Contributions.
   addSectionContribs(Symtab, DbiBuilder);
 

Modified: lld/trunk/test/COFF/pdb-diff.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/COFF/pdb-diff.test?rev=307598&r1=307597&r2=307598&view=diff
==============================================================================
--- lld/trunk/test/COFF/pdb-diff.test (original)
+++ lld/trunk/test/COFF/pdb-diff.test Mon Jul 10 15:40:20 2017
@@ -53,11 +53,11 @@ CHECK-NEXT:   |                     TPI
 CHECK-NEXT:   |------------------------------+---|
 CHECK-NEXT:   |                     IPI Hash | {{[EI]}} |
 CHECK-NEXT:   |------------------------------+---|
-CHECK-NEXT:   |           Global Symbol Hash | D |
+CHECK-NEXT:   |           Public Symbol Hash | {{[EI]}} |
 CHECK-NEXT:   |------------------------------+---|
-CHECK-NEXT:   |           Public Symbol Hash | D |
+CHECK-NEXT:   |        Public Symbol Records | {{[EI]}} |
 CHECK-NEXT:   |------------------------------+---|
-CHECK-NEXT:   |        Public Symbol Records | D |
+CHECK-NEXT:   |           Global Symbol Hash | D |
 CHECK-NEXT:   |------------------------------+---|
 CHECK-NEXT:   ------------------------------------
 CHECK-NEXT:   |           String Table           |
@@ -154,9 +154,9 @@ CHECK-NEXT:   |                   DBG (S
 CHECK-NEXT:   |----------------------------------------+---|
 CHECK-NEXT:   |                         Globals Stream | D |
 CHECK-NEXT:   |----------------------------------------+---|
-CHECK-NEXT:   |                         Publics Stream | D |
+CHECK-NEXT:   |                         Publics Stream | {{[EI]}} |
 CHECK-NEXT:   |----------------------------------------+---|
-CHECK-NEXT:   |                         Symbol Records | D |
+CHECK-NEXT:   |                         Symbol Records | {{[EI]}} |
 CHECK-NEXT:   |----------------------------------------+---|
 CHECK-NEXT:   |                             Has CTypes | I |
 CHECK-NEXT:   |----------------------------------------+---|




More information about the llvm-commits mailing list