32 lines · plain
1# REQUIRES: x862 3# RUN: echo '.section .text,"ax"; .global _start; nop' > %t.s4# RUN: echo '.section .data,"aw"; .quad 0' >> %t.s5# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %t.s -o %t.o6 7## Empty include file.8# RUN: rm -rf %t.dir && mkdir -p %t.dir9# RUN: echo "" > %t.dir/inc.script10# RUN: ld.lld -o %t.elf --script %s %t.o -L %t.dir11# RUN: llvm-objdump --section-headers %t.elf | FileCheck %s --check-prefix=CHECK112# CHECK1: .data 00000008 0000000000002000 DATA13 14## Non-empty include file.15# RUN: echo "QUAD(0)" > %t.dir/inc.script16# RUN: ld.lld -o %t.elf --script %s %t.o -L %t.dir17# RUN: llvm-objdump --section-headers %t.elf | FileCheck %s --check-prefix=CHECK218# CHECK2: .data 00000010 0000000000002000 DATA19 20MEMORY {21 ROM (rwx): ORIGIN = 0x1000, LENGTH = 0x10022 RAM (rwx): ORIGIN = 0x2000, LENGTH = 0x10023}24 25SECTIONS {26 .text : { *(.text*) } > ROM27 .data : {28 *(.data*)29 INCLUDE "inc.script"30 } > RAM31}32