[PATCH] D24357: Report original emulation name in "unknown emulation" error

Ed Maste via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 8 12:44:49 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL280983: ELF: Report original emulation name in "unknown emulation" error (authored by emaste).

Changed prior to commit:
  https://reviews.llvm.org/D24357?vs=70739&id=70742#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D24357

Files:
  lld/trunk/ELF/Driver.cpp
  lld/trunk/test/ELF/basic.s

Index: lld/trunk/test/ELF/basic.s
===================================================================
--- lld/trunk/test/ELF/basic.s
+++ lld/trunk/test/ELF/basic.s
@@ -223,8 +223,8 @@
 # RUN: not ld.lld %t %t -o %t2 2>&1 | FileCheck --check-prefix=DUP %s
 # DUP: duplicate symbol: _start in {{.*}} and {{.*}}
 
-# RUN: not ld.lld %t -o %t -m wrong_emul 2>&1 | FileCheck --check-prefix=UNKNOWN_EMUL %s
-# UNKNOWN_EMUL: unknown emulation: wrong_emul
+# RUN: not ld.lld %t -o %t -m wrong_emul_fbsd 2>&1 | FileCheck --check-prefix=UNKNOWN_EMUL %s
+# UNKNOWN_EMUL: unknown emulation: wrong_emul_fbsd
 
 # RUN: not ld.lld %t --lto-jobs=0 2>&1 | FileCheck --check-prefix=NOTHREADS %s
 # NOTHREADS: number of threads must be > 0
Index: lld/trunk/ELF/Driver.cpp
===================================================================
--- lld/trunk/ELF/Driver.cpp
+++ lld/trunk/ELF/Driver.cpp
@@ -54,7 +54,8 @@
 }
 
 // Parses a linker -m option.
-static std::pair<ELFKind, uint16_t> parseEmulation(StringRef S) {
+static std::pair<ELFKind, uint16_t> parseEmulation(StringRef Emul) {
+  StringRef S = Emul;
   if (S.endswith("_fbsd"))
     S = S.drop_back(5);
 
@@ -78,9 +79,9 @@
 
   if (Ret.first == ELFNoneKind) {
     if (S == "i386pe" || S == "i386pep" || S == "thumb2pe")
-      error("Windows targets are not supported on the ELF frontend: " + S);
+      error("Windows targets are not supported on the ELF frontend: " + Emul);
     else
-      error("unknown emulation: " + S);
+      error("unknown emulation: " + Emul);
   }
   return Ret;
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24357.70742.patch
Type: text/x-patch
Size: 1539 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160908/c67edbbf/attachment.bin>


More information about the llvm-commits mailing list