• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# REQUIRES: ppc
2
3# RUN: llvm-mc -filetype=obj -triple=powerpc64le %s -o %t.o
4# RUN: llvm-readobj -r %t.o | FileCheck --check-prefix=RELOCS %s
5# RUN: ld.lld -shared %t.o -o %t.so
6# RUN: llvm-objdump -d --no-show-raw-insn %t.so | FileCheck %s
7## Check LD->LE relaxation does not affect R_PPC64_GOT_DTPREL16*.
8# RUN: ld.lld %t.o -o %t
9# RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s
10
11# RUN: llvm-mc -filetype=obj -triple=powerpc64 %s -o %t.o
12# RUN: llvm-readobj -r %t.o | FileCheck --check-prefix=RELOCS %s
13# RUN: ld.lld -shared %t.o -o %t.so
14# RUN: llvm-objdump -d --no-show-raw-insn %t.so | FileCheck %s
15# RUN: ld.lld %t.o -o %t
16# RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s
17
18# RELOCS:      .rela.text {
19# RELOCS-NEXT:   R_PPC64_GOT_DTPREL16_HA i 0x0
20# RELOCS-NEXT:   R_PPC64_GOT_DTPREL16_LO_DS i 0x0
21# RELOCS-NEXT:   R_PPC64_GOT_DTPREL16_HI j 0x0
22# RELOCS-NEXT:   R_PPC64_GOT_DTPREL16_DS j 0x0
23# RELOCS-NEXT: }
24
25## ha(i@got@dtprel) = (&.got[0] - (.got+0x8000) + 0x8000 >> 16) & 0xffff = 0
26## lo(i@got@dtprel) = &.got[0] - (.got+0x8000) & 0xffff = -32768
27## hi(j@got@dtprel) = (&.got[1] - (.got+0x8000) >> 16) & 0xffff = -1
28## j@got@dtprel = &.got[1] - (.got+0x8000) = -32760
29# CHECK:      addis 3, 2, 0
30# CHECK-NEXT: ld 3, -32768(3)
31# CHECK-NEXT: addis 3, 2, -1
32# CHECK-NEXT: addi 3, 2, -32760
33
34  addis 3, 2, i@got@dtprel@ha
35  ld 3, i@got@dtprel@l(3)
36  addis 3, 2, j@got@dtprel@h
37  addi 3, 2, j@got@dtprel
38
39.section .tbss,"awT",@nobits
40.p2align 2
41i:
42  .long 0
43j:
44  .long 0
45