2016-10-20 07:11:21 +08:00
|
|
|
# REQUIRES: x86
|
|
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
|
|
|
|
# RUN: echo "SECTIONS { foo = ABSOLUTE(.) + 1; };" > %t.script
|
|
|
|
# RUN: ld.lld -o %t --script %t.script %t.o
|
|
|
|
# RUN: llvm-readobj --symbols %t | FileCheck %s
|
|
|
|
|
2017-03-15 11:33:23 +08:00
|
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
|
|
|
|
# RUN: echo "PROVIDE(foo = 1 + ABSOLUTE(ADDR(.text)));" > %t.script
|
|
|
|
# RUN: ld.lld -o %t --script %t.script %t.o
|
|
|
|
# RUN: llvm-readobj --symbols %t | FileCheck --check-prefix=CHECK-RHS %s
|
|
|
|
|
2016-10-20 07:11:21 +08:00
|
|
|
# CHECK: Name: foo
|
|
|
|
# CHECK-NEXT: Value:
|
|
|
|
# CHECK-NEXT: Size:
|
|
|
|
# CHECK-NEXT: Binding:
|
|
|
|
# CHECK-NEXT: Type:
|
|
|
|
# CHECK-NEXT: Other:
|
|
|
|
# CHECK-NEXT: Section: Absolute
|
|
|
|
# CHECK-NEXT: }
|
|
|
|
|
2017-03-15 11:33:23 +08:00
|
|
|
# CHECK-RHS: Name: foo
|
2019-09-16 15:05:34 +08:00
|
|
|
# CHECK-RHS-NEXT: Value: 0x201121
|
2017-03-15 11:33:23 +08:00
|
|
|
# CHECK-RHS-NEXT: Size:
|
|
|
|
# CHECK-RHS-NEXT: Binding:
|
|
|
|
# CHECK-RHS-NEXT: Type:
|
|
|
|
# CHECK-RHS-NEXT: Other:
|
|
|
|
# CHECK-RHS-NEXT: Section: Absolute
|
|
|
|
# CHECK-RHS-NEXT: }
|
|
|
|
|
2016-10-20 07:11:21 +08:00
|
|
|
.text
|
|
|
|
.globl _start
|
|
|
|
_start:
|
2017-03-15 11:33:23 +08:00
|
|
|
nop
|
|
|
|
|
|
|
|
.global foo
|