[llvm-branch-commits] [llvm-branch] r354257 - Merging r353907:

Hans Wennborg via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Feb 18 02:39:35 PST 2019


Author: hans
Date: Mon Feb 18 02:39:35 2019
New Revision: 354257

URL: http://llvm.org/viewvc/llvm-project?rev=354257&view=rev
Log:
Merging r353907:
------------------------------------------------------------------------
r353907 | rnk | 2019-02-13 02:39:32 +0100 (Wed, 13 Feb 2019) | 6 lines

[MC] Make symbol version errors non-fatal

We stil don't have a source location, which is pretty lame, but at least
we won't tell the user to file a clang bug report anymore.

Fixes PR40712
------------------------------------------------------------------------

Modified:
    llvm/branches/release_80/   (props changed)
    llvm/branches/release_80/lib/MC/ELFObjectWriter.cpp
    llvm/branches/release_80/test/MC/ELF/invalid-symver.s
    llvm/branches/release_80/test/MC/ELF/multiple-different-symver.s

Propchange: llvm/branches/release_80/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Feb 18 02:39:35 2019
@@ -1,3 +1,3 @@
 /llvm/branches/Apple/Pertwee:110850,110961
 /llvm/branches/type-system-rewrite:133420-134817
-/llvm/trunk:155241,351322,351325,351344-351345,351349,351351,351370,351381,351387,351421,351426,351436,351475,351485,351753-351754,351765,351910,351930,351932,352034,352204,352246,352374,352555,352607-352608,352707,352714,352770,352886,352889,352892,352895,352908,352917,352935,352945,353015,353061,353082,353138,353141,353155,353213,353218,353304,353308,353334,353367,353374,353383,353463,353480,353489,353551,353733,353758,353809,354128,354131,354144
+/llvm/trunk:155241,351322,351325,351344-351345,351349,351351,351370,351381,351387,351421,351426,351436,351475,351485,351753-351754,351765,351910,351930,351932,352034,352204,352246,352374,352555,352607-352608,352707,352714,352770,352886,352889,352892,352895,352908,352917,352935,352945,353015,353061,353082,353138,353141,353155,353213,353218,353304,353308,353334,353367,353374,353383,353463,353480,353489,353551,353733,353758,353809,353907,354128,354131,354144

Modified: llvm/branches/release_80/lib/MC/ELFObjectWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_80/lib/MC/ELFObjectWriter.cpp?rev=354257&r1=354256&r2=354257&view=diff
==============================================================================
--- llvm/branches/release_80/lib/MC/ELFObjectWriter.cpp (original)
+++ llvm/branches/release_80/lib/MC/ELFObjectWriter.cpp Mon Feb 18 02:39:35 2019
@@ -1275,14 +1275,20 @@ void ELFObjectWriter::executePostLayoutB
     if (!Symbol.isUndefined() && !Rest.startswith("@@@"))
       continue;
 
-    // FIXME: produce a better error message.
+    // FIXME: Get source locations for these errors or diagnose them earlier.
     if (Symbol.isUndefined() && Rest.startswith("@@") &&
-        !Rest.startswith("@@@"))
-      report_fatal_error("A @@ version cannot be undefined");
+        !Rest.startswith("@@@")) {
+      Asm.getContext().reportError(SMLoc(), "versioned symbol " + AliasName +
+                                                " must be defined");
+      continue;
+    }
 
-    if (Renames.count(&Symbol) && Renames[&Symbol] != Alias)
-      report_fatal_error(llvm::Twine("Multiple symbol versions defined for ") +
-                         Symbol.getName());
+    if (Renames.count(&Symbol) && Renames[&Symbol] != Alias) {
+      Asm.getContext().reportError(
+          SMLoc(), llvm::Twine("multiple symbol versions defined for ") +
+                       Symbol.getName());
+      continue;
+    }
 
     Renames.insert(std::make_pair(&Symbol, Alias));
   }

Modified: llvm/branches/release_80/test/MC/ELF/invalid-symver.s
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_80/test/MC/ELF/invalid-symver.s?rev=354257&r1=354256&r2=354257&view=diff
==============================================================================
--- llvm/branches/release_80/test/MC/ELF/invalid-symver.s (original)
+++ llvm/branches/release_80/test/MC/ELF/invalid-symver.s Mon Feb 18 02:39:35 2019
@@ -1,7 +1,7 @@
 // RUN: not llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o %t 2> %t.out
 // RUN: FileCheck --input-file=%t.out %s
 
-// CHECK: A @@ version cannot be undefined
+// CHECK: error: versioned symbol foo@@bar must be defined
 
         .symver undefined, foo@@bar
         .long undefined

Modified: llvm/branches/release_80/test/MC/ELF/multiple-different-symver.s
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_80/test/MC/ELF/multiple-different-symver.s?rev=354257&r1=354256&r2=354257&view=diff
==============================================================================
--- llvm/branches/release_80/test/MC/ELF/multiple-different-symver.s (original)
+++ llvm/branches/release_80/test/MC/ELF/multiple-different-symver.s Mon Feb 18 02:39:35 2019
@@ -1,6 +1,6 @@
 // RUN: not llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o %t 2>&1 | FileCheck %s
 
-// CHECK: Multiple symbol versions defined for foo
+// CHECK: error: multiple symbol versions defined for foo
 
 .symver foo, foo at 1
 .symver foo, foo at 2




More information about the llvm-branch-commits mailing list