1# REQUIRES: x86
2# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
3# RUN: echo "SECTIONS { foo = ABSOLUTE(.) + 1; };" > %t.script
4# RUN: ld.lld -o %t --script %t.script %t.o
5# RUN: llvm-readobj --symbols %t | FileCheck %s
6
7# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
8# RUN: echo "PROVIDE(foo = 1 + ABSOLUTE(ADDR(.text)));" > %t.script
9# RUN: ld.lld -o %t --script %t.script %t.o
10# RUN: llvm-readobj --symbols %t | FileCheck --check-prefix=CHECK-RHS %s
11
12# CHECK:        Name: foo
13# CHECK-NEXT:   Value:
14# CHECK-NEXT:   Size:
15# CHECK-NEXT:   Binding:
16# CHECK-NEXT:   Type:
17# CHECK-NEXT:   Other:
18# CHECK-NEXT:   Section: Absolute
19# CHECK-NEXT: }
20
21# CHECK-RHS:        Name: foo
22# CHECK-RHS-NEXT:   Value: 0x201121
23# CHECK-RHS-NEXT:   Size:
24# CHECK-RHS-NEXT:   Binding:
25# CHECK-RHS-NEXT:   Type:
26# CHECK-RHS-NEXT:   Other:
27# CHECK-RHS-NEXT:   Section: Absolute
28# CHECK-RHS-NEXT: }
29
30.text
31.globl _start
32_start:
33 nop
34
35.global foo
36