38 lines · plain
1# REQUIRES: x862 3# RUN: echo ".section .foo,\"a\"" > %t.s4# RUN: echo ".quad 1" >> %t.s5# RUN: echo ".section .bar,\"a\"" >> %t.s6# RUN: echo ".quad 1" >> %t.s7# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %t.s -o %t.o8 9# RUN: ld.lld -o %t %t.o --script %s10# RUN: llvm-readelf -S -l %t | FileCheck %s11 12## Check that we can produce output without errors,13## and .foo section has proper size.14# CHECK: Section Headers:15# CHECK-NEXT: [Nr] Name Type Address Off Size16# CHECK-NEXT: [ 0] NULL 0000000000000000 000000 00000017# CHECK-NEXT: [ 1] .foo PROGBITS 0000000000001000 001000 00010818# CHECK-NEXT: [ 2] .bar PROGBITS 0000000000001108 001108 00000819 20## Check that load address is correct.21# CHECK: Program Headers:22# CHECK-NEXT: Type Offset VirtAddr PhysAddr FileSiz MemSiz23# CHECK-NEXT: LOAD 0x001000 0x0000000000001000 0x0000000000002000 0x000110 0x00011024 25MEMORY {26 ram (rwx) : org = 0x1000, len = 0x20027 flash (rwx) : org = 0x2000, len = 0x20028}29SECTIONS {30 .foo : {31 *(.foo)32 . += 0x100;33 } > ram AT>flash34 .bar : {35 *(.bar)36 } > ram AT>flash37}38