[lld] r336353 - [ELF] - Test we are able to assign version to symbols that are not "_Z*"

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 5 07:01:54 PDT 2018


Author: grimar
Date: Thu Jul  5 07:01:54 2018
New Revision: 336353

URL: http://llvm.org/viewvc/llvm-project?rev=336353&view=rev
Log:
[ELF] - Test we are able to assign version to symbols that are not "_Z*"

This is to test the following line of the code:
https://github.com/llvm-mirror/lld/blob/master/ELF/SymbolTable.cpp#L681

If symbol does not start from _Z prefix and we have extern "C++",
we do not call demangler and use its name as is.

Added:
    lld/trunk/test/ELF/version-script-extern2.s

Added: lld/trunk/test/ELF/version-script-extern2.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/version-script-extern2.s?rev=336353&view=auto
==============================================================================
--- lld/trunk/test/ELF/version-script-extern2.s (added)
+++ lld/trunk/test/ELF/version-script-extern2.s Thu Jul  5 07:01:54 2018
@@ -0,0 +1,22 @@
+# REQUIRES: x86
+
+# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
+# RUN: echo "FOO { global: extern \"C++\" { \"bar\"; }; };" > %t.script
+# RUN: ld.lld --version-script %t.script -shared %t.o -o %t.so
+# RUN: llvm-readobj -V %t.so | FileCheck %s
+
+# CHECK:      Symbols [
+# CHECK-NEXT:   Symbol {
+# CHECK-NEXT:     Version: 0
+# CHECK-NEXT:     Name: @
+# CHECK-NEXT:   }
+# CHECK-NEXT:   Symbol {
+# CHECK-NEXT:     Version: 2
+# CHECK-NEXT:     Name: bar@@FOO
+# CHECK-NEXT:   }
+# CHECK-NEXT: ]
+
+.globl bar
+.type bar, at function
+bar:
+retq




More information about the llvm-commits mailing list