[PATCH] D24831: [ELF] - Linkerscript: accept space between '=' and expression in section filler.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 23 00:44:39 PDT 2016


grimar updated the summary for this revision.
grimar updated this revision to Diff 72237.
grimar added a comment.

- Addressed review comments.


https://reviews.llvm.org/D24831

Files:
  ELF/LinkerScript.cpp
  test/ELF/linkerscript/sections-padding.s

Index: test/ELF/linkerscript/sections-padding.s
===================================================================
--- test/ELF/linkerscript/sections-padding.s
+++ test/ELF/linkerscript/sections-padding.s
@@ -31,6 +31,11 @@
 # RUN:   | FileCheck --check-prefix=ERR2 %s
 # ERR2: invalid filler expression: 0x99XX
 
+## Check case with space between '=' and expression:
+# RUN: echo "SECTIONS { .mysec : { *(.mysec*) } = 0x1122 }" > %t.script
+# RUN: ld.lld -o %t.out --script %t.script %t
+# RUN: llvm-objdump -s %t.out | FileCheck -check-prefix=YES %s
+
 .section        .mysec.1,"a"
 .align  16
 .byte   0x66
Index: ELF/LinkerScript.cpp
===================================================================
--- ELF/LinkerScript.cpp
+++ ELF/LinkerScript.cpp
@@ -1217,8 +1217,12 @@
       setError("unknown command " + Tok);
   }
   Cmd->Phdrs = readOutputSectionPhdrs();
-  if (peek().startswith("="))
+
+  if (skip("="))
+    Cmd->Filler = readOutputSectionFiller(next());
+  else if (peek().startswith("="))
     Cmd->Filler = readOutputSectionFiller(next().drop_front());
+
   return Cmd;
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24831.72237.patch
Type: text/x-patch
Size: 1096 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160923/b9ae4590/attachment.bin>


More information about the llvm-commits mailing list