[PATCH] D57987: lld: unquote possibly quoted `EXTERN("symbol")` entry in linker script
Lucian Adrian Grijincu via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 8 17:22:10 PST 2019
luciang updated this revision to Diff 186081.
luciang added a comment.
Update test/ELF/undefined-opt.s to verify quoted symbol correctly unquoted
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D57987/new/
https://reviews.llvm.org/D57987
Files:
lld/ELF/ScriptParser.cpp
lld/test/ELF/linkerscript/linkerscript.s
lld/test/ELF/undefined-opt.s
Index: lld/test/ELF/undefined-opt.s
===================================================================
--- lld/test/ELF/undefined-opt.s
+++ lld/test/ELF/undefined-opt.s
@@ -40,7 +40,7 @@
# TWO-UNDEFINED: Name: zed
# TWO-UNDEFINED: ]
# Now the same logic but linker script is used to set undefines
-# RUN: echo "EXTERN( bar abs )" > %t.script
+# RUN: echo "EXTERN( bar \"abs\" )" > %t.script
# RUN: ld.lld -o %t3 %t.o %tar.a %t.script
# RUN: llvm-readobj --symbols %t3 | FileCheck --check-prefix=TWO-UNDEFINED %s
Index: lld/test/ELF/linkerscript/linkerscript.s
===================================================================
--- lld/test/ELF/linkerscript/linkerscript.s
+++ lld/test/ELF/linkerscript/linkerscript.s
@@ -3,7 +3,7 @@
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux \
# RUN: %p/Inputs/libsearch-st.s -o %t2.o
-# RUN: echo "EXTERN( undef undef2 )" > %t.script
+# RUN: echo "EXTERN( undef undef2 \"undef3\" \"undef4@@other\")" > %t.script
# RUN: ld.lld %t -o %t2 %t.script
# RUN: llvm-readobj %t2 > /dev/null
Index: lld/ELF/ScriptParser.cpp
===================================================================
--- lld/ELF/ScriptParser.cpp
+++ lld/ELF/ScriptParser.cpp
@@ -329,7 +329,7 @@
void ScriptParser::readExtern() {
expect("(");
while (!errorCount() && !consume(")"))
- Config->Undefined.push_back(next());
+ Config->Undefined.push_back(unquote(next()));
}
void ScriptParser::readGroup() {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57987.186081.patch
Type: text/x-patch
Size: 1454 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190209/16eb944f/attachment.bin>
More information about the llvm-commits
mailing list