[PATCH] D24831: [ELF] - Linkerscript: accept space between '=' and expression in section filler.
Rafael Avila de Espindola via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 23 06:29:24 PDT 2016
I wonder if we should change the lexer to always spilt the =.
In any case, LGTM.
On September 23, 2016 3:44:39 AM EDT, George Rimar <grimar at accesssoftek.com> wrote:
>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;
> }
>
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160923/52a9d5a9/attachment.html>
More information about the llvm-commits
mailing list