2 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
3 # RUN: echo "SECTIONS { \
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); \
16 # RUN: ld.lld %t --script %t.script -o %t2
17 # RUN: llvm-objdump -t %t2 | FileCheck %s
18 # RUN: echo "SECTIONS { v = LOADADDR(.zzz); }" > %t.script
19 # RUN: not ld.lld %t --script %t.script -o /dev/null 2>&1 | FileCheck --check-prefix=ERROR %s
21 # CHECK: 0000000000002000 g *ABS* 0000000000000000 aaa_lma
22 # CHECK-NEXT: 0000000000002008 g *ABS* 0000000000000000 bbb_lma
23 # CHECK-NEXT: 0000000000003000 g *ABS* 0000000000000000 ccc_lma
24 # CHECK-NEXT: 0000000000004000 g *ABS* 0000000000000000 ddd_lma
25 # CHECK-NEXT: 0000000000004008 g *ABS* 0000000000000000 txt_lma
26 # ERROR: {{.*}}.script:1: undefined section .zzz