[PATCH] D28803: [ELF] - Support optional comma after output section command.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 17 07:43:19 PST 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL292225: [ELF] - Support optional comma after output section command. (authored by grimar).

Changed prior to commit:
  https://reviews.llvm.org/D28803?vs=84657&id=84673#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D28803

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
@@ -36,6 +36,11 @@
 # RUN: ld.lld -o %t.out --script %t.script %t
 # RUN: llvm-objdump -s %t.out | FileCheck -check-prefix=YES %s
 
+## Check case with optional comma following output section command:
+# RUN: echo "SECTIONS { .mysec : { *(.mysec*) } =0x1122, .a : { *(.a*) } }" > %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
@@ -1471,6 +1471,9 @@
   else if (peek().startswith("="))
     Cmd->Filler = readOutputSectionFiller(next().drop_front());
 
+  // Consume optional comma following output section command.
+  consume(",");
+
   return Cmd;
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28803.84673.patch
Type: text/x-patch
Size: 1098 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170117/292f7e45/attachment.bin>


More information about the llvm-commits mailing list