<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 - llvm doesn't handle @@@ in symbol names at lto time"
   href="https://bugs.llvm.org/show_bug.cgi?id=36623">36623</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>llvm doesn't handle @@@ in symbol names at lto time
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </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>new bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>rafael@espindo.la
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, peter@pcc.me.uk, tejohnson@google.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Given

$ cat test.ll
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

module asm ".global foo"
module asm "foo:"
module asm ".symver foo,foo@@@VER1"

llc produces a file with:

0000000000000000 T foo@@VER1

But running llvm-nm on the bitcode shows

---------------- T foo
---------------- T foo@@@VER1

So it looks like we are missing a special case for @@@ in the asm parsing we do
for creating bitcode symbol tables.

This results in LTO failures. Given a test.ver with "VER1 {};", we get:

$ ld.lld -shared test.o -o t.so --version-script test.ver
(no errors)

but

$ ld.lld: error: duplicate symbol: foo@@@VER1
<span class="quote">>>> defined in test.bc
>>> defined in test.bc</span ></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>