<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 - LLD links incorrect ELF executable if version script contains "local: *;""
   href="https://bugs.llvm.org/show_bug.cgi?id=39104">39104</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>LLD links incorrect ELF executable if version script contains "local: *;"
          </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>Linux
          </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>ELF
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>orivej@gmx.fr
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, rafael@espindo.la, ruiu@google.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Given these files:

  x.c:

    int main() { return 0; }

  x.map:

    { local: *; };

an executable linked with:

  clang x.c -o x -fuse-ld=lld -Wl,--version-script=x.map

does not run with an error:

  ./x: symbol lookup error: ./x: undefined symbol:

and "LD_DEBUG=symbols ./x" reveals that ld is looking for a symbol with
zero-length name.

(Such linker scripts are useful when an executable needs to dlopen a shared
object without exposing symbols that are supposed to be details of
implementation.)

This was introduced in <a href="https://reviews.llvm.org/D46103">https://reviews.llvm.org/D46103</a>. LLD before r330966 and
other linkers produce an executable that runs with code 0, therefore this is a
regression in LLD 7.</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>