2018-06-06 21:56:51 +08:00
|
|
|
// REQUIRES: x86
|
2016-03-17 13:57:33 +08:00
|
|
|
// RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
|
2017-10-06 17:37:44 +08:00
|
|
|
// RUN: ld.lld --hash-style=sysv %t.o -o %t -pie
|
2020-03-04 11:49:14 +08:00
|
|
|
// RUN: llvm-readobj -S -d -r %t | FileCheck %s
|
2020-06-02 01:17:48 +08:00
|
|
|
// RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck --check-prefix=DISASM %s
|
2016-03-17 13:57:33 +08:00
|
|
|
|
|
|
|
.globl _start
|
|
|
|
_start:
|
|
|
|
call foo@gotpcrel
|
|
|
|
|
|
|
|
.hidden foo
|
|
|
|
.global foo
|
|
|
|
foo:
|
|
|
|
nop
|
|
|
|
|
|
|
|
// DISASM: Disassembly of section .text:
|
2019-05-01 18:40:48 +08:00
|
|
|
// DISASM-EMPTY:
|
2020-03-06 06:18:38 +08:00
|
|
|
// DISASM-NEXT: <_start>:
|
2020-06-02 01:17:48 +08:00
|
|
|
// DISASM-NEXT: 1210: callq 0x22d8
|
2020-03-06 06:18:38 +08:00
|
|
|
// DISASM: <foo>:
|
2020-06-02 01:17:48 +08:00
|
|
|
// DISASM-NEXT: 1215: nop
|
2016-03-17 13:57:33 +08:00
|
|
|
|
|
|
|
// CHECK: Name: .got
|
|
|
|
// CHECK-NEXT: Type: SHT_PROGBITS
|
|
|
|
// CHECK-NEXT: Flags [
|
|
|
|
// CHECK-NEXT: SHF_ALLOC
|
|
|
|
// CHECK-NEXT: SHF_WRITE
|
|
|
|
// CHECK-NEXT: ]
|
2020-06-02 01:17:48 +08:00
|
|
|
// CHECK-NEXT: Address: 0x22D8
|
2016-03-17 13:57:33 +08:00
|
|
|
// CHECK-NEXT: Offset:
|
|
|
|
// CHECK-NEXT: Size: 8
|
|
|
|
|
2020-03-04 11:49:14 +08:00
|
|
|
// CHECK: 0x000000006FFFFFF9 RELACOUNT 1
|
|
|
|
|
2016-03-17 13:57:33 +08:00
|
|
|
// CHECK: Relocations [
|
|
|
|
// CHECK-NEXT: Section ({{.*}}) .rela.dyn {
|
2020-06-02 01:17:48 +08:00
|
|
|
// CHECK-NEXT: 0x22D8 R_X86_64_RELATIVE - 0x1215
|
2016-03-17 13:57:33 +08:00
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: ]
|