llvm-project/lld/test/ELF/global-offset-table-position.s
Fangrui Song 88796a7988 [ELF][test] Improve and reorganize another set of tests
Add file-level comments
Replace trivial Input/*.s with echo ... | llvm-mc
Delete insignificant addresses to make them more tolerant to layout changes
Simplify test output

Merge merge-section-types.s into compatible-section-types.s and add a missed case
Merge gnu-ifunc-gotpcrel.s (added in D19517) into gnu-ifunc-dso.s (added in D35119) and add missed cases
Delete typed-undef.s - covered by executable-undefined-ignoreall.s
Delete emit-relocs-shared.s - covered by emit-relocs-merge.s

Replace copy-rel-pie.s and copy-rel-pie2.s with canonical-plt-pcrel.s, canonical-plt-symbolic.s and copy-rel.s:
add -no-pie cases.
add a case that a canonical PLT can be created for STT_GNU_IFUNC. The logic in Symbols.h was untested:

  // ctor of SharedSymbol
  if (this->type == llvm::ELF::STT_GNU_IFUNC)
    this->type = llvm::ELF::STT_FUNC;

llvm-svn: 371361
2019-09-09 03:35:14 +00:00

35 lines
812 B
ArmAsm

// REQUIRES: x86
// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t
// RUN: ld.lld -shared %t -o %t2
// RUN: llvm-readobj -S --symbols %t2 | FileCheck %s
// The X86_64 _GLOBAL_OFFSET_TABLE_ is defined at the start of the .got.plt
// section.
.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_ - .
// CHECK: Name: .got.plt
// CHECK: Address: [[ADDR:.*]]
// CHECK: Name: _GLOBAL_OFFSET_TABLE_
// CHECK-NEXT: Value: [[ADDR]]
// CHECK-NEXT: Size: 0
// CHECK-NEXT: Binding: Local
// CHECK-NEXT: Type: None (0x0)
// CHECK-NEXT: Other [
// CHECK-NEXT: STV_HIDDEN
// CHECK-NEXT: ]
// CHECK-NEXT: Section: .got.plt