<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 - version script parser fails on unquoted class names"
   href="https://bugs.llvm.org/show_bug.cgi?id=32091">32091</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>version script parser fails on unquoted class names
          </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>FreeBSD
          </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>emaste@freebsd.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>FreeBSD's libcxxrt version script contains a few unquoted names:

GLIBCXX_3.4 {
    extern "C++" {
...
        "std::set_new_handler*";
        "std::set_terminate*";
        "std::set_unexpected*";
        "std::type_info::__*";
    }
}

which produce an error with lld:

.../usr/bin/ld: error: .../lib/libcxxrt/Version.map:343: ; expected, but got :
.../usr/bin/ld: error: .../lib/libcxxrt/Version.map:343:        
std::set_new_handler*;
.../usr/bin/ld: error: .../lib/libcxxrt/Version.map:343:            ^

test patch to demonstrate the problem:

diff --git a/test/ELF/version-script-extern-wildcards-anon.s
b/test/ELF/version-script-extern-wildcards-anon.s
index 790d985e2..5ba2f7d21 100644
--- a/test/ELF/version-script-extern-wildcards-anon.s
+++ b/test/ELF/version-script-extern-wildcards-anon.s
@@ -7,6 +7,7 @@
 # RUN:       extern "C++" { \
 # RUN:         "foo(int)"; \
 # RUN:         z*; \
+# RUN:         std::q*; \
 # RUN:       }; \
 # RUN:       local: *; \
 # RUN:       }; ' > %t.script
@@ -50,6 +51,15 @@
 # CHECK-NEXT:     Other:
 # CHECK-NEXT:     Section:
 # CHECK-NEXT:   }
+# CHECK-NEXT:   Symbol {
+# CHECK-NEXT:     Name: _ZSt3qux
+# CHECK-NEXT:     Value:
+# CHECK-NEXT:     Size:
+# CHECK-NEXT:     Binding: Global
+# CHECK-NEXT:     Type:
+# CHECK-NEXT:     Other:
+# CHECK-NEXT:     Section:
+# CHECK-NEXT:   }
 # CHECK-NEXT: ]

 .global _Z3fooi
@@ -60,3 +70,5 @@ _Z3bari:
 _Z3zedi:
 .global _Z3bazi
 _Z3bazi:
+.global _ZSt3qux
+_ZSt3qux:

Quoting the full symbol ("std::qux") in the version script works, but a quoted
wildcard does not ("std::q*").</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>