2017-07-19 02:40:50 +08:00
|
|
|
# REQUIRES: x86
|
2019-09-09 11:35:14 +08:00
|
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64 %p/Inputs/dummy-shared.s -o %t1.o
|
2019-03-18 23:32:57 +08:00
|
|
|
# RUN: ld.lld %t1.o -shared -o %t1.so
|
2019-09-09 11:35:14 +08:00
|
|
|
# RUN: llvm-mc -filetype=obj -relax-relocations=false -triple=x86_64 %s -o %t.o
|
|
|
|
|
|
|
|
# RUN: ld.lld -pie %t.o %t1.so -o %t
|
2016-04-13 10:24:48 +08:00
|
|
|
# RUN: llvm-readobj -r %t | FileCheck --check-prefix=RELOCS %s
|
2019-09-09 11:35:14 +08:00
|
|
|
# RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck --check-prefix=DISASM %s
|
2016-04-13 10:24:48 +08:00
|
|
|
|
|
|
|
# RELOCS: Relocations [
|
2017-09-16 02:05:02 +08:00
|
|
|
# RELOCS-NEXT: Section ({{.*}}) .rela.dyn {
|
|
|
|
# RELOCS-NEXT: R_X86_64_GLOB_DAT foo 0x0
|
|
|
|
# RELOCS-NEXT: }
|
2016-04-13 10:24:48 +08:00
|
|
|
# RELOCS-NEXT: ]
|
|
|
|
|
|
|
|
.weak foo
|
|
|
|
|
|
|
|
.globl _start
|
|
|
|
_start:
|
2020-03-06 06:18:38 +08:00
|
|
|
# DISASM: <_start>:
|
2019-09-09 11:35:14 +08:00
|
|
|
# DISASM-NEXT: movq {{.*}}(%rip), %rax
|
2016-04-13 10:24:48 +08:00
|
|
|
mov foo@gotpcrel(%rip), %rax
|