[PATCH] D64130: [LLD][ELF] - Linkerscript: add a support for expressions for section's filling
George Rimar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 10 05:08:36 PDT 2019
grimar added a comment.
In D64130#1571560 <https://reviews.llvm.org/D64130#1571560>, @andrewng wrote:
> This change breaks if you add `FILL(0x10101010)` before `*(.aaa)` in fill.test:
>
> # REQUIRES: x86
> # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/fill.s -o %t.o
> # RUN: ld.lld -o %t --script %s %t.o
> # RUN: llvm-objdump -s %t | FileCheck %s
>
> SECTIONS {
> .out : {
> FILL(0x11111111)
> . += 2;
> FILL(0x10101010)
> *(.aaa)
> . += 4;
> *(.bbb)
> . += 4;
> FILL(0x22220000 + 0x2222);
> . += 4;
> }
> }
>
> # CHECK: Contents of section .out:
> # CHECK-NEXT: 2222aa22 222222bb 22222222 22222222
>
>
> That's because the expression for the `FILL` command should be contained **within** the parentheses.
I posted D64476 <https://reviews.llvm.org/D64476> to fix.
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D64130/new/
https://reviews.llvm.org/D64130
More information about the llvm-commits
mailing list