[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 06:38:03 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL282248: [ELF] - Linkerscript: accept space between '=' and expression in section filler. (authored by grimar).

Changed prior to commit:
  https://reviews.llvm.org/D24831?vs=72237&id=72271#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D24831

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

Index: lld/trunk/test/ELF/linkerscript/sections-padding.s
===================================================================
--- lld/trunk/test/ELF/linkerscript/sections-padding.s
+++ lld/trunk/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: lld/trunk/ELF/LinkerScript.cpp
===================================================================
--- lld/trunk/ELF/LinkerScript.cpp
+++ lld/trunk/ELF/LinkerScript.cpp
@@ -1275,8 +1275,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.72271.patch
Type: text/x-patch
Size: 1156 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160923/e8b7c428/attachment.bin>


More information about the llvm-commits mailing list