summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lld/ELF/LinkerScript.cpp2
-rw-r--r--lld/test/elf2/linkerscript.s8
2 files changed, 10 insertions, 0 deletions
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp
index fcafc66407d..2a63be4ca5d 100644
--- a/lld/ELF/LinkerScript.cpp
+++ b/lld/ELF/LinkerScript.cpp
@@ -59,6 +59,8 @@ private:
void LinkerScript::run() {
while (!atEOF()) {
StringRef Tok = next();
+ if (Tok == ";")
+ continue;
if (Tok == "ENTRY") {
readEntry();
} else if (Tok == "GROUP" || Tok == "INPUT") {
diff --git a/lld/test/elf2/linkerscript.s b/lld/test/elf2/linkerscript.s
index 472371d9059..67d580d06a3 100644
--- a/lld/test/elf2/linkerscript.s
+++ b/lld/test/elf2/linkerscript.s
@@ -76,6 +76,14 @@
# RUN: ld.lld2 %t.script %t
# RUN: llvm-readobj %t.out > /dev/null
+# RUN: echo ";SEARCH_DIR(x);SEARCH_DIR(y);" > %t.script
+# RUN: ld.lld2 %t.script %t
+# RUN: llvm-readobj %t.out > /dev/null
+
+# RUN: echo ";" > %t.script
+# RUN: ld.lld2 %t.script %t
+# RUN: llvm-readobj %t.out > /dev/null
+
# RUN: echo "INCLUDE " %t.script2 "OUTPUT(" %t.out ")" > %t.script1
# RUN: echo "GROUP(" %t ")" > %t.script2
# RUN: ld.lld2 %t.script1
OpenPOWER on IntegriCloud