2018-06-27 06:20:04 +08:00
|
|
|
// REQUIRES: x86
|
2017-06-26 18:22:17 +08:00
|
|
|
// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t
|
2019-09-09 11:35:14 +08:00
|
|
|
// RUN: ld.lld -shared %t -o %t2
|
|
|
|
// RUN: llvm-readobj -S --symbols %t2 | FileCheck %s
|
2017-06-26 18:22:17 +08:00
|
|
|
|
2018-03-19 14:52:51 +08:00
|
|
|
// The X86_64 _GLOBAL_OFFSET_TABLE_ is defined at the start of the .got.plt
|
|
|
|
// section.
|
2017-06-26 18:22:17 +08:00
|
|
|
.globl a
|
|
|
|
.type a,@object
|
|
|
|
.comm a,4,4
|
|
|
|
|
|
|
|
.globl f
|
|
|
|
.type f,@function
|
|
|
|
f:
|
|
|
|
movq a@GOTPCREL(%rip), %rax
|
|
|
|
|
|
|
|
.global _start
|
|
|
|
.type _start,@function
|
|
|
|
_start:
|
|
|
|
callq f@PLT
|
|
|
|
.data
|
|
|
|
.long _GLOBAL_OFFSET_TABLE_ - .
|
|
|
|
|
2019-09-09 11:35:14 +08:00
|
|
|
// CHECK: Name: .got.plt
|
|
|
|
// CHECK: Address: [[ADDR:.*]]
|
2017-06-26 18:22:17 +08:00
|
|
|
// CHECK: Name: _GLOBAL_OFFSET_TABLE_
|
2019-09-09 11:35:14 +08:00
|
|
|
// CHECK-NEXT: Value: [[ADDR]]
|
2017-06-26 18:22:17 +08:00
|
|
|
// CHECK-NEXT: Size: 0
|
|
|
|
// CHECK-NEXT: Binding: Local
|
|
|
|
// CHECK-NEXT: Type: None (0x0)
|
|
|
|
// CHECK-NEXT: Other [
|
|
|
|
// CHECK-NEXT: STV_HIDDEN
|
|
|
|
// CHECK-NEXT: ]
|
2018-03-19 14:52:51 +08:00
|
|
|
// CHECK-NEXT: Section: .got.plt
|