[PATCH] D64130: [LLD][ELF] - Linkerscript: add a support for expressions for section's filling

Andrew Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 5 08:32:40 PDT 2019


andrewng added a comment.

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.


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