32 lines · plain
1# REQUIRES: x862# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t3 4# RUN: echo "MEMORY { \5# RUN: ram (rwx) : ORIGIN = 0x8000, LENGTH = 256K \6# RUN: } \7# RUN: SECTIONS { \8# RUN: origin = ORIGIN(ram); \9# RUN: length = LENGTH(ram); \10# RUN: end = ORIGIN(ram) + LENGTH(ram); \11# RUN: }" > %t.script12# RUN: ld.lld -o %t1 --script %t.script %t13# RUN: llvm-nm -p %t1 | FileCheck %s14 15# CHECK: 0000000000008000 T _start16# CHECK-NEXT: 0000000000008000 A origin17# CHECK-NEXT: 0000000000040000 A length18# CHECK-NEXT: 0000000000048000 A end19 20# RUN: echo "SECTIONS { \21# RUN: no_exist_origin = ORIGIN(ram); \22# RUN: no_exist_length = LENGTH(ram); \23# RUN: }" > %t2.script24# RUN: not ld.lld -o /dev/null --script %t2.script %t 2>&1 \25# RUN: | FileCheck -check-prefix=ERR %s26# ERR: {{.*}}.script:1: memory region not defined: ram27 28 29.global _start30_start:31 nop32