1# REQUIRES: x86 2 3# RUN: echo ".section .foo,\"a\"" > %t.s 4# RUN: echo ".quad 1" >> %t.s 5# RUN: echo ".section .bar,\"a\"" >> %t.s 6# RUN: echo ".quad 1" >> %t.s 7# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %t.s -o %t.o 8 9# RUN: ld.lld -o %t %t.o --script %s 10# RUN: llvm-readelf -sections -program-headers %t | FileCheck %s 11 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 Size 16# CHECK-NEXT: [ 0] NULL 0000000000000000 000000 000000 17# CHECK-NEXT: [ 1] .foo PROGBITS 0000000000001000 001000 000108 18# CHECK-NEXT: [ 2] .bar PROGBITS 0000000000001108 001108 000008 19 20## Check that load address is correct. 21# CHECK: Program Headers: 22# CHECK-NEXT: Type Offset VirtAddr PhysAddr FileSiz MemSiz 23# CHECK-NEXT: LOAD 0x001000 0x0000000000001000 0x0000000000002000 0x000110 0x000110 24 25MEMORY { 26 ram (rwx) : org = 0x1000, len = 0x200 27 flash (rwx) : org = 0x2000, len = 0x200 28} 29SECTIONS { 30 .foo : { 31 *(.foo) 32 . += 0x100; 33 } > ram AT>flash 34 .bar : { 35 *(.bar) 36 } > ram AT>flash 37} 38