2017-09-21 03:24:57 +08:00
|
|
|
# REQUIRES: x86
|
|
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
|
|
|
|
|
|
|
|
# RUN: echo "SECTIONS { .text : { *(.text) } foo = ABSOLUTE(_start) + _start; };" > %t.script
|
|
|
|
# RUN: ld.lld -o %t --script %t.script %t.o
|
|
|
|
# RUN: llvm-objdump -t %t | FileCheck %s
|
|
|
|
|
|
|
|
# RUN: echo "SECTIONS { .text : { *(.text) } foo = _start + ABSOLUTE(_start); };" > %t.script
|
|
|
|
# RUN: ld.lld -o %t --script %t.script %t.o
|
|
|
|
# RUN: llvm-objdump -t %t | FileCheck %s
|
|
|
|
|
2020-03-05 09:19:18 +08:00
|
|
|
# CHECK: 0000000000000001 g .text 0000000000000000 _start
|
|
|
|
# CHECK: 0000000000000002 g .text 0000000000000000 foo
|
2017-09-21 03:24:57 +08:00
|
|
|
|
|
|
|
.global _start
|
|
|
|
nop
|
|
|
|
_start:
|