1# REQUIRES: x86 2# RUN: echo '.section .text,"ax"; .quad 0' > %t.s 3# RUN: echo '.section .data,"aw"; .quad 0' >> %t.s 4# RUN: llvm-mc -filetype=obj -triple=x86_64 %t.s -o %t.o 5# RUN: ld.lld %t.o --script %s -o %t 6# RUN: llvm-readelf -l %t | FileCheck %s 7 8# CHECK: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align 9# CHECK-NEXT: LOAD 0x001000 0x0000000000001000 0x0000000000001000 0x000008 0x000008 R E 0x1000 10# CHECK-NEXT: LOAD 0x002000 0x0000000000002000 0x0000000000001008 0x000008 0x000008 RW 0x1000 11 12MEMORY { 13 FLASH (rx) : ORIGIN = 0x1000, LENGTH = 0x100 14 RAM (rwx) : ORIGIN = 0x2000, LENGTH = 0x100 15} 16 17SECTIONS { 18 .text : { *(.text*) } > FLASH 19 __etext = .; 20 .data : AT (__etext) { *(.data*) } > RAM 21} 22