2015-10-07 08:58:20 +08:00
|
|
|
// RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
|
2015-11-18 14:11:01 +08:00
|
|
|
// RUN: ld.lld %t.o -o %t -shared
|
2015-10-07 08:58:20 +08:00
|
|
|
// RUN: llvm-readobj -s -r %t | FileCheck %s
|
|
|
|
// RUN: llvm-objdump -d %t | FileCheck --check-prefix=DISASM %s
|
|
|
|
|
|
|
|
bar:
|
|
|
|
call foo@gotpcrel
|
|
|
|
|
|
|
|
.hidden foo
|
|
|
|
.global foo
|
|
|
|
foo:
|
|
|
|
nop
|
|
|
|
|
2015-10-11 07:25:39 +08:00
|
|
|
// 0x2090 - 0x1000 - 5 = 4235
|
2015-10-07 08:58:20 +08:00
|
|
|
// DISASM: bar:
|
2015-10-11 07:25:39 +08:00
|
|
|
// DISASM-NEXT: 1000: {{.*}} callq 4235
|
2015-10-07 08:58:20 +08:00
|
|
|
|
|
|
|
// DISASM: foo:
|
2015-10-11 07:25:39 +08:00
|
|
|
// DISASM-NEXT: 1005: {{.*}} nop
|
2015-10-07 08:58:20 +08:00
|
|
|
|
|
|
|
// CHECK: Name: .got
|
|
|
|
// CHECK-NEXT: Type: SHT_PROGBITS
|
|
|
|
// CHECK-NEXT: Flags [
|
|
|
|
// CHECK-NEXT: SHF_ALLOC
|
|
|
|
// CHECK-NEXT: SHF_WRITE
|
|
|
|
// CHECK-NEXT: ]
|
2015-10-11 07:25:39 +08:00
|
|
|
// CHECK-NEXT: Address: 0x2090
|
2015-10-07 08:58:20 +08:00
|
|
|
// CHECK-NEXT: Offset:
|
|
|
|
// CHECK-NEXT: Size: 8
|
|
|
|
|
|
|
|
// CHECK: Relocations [
|
|
|
|
// CHECK-NEXT: Section ({{.*}}) .rela.dyn {
|
2015-10-11 07:25:39 +08:00
|
|
|
// CHECK-NEXT: 0x2090 R_X86_64_RELATIVE - 0x1005
|
2015-10-07 08:58:20 +08:00
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: ]
|