[PATCH] D128573: [lld] support quoted and unquoted entry symbol
Kamlesh Kumar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Jun 25 02:21:42 PDT 2022
kmistryic updated this revision to Diff 439960.
kmistryic added a comment.
Added test
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D128573/new/
https://reviews.llvm.org/D128573
Files:
lld/ELF/ScriptParser.cpp
lld/test/ELF/linkerscript/entry1.s
Index: lld/test/ELF/linkerscript/entry1.s
===================================================================
--- /dev/null
+++ 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
Index: lld/ELF/ScriptParser.cpp
===================================================================
--- lld/ELF/ScriptParser.cpp
+++ lld/ELF/ScriptParser.cpp
@@ -351,7 +351,7 @@
expect("(");
StringRef tok = next();
if (config->entry.empty())
- config->entry = tok;
+ config->entry = unquote(tok);
expect(")");
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D128573.439960.patch
Type: text/x-patch
Size: 933 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220625/a63ff3e9/attachment.bin>
More information about the llvm-commits
mailing list