[lld] r346068 - Handle OUTPUT_FORMAT arguments in quotation marks
Galina Kistanova via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 2 22:25:49 PDT 2018
Author: gkistanova
Date: Fri Nov 2 22:25:49 2018
New Revision: 346068
URL: http://llvm.org/viewvc/llvm-project?rev=346068&view=rev
Log:
Handle OUTPUT_FORMAT arguments in quotation marks
Modified:
lld/trunk/ELF/ScriptParser.cpp
lld/trunk/test/ELF/format-binary.test
Modified: lld/trunk/ELF/ScriptParser.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/ScriptParser.cpp?rev=346068&r1=346067&r2=346068&view=diff
==============================================================================
--- lld/trunk/ELF/ScriptParser.cpp (original)
+++ lld/trunk/ELF/ScriptParser.cpp Fri Nov 2 22:25:49 2018
@@ -384,7 +384,7 @@ void ScriptParser::readOutputArch() {
}
std::pair<ELFKind, uint16_t> ScriptParser::readBfdName() {
- StringRef S = next();
+ StringRef S = unquote(next());
if (S == "elf32-i386")
return {ELF32LEKind, EM_386};
if (S == "elf32-iamcu")
Modified: lld/trunk/test/ELF/format-binary.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/format-binary.test?rev=346068&r1=346067&r2=346068&view=diff
==============================================================================
--- lld/trunk/test/ELF/format-binary.test (original)
+++ lld/trunk/test/ELF/format-binary.test Fri Nov 2 22:25:49 2018
@@ -61,3 +61,9 @@
# RUN: llvm-readobj %t.out -sections -section-data -symbols | FileCheck -check-prefix=X86-64 %s
# X86-64: Format: ELF64-x86-64
+
+# RUN: echo 'OUTPUT_FORMAT("elf64-x86-64")' > %t.script
+# RUN: ld.lld -b binary %t.binary -T %t.script -o %t.out
+# RUN: llvm-readobj %t.out -sections -section-data -symbols | FileCheck -check-prefix=X86-64-in-quotes %s
+
+# X86-64-in-quotes: Format: ELF64-x86-64
More information about the llvm-commits
mailing list