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
|
2016-08-31 16:51:39 +08:00
|
|
|
// RUN: llvm-readobj -s -r -d %t | FileCheck %s
|
2015-10-07 08:58:20 +08:00
|
|
|
// RUN: llvm-objdump -d %t | FileCheck --check-prefix=DISASM %s
|
|
|
|
|
|
|
|
bar:
|
|
|
|
call foo@gotpcrel
|
|
|
|
|
|
|
|
.hidden foo
|
|
|
|
.global foo
|
|
|
|
foo:
|
|
|
|
nop
|
|
|
|
|
2016-08-31 16:51:39 +08:00
|
|
|
// 0x20A0 - 0x1000 - 5 = 4251
|
2015-10-07 08:58:20 +08:00
|
|
|
// DISASM: bar:
|
2016-08-31 16:51:39 +08:00
|
|
|
// DISASM-NEXT: 1000: {{.*}} callq 4251
|
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: ]
|
2016-08-31 16:51:39 +08:00
|
|
|
// CHECK-NEXT: Address: 0x20A0
|
2015-10-07 08:58:20 +08:00
|
|
|
// CHECK-NEXT: Offset:
|
|
|
|
// CHECK-NEXT: Size: 8
|
|
|
|
|
|
|
|
// CHECK: Relocations [
|
|
|
|
// CHECK-NEXT: Section ({{.*}}) .rela.dyn {
|
2016-08-31 16:51:39 +08:00
|
|
|
// CHECK-NEXT: 0x20A0 R_X86_64_RELATIVE - 0x1005
|
2015-10-07 08:58:20 +08:00
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: ]
|
2016-08-31 16:51:39 +08:00
|
|
|
// CHECK: 0x000000006FFFFFF9 RELACOUNT 1
|