43 lines · plain
1# REQUIRES: x862# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t3# RUN: echo "SECTIONS { \4# RUN: . = 0x1000; \5# RUN: .aaa : AT(0x2000) { *(.aaa) } \6# RUN: .bbb : { *(.bbb) } \7# RUN: .ccc : AT(0x3000) { *(.ccc) } \8# RUN: .ddd : AT(0x4000) { *(.ddd) } \9# RUN: .text : { *(.text) } \10# RUN: aaa_lma = LOADADDR(.aaa); \11# RUN: bbb_lma = LOADADDR(.bbb); \12# RUN: ccc_lma = LOADADDR(.ccc); \13# RUN: ddd_lma = LOADADDR(.ddd); \14# RUN: txt_lma = LOADADDR(.text); \15# RUN: }" > %t.script16# RUN: ld.lld %t --script %t.script -o %t217# RUN: llvm-objdump -t %t2 | FileCheck %s18# RUN: echo "SECTIONS { v = LOADADDR(.zzz); }" > %t.script19# RUN: not ld.lld %t --script %t.script -o /dev/null 2>&1 | FileCheck --check-prefix=ERROR %s20 21# CHECK: 0000000000002000 g *ABS* 0000000000000000 aaa_lma22# CHECK-NEXT: 0000000000002008 g *ABS* 0000000000000000 bbb_lma23# CHECK-NEXT: 0000000000003000 g *ABS* 0000000000000000 ccc_lma24# CHECK-NEXT: 0000000000004000 g *ABS* 0000000000000000 ddd_lma25# CHECK-NEXT: 0000000000004008 g *ABS* 0000000000000000 txt_lma26# ERROR: {{.*}}.script:1: undefined section .zzz27 28.global _start29_start:30 nop31 32.section .aaa, "a"33.quad 034 35.section .bbb, "a"36.quad 037 38.section .ccc, "a"39.quad 040 41.section .ddd, "a"42.quad 043