2019-09-07 18:42:11 +08:00
|
|
|
# REQUIRES: x86
|
2016-10-28 01:28:56 +08:00
|
|
|
|
2019-09-07 18:42:11 +08:00
|
|
|
## Don't relax R_X86_64_GOTPCRELX to an absolute symbol.
|
|
|
|
## In -no-pie mode, it can be relaxed, but it may not worth it.
|
2016-10-28 01:28:56 +08:00
|
|
|
|
2019-09-07 18:42:11 +08:00
|
|
|
# RUN: llvm-mc -filetype=obj -relax-relocations -triple=x86_64 %s -o %t.o
|
|
|
|
# RUN: ld.lld %t.o -o %t.so -shared
|
|
|
|
# RUN: llvm-objdump -d %t.so | FileCheck %s
|
|
|
|
|
2019-09-16 15:05:34 +08:00
|
|
|
# CHECK: movq 4209(%rip), %rax
|
2016-10-28 01:28:56 +08:00
|
|
|
|
|
|
|
movq bar@GOTPCREL(%rip), %rax
|
|
|
|
.data
|
|
|
|
.global bar
|
|
|
|
.hidden bar
|
|
|
|
bar = 42
|