2016-04-24 09:56:02 +08:00
|
|
|
// RUN: llvm-mc -filetype=obj -relax-relocations -triple x86_64-pc-linux-gnu \
|
|
|
|
// RUN: %s -o %t.o
|
|
|
|
// RUN: llvm-readobj -r %t.o | FileCheck --check-prefix=RELS %s
|
|
|
|
// RUN: ld.lld %t.o -o %t.so -shared
|
2016-04-20 04:18:52 +08:00
|
|
|
// RUN: llvm-readobj -s -r %t.so | FileCheck %s
|
|
|
|
|
2016-04-20 04:52:28 +08:00
|
|
|
movq foo@GOTPCREL(%rip), %rax
|
2016-05-28 23:38:13 +08:00
|
|
|
movq bar@GOTPCREL(%rip), %rax
|
2016-04-20 04:52:28 +08:00
|
|
|
|
2016-04-24 09:56:02 +08:00
|
|
|
// RELS: Relocations [
|
|
|
|
// RELS-NEXT: Section ({{.*}}) .rela.text {
|
2016-05-28 23:38:13 +08:00
|
|
|
// RELS-NEXT: R_X86_64_REX_GOTPCRELX foo 0xFFFFFFFFFFFFFFFC
|
|
|
|
// RELS-NEXT: R_X86_64_REX_GOTPCRELX bar 0xFFFFFFFFFFFFFFFC
|
2016-04-24 09:56:02 +08:00
|
|
|
// RELS-NEXT: }
|
|
|
|
// RELS-NEXT: ]
|
|
|
|
|
2016-04-20 04:18:52 +08:00
|
|
|
// CHECK: Name: .got
|
|
|
|
// CHECK-NEXT: Type: SHT_PROGBITS
|
|
|
|
// CHECK-NEXT: Flags [
|
|
|
|
// CHECK-NEXT: SHF_ALLOC
|
|
|
|
// CHECK-NEXT: SHF_WRITE
|
|
|
|
// CHECK-NEXT: ]
|
|
|
|
// CHECK-NEXT: Address: 0x2090
|
|
|
|
|
|
|
|
// CHECK: Relocations [
|
|
|
|
// CHECK-NEXT: Section ({{.*}}) .rela.dyn {
|
|
|
|
// CHECK-NEXT: 0x2098 R_X86_64_GLOB_DAT bar 0x0
|
2016-05-10 23:47:57 +08:00
|
|
|
// CHECK-NEXT: 0x2090 R_X86_64_GLOB_DAT foo 0x0
|
2016-04-20 04:18:52 +08:00
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: ]
|