<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 - After r326641/r326813, error: duplicate symbol 'pdb_search_init' in version script"
   href="https://bugs.llvm.org/show_bug.cgi?id=38549">38549</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>After r326641/r326813, error: duplicate symbol 'pdb_search_init' in version script
          </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>All
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>ELF
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>dimitry@andric.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>While working on an update to lld 7.0.0 for FreeBSD, I noticed the samba 4.8.3
port wouldn't link libsamba-passdb.so anymore, with:

ld: error: duplicate symbol 'pdb_search_init' in version script

Apparently this is a new error in lld 7.0.0, which has been introduced in
<a href="https://reviews.llvm.org/rL326813">https://reviews.llvm.org/rL326813</a> ("Improve duplicated version handling"), for
<a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Make a symbol in two versions an error again"
   href="show_bug.cgi?id=28342">bug 28342</a>.  It was a warning before that, but bisecting shows that the warning
is first printed after <a href="https://reviews.llvm.org/rL326641">https://reviews.llvm.org/rL326641</a> ("Simplify. NFC"), so
as far as I'm concerned, that revision is definitely *not* NFC. :)

Now, the version script for libsamba-passdb.so, samba-passdb.vscript, looks
like this:

SAMBA_PASSDB_0.2.0 {
        global:
                pdb_getgrsid;
                pdb_get_trusted_domain_by_sid;
[... more symbols ...]
                pdb_search_init;                        [1]
[... more symbols ...]
};

SAMBA_PASSDB_0.24.1 {
        global:
                pdb_get_trusteddom_creds;
} SAMBA_PASSDB_0.2.0;

[... more versions ...]

SAMBA_PASSDB_0.27.0 {
        global:
                *;
        local:
                idmap_init;
                idmap_sids_to_xids;
                idmap_xids_to_sids;
                pdb_nds_*;
                pdb_ldapsam_init*;
                pdb_*_init;                     [2]
[ ... more symbols ... ]
};

As you you may notice, pdb_search_init is in the public 0.2.0 ABI, but it's
*also* in the local ABI via the pdb_*_init wildcard.  Apparently, this was
never noticed before, because BFD ld and earlier lld's didn't check at all.

Is it really a problem that pdb_search_init exists as a global symbol in
version 0.2.0 of the ABI, and as a local symbol in version 0.27.0? 

I think this is a regression inadvertently caused by
<a href="https://reviews.llvm.org/rL326641">https://reviews.llvm.org/rL326641</a>, but if it isn't so, is the problem in the
version script, or in lld?</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>