[PATCH] D18499: [ELF] - Implemented prototype of location counter support.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 28 13:54:57 PDT 2016


grimar added a comment.

In http://reviews.llvm.org/D18499#384634, @ruiu wrote:

> Can you add a test to demonstrate what this patch will do? It doesn't have to be comprehensive at this moment though.
>
> Also, please remove code to support all arithmetic operators but '+' and parentheses. You can start from supporting only '+' and add other operators later.


I can remove all operators except '!=', '?:', '/', '+' and parentheses because all of them are used in the test mentioned (linkerscript-locationcounter.s).
All cases except one that uses '*' I took from real bsd script, so it is important part of the test which demonstrates real live situations:

1. RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
2. RUN: echo "SECTIONS { \
3. RUN:  . = 0x12341; \
4. RUN:  .data : { *(.data) } \
5. RUN:  . = ALIGN(. != 0 ? 64 / 8 : 1); \
6. RUN:  .text : { *(.text) } \
7. RUN:  . = ALIGN(64 / 2); \
8. RUN:  .temp : { *(.temp) } \
9. RUN:  . = (. + 0x100) * 2;\
10. RUN:  .boo : { *(.boo) } \
11. RUN: }" > %t.script


http://reviews.llvm.org/D18499





More information about the llvm-commits mailing list