https://bugs.llvm.org/show_bug.cgi?id=32091

            Bug ID: 32091
           Summary: version script parser fails on unquoted class names
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: FreeBSD
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: ELF
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]

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*").

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to