diff --git a/lld/ELF/ScriptParser.cpp b/lld/ELF/ScriptParser.cpp index 9a1e0d5263c4e..93988542d3bc8 100644 --- a/lld/ELF/ScriptParser.cpp +++ b/lld/ELF/ScriptParser.cpp @@ -351,7 +351,7 @@ void ScriptParser::readEntry() { expect("("); StringRef tok = next(); if (config->entry.empty()) - config->entry = tok; + config->entry = unquote(tok); expect(")"); } diff --git a/lld/test/ELF/linkerscript/entry.s b/lld/test/ELF/linkerscript/entry.s index ecf052b3548a7..2e9b9af23f4b2 100644 --- a/lld/test/ELF/linkerscript/entry.s +++ b/lld/test/ELF/linkerscript/entry.s @@ -6,6 +6,10 @@ # RUN: ld.lld %t.script %t.o -o %t # RUN: llvm-readelf -hs %t | FileCheck %s +# RUN: echo 'ENTRY("_label")' > %t.script +# RUN: ld.lld %t.script %t.o -o %t +# RUN: llvm-readelf -hs %t | FileCheck %s + # CHECK: Entry point address: 0x[[#%x,ENTRY:]] # CHECK: [[#]]: {{0*}}[[#ENTRY]] 0 NOTYPE GLOBAL DEFAULT [[#]] _label