[PATCH] D57987: lld: unquote possibly quoted `EXTERN("symbol")` entry in linker script

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 11 14:01:35 PST 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL353756: lld: unquote possibly quoted `EXTERN("symbol")` entry in linker script. (authored by ruiu, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D57987?vs=186081&id=186328#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57987/new/

https://reviews.llvm.org/D57987

Files:
  lld/trunk/ELF/ScriptParser.cpp
  lld/trunk/test/ELF/linkerscript/linkerscript.s
  lld/trunk/test/ELF/undefined-opt.s


Index: lld/trunk/ELF/ScriptParser.cpp
===================================================================
--- lld/trunk/ELF/ScriptParser.cpp
+++ lld/trunk/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() {
Index: lld/trunk/test/ELF/linkerscript/linkerscript.s
===================================================================
--- lld/trunk/test/ELF/linkerscript/linkerscript.s
+++ lld/trunk/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/trunk/test/ELF/undefined-opt.s
===================================================================
--- lld/trunk/test/ELF/undefined-opt.s
+++ lld/trunk/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
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57987.186328.patch
Type: text/x-patch
Size: 1508 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190211/0d8d3eca/attachment-0001.bin>


More information about the llvm-commits mailing list