• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# REQUIRES: ppc
2# RUN: echo 'SECTIONS { \
3# RUN:       .text_low 0x10010000: { *(.text_low) } \
4# RUN:       .text_high 0x10080000 : { *(.text_high) } \
5# RUN:       }' > %t.script
6
7# RUN: llvm-mc -filetype=obj -triple=powerpc64le %s -o %t.o
8# RUN: ld.lld -T %t.script --shared %t.o -o %t
9# RUN: llvm-readelf -s %t | FileCheck %s --check-prefix=SYMBOL
10# RUN: llvm-readelf -r %t | FileCheck %s --check-prefix=RELA
11# RUN: llvm-objdump -d --no-show-raw-insn --mcpu=future %t | FileCheck %s
12
13# RUN: llvm-mc -filetype=obj -triple=powerpc64 %s -o %t.o
14# RUN: ld.lld -T %t.script --shared %t.o -o %t
15# RUN: llvm-readelf -s %t | FileCheck %s --check-prefix=SYMBOL
16# RUN: llvm-readelf -r %t | FileCheck %s --check-prefix=RELA
17# RUN: llvm-objdump -d --no-show-raw-insn --mcpu=future %t | FileCheck %s
18
19.text
20.section .text_low, "ax", %progbits
21# CHECK-LABEL: <GlobIntPCRel>:
22# CHECK-NEXT:    pld 3, 458928(0), 1
23# CHECK-NEXT:    lwa 3, 0(3)
24# SYMBOL: Symbol table '.dynsym' contains 4 entries:
25# SYMBOL:      00000000     0 NOTYPE  GLOBAL  DEFAULT     UND glob_int
26# RELA:        100800b0  0000000100000014 R_PPC64_GLOB_DAT       0000000000000000 glob_int + 0
27GlobIntPCRel:
28  pld 3, glob_int@got@PCREL(0), 1
29  lwa 3, 0(3)
30  blr
31
32# CHECK-LABEL: <GlobIntPCRelOffset>:
33# CHECK-NEXT:    pld 3, 458920(0), 1
34# CHECK-NEXT:    lwa 3, 8(3)
35# SYMBOL:      00000000     0 NOTYPE  GLOBAL  DEFAULT     UND glob_int8
36# RELA:        100800b8  0000000200000014 R_PPC64_GLOB_DAT       0000000000000000 glob_int8 + 0
37GlobIntPCRelOffset:
38  pld 3, glob_int8@got@PCREL(0), 1
39  lwa 3, 8(3)
40  blr
41
42# CHECK-LABEL: <GlobIntPCRelBigOffset>:
43# CHECK-NEXT:    pld 3, 192(0), 1
44# CHECK-NEXT:    lwa 3, 64(3)
45# SYMBOL:      00000000     0 NOTYPE  GLOBAL  DEFAULT     UND glob_int8_big
46# RELA:        100800c0  0000000300000014 R_PPC64_GLOB_DAT       0000000000000000 glob_int8_big + 0
47.section .text_high, "ax", %progbits
48GlobIntPCRelBigOffset:
49  pld 3, glob_int8_big@got@PCREL(0), 1
50  lwa 3, 64(3)
51  blr
52