xref: /llvm-project/lld/test/ELF/linkerscript/absolute2.s (revision f9a0056016fb89c84b5663642d0c836430a3ad87)
1# REQUIRES: x86
2# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
3
4# RUN: echo "SECTIONS { .text : { *(.text) } foo = ABSOLUTE(_start) + _start; };" > %t.script
5# RUN: ld.lld -o %t --script %t.script %t.o
6# RUN: llvm-objdump -t %t | FileCheck %s
7
8# RUN: echo "SECTIONS { .text : { *(.text) } foo = _start + ABSOLUTE(_start); };" > %t.script
9# RUN: ld.lld -o %t --script %t.script %t.o
10# RUN: llvm-objdump -t %t | FileCheck %s
11
12# CHECK: 0000000000000001 g       .text  0000000000000000 _start
13# CHECK: 0000000000000002 g       .text  0000000000000000 foo
14
15        .global _start
16        nop
17_start:
18