[PATCH] D21640: [ELF] - Fix incorrect logic in VersionScriptParser::parseVersion()

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 23 03:47:28 PDT 2016


grimar updated this revision to Diff 61660.
grimar added a comment.

- Reduced testcase.


http://reviews.llvm.org/D21640

Files:
  ELF/SymbolListFile.cpp
  test/ELF/verdef-dependency.s

Index: test/ELF/verdef-dependency.s
===================================================================
--- test/ELF/verdef-dependency.s
+++ test/ELF/verdef-dependency.s
@@ -8,7 +8,7 @@
 # RUN:          local: *; }LIBSAMPLE_1.0; \
 # RUN:       LIBSAMPLE_3.0{               \
 # RUN:          global: c;                \
-# RUN:          local: *; }LIBSAMPLE_2.0;" > %t.script
+# RUN:       }LIBSAMPLE_2.0;" > %t.script
 # RUN: ld.lld --version-script %t.script -shared -soname shared %t.o -o %t.so
 # RUN: llvm-readobj -V -dyn-symbols %t.so | FileCheck --check-prefix=DSO %s
 
Index: ELF/SymbolListFile.cpp
===================================================================
--- ELF/SymbolListFile.cpp
+++ ELF/SymbolListFile.cpp
@@ -84,14 +84,13 @@
 
 void VersionScriptParser::parseVersion(StringRef Version) {
   expect("{");
-  if (peek() == "global:") {
-    next();
+  if (peek() != "local:") {
+    if (peek() == "global:")
+      next();
     parseVersionSymbols(Version);
   }
   if (peek() == "local:")
     parseLocal();
-  else
-    parseVersionSymbols(Version);
 
   expect("}");
   if (!Version.empty() && peek() != ";")


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21640.61660.patch
Type: text/x-patch
Size: 1135 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160623/74c8b13c/attachment.bin>


More information about the llvm-commits mailing list