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 parseEmulation(StringRef S) { +static std::pair 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; } 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