diff --git a/lld/ELF/ScriptParser.cpp b/lld/ELF/ScriptParser.cpp --- a/lld/ELF/ScriptParser.cpp +++ b/lld/ELF/ScriptParser.cpp @@ -351,7 +351,7 @@ expect("("); StringRef tok = next(); if (config->entry.empty()) - config->entry = tok; + config->entry = unquote(tok); expect(")"); } diff --git a/lld/test/ELF/linkerscript/entry1.s b/lld/test/ELF/linkerscript/entry1.s new file mode 100644 --- /dev/null +++ b/lld/test/ELF/linkerscript/entry1.s @@ -0,0 +1,9 @@ +// REQUIRES: x86 +// RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t +// RUN: echo "ENTRY(\"__start\")" > %t.script +// RUN: ld.lld -T %t.script %t -o %tout2 2>&1 | Filecheck %s +// CHECK: ld.lld: warning: cannot find entry symbol __start; not setting start address +// CHECK-NOT: ld.lld: warning: cannot find entry symbol {{\"__start\"}}; not setting start address +.global _foo_ +_foo_: + retq