Skip to content

Commit

Permalink
Handle OUTPUT_FORMAT arguments in quotation marks
Browse files Browse the repository at this point in the history
llvm-svn: 346068
  • Loading branch information
gkistanova committed Nov 3, 2018
1 parent 3c617b2 commit 4ec5d67
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lld/ELF/ScriptParser.cpp
Expand Up @@ -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")
Expand Down
6 changes: 6 additions & 0 deletions lld/test/ELF/format-binary.test
Expand Up @@ -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

0 comments on commit 4ec5d67

Please sign in to comment.