<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Duplicate symbols in PDB public symbol stream"
   href="https://bugs.llvm.org/show_bug.cgi?id=51383">51383</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Duplicate symbols in PDB public symbol stream
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>lld
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>All Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>stefan.reinalter@molecular-matters.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, smithp352@googlemail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I recently noticed that in certain cases, the PDB file produced by lld will
contain symbols twice in the public symbol stream.

Here's a short repro case:

#include <thread>

void Func(void) {}

int main(void)
{
  std::thread t(&Func);
  return 0;
}

Compile and link the above with clang-cl and lld-link, respectively.
Note that the PDB file will contain the symbol
??_Gbad_array_new_length@std@@UEAAPEAXI@Z twice in the public symbol stream.

I've noticed this with other symbols as well, but the above repro should be the
easiest to reproduce.

I have never seen any duplicate symbol in PDBs produced by MSVC, and the public
symbol stream is meant to contain only unique, external symbols with their RVA
and mangled name, so I don't think this is intentional. It might trip up some
tools working with PDB files, as it did Live++.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>