41 lines · plain
1# REQUIRES: x862# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t3 4## Check that padding of executable sections are filled with trap bytes if not5## otherwise specified in the script.6# RUN: echo "SECTIONS { .exec : { *(.exec*) } }" > %t.script7# RUN: ld.lld -o %t.out --script %t.script %t8# RUN: llvm-objdump -s %t.out | FileCheck %s --check-prefix=EXEC9# EXEC: 0000 66cccccc cccccccc cccccccc cccccccc10# EXEC-NEXT: 0010 6611 12## Check that a fill expression or command overrides the default filler...13# RUN: echo "SECTIONS { .exec : { *(.exec*) }=0x11223344 }" > %t2.script14# RUN: ld.lld -o %t2.out --script %t2.script %t15# RUN: llvm-objdump -s %t2.out | FileCheck %s --check-prefix=OVERRIDE16# RUN: echo "SECTIONS { .exec : { FILL(0x11223344); *(.exec*) } }" > %t3.script17# RUN: ld.lld -o %t3.out --script %t3.script %t18# RUN: llvm-objdump -s %t3.out | FileCheck %s --check-prefix=OVERRIDE19# OVERRIDE: Contents of section .exec:20# OVERRIDE-NEXT: 0000 66112233 44112233 44112233 4411223321# OVERRIDE-NEXT: 0010 6622 23## ...even for a value of zero.24# RUN: echo "SECTIONS { .exec : { *(.exec*) }=0x00000000 }" > %t4.script25# RUN: ld.lld -o %t4.out --script %t4.script %t26# RUN: llvm-objdump -s %t4.out | FileCheck %s --check-prefix=ZERO27# RUN: echo "SECTIONS { .exec : { FILL(0x00000000); *(.exec*) } }" > %t5.script28# RUN: ld.lld -o %t5.out --script %t5.script %t29# RUN: llvm-objdump -s %t5.out | FileCheck %s --check-prefix=ZERO30# ZERO: Contents of section .exec:31# ZERO-NEXT: 0000 66000000 00000000 00000000 0000000032# ZERO-NEXT: 0010 6633 34.section .exec.1,"ax"35.align 1636.byte 0x6637 38.section .exec.2,"ax"39.align 1640.byte 0x6641