3 # RUN: llvm-mc -filetype=obj -triple=powerpc64le %s -o %t.o
4 # RUN: llvm-readobj -r %t.o | FileCheck --check-prefix=INPUT-REL %s
5 # RUN: llvm-objdump -d --no-show-raw-insn %t.o | FileCheck --check-prefix=INPUT-ASM %s
7 # RUN: ld.lld --shared %t.o --soname=t.so -o %t.so
8 # RUN: llvm-readelf -r %t.so | FileCheck --check-prefix=SO-REL %s
9 # RUN: llvm-readelf -x .got %t.so | FileCheck --check-prefix=SO-GOT %s
10 # RUN: llvm-readelf -s %t.so | FileCheck --check-prefix=SO-SYM %s
12 ## Test to make sure that the first element of a GOT section is the tocbase .TOC.
14 # INPUT-REL: Section (3) .rela.text {
15 # INPUT-REL-NEXT: 0x0 R_PPC64_GOT_PCREL34 glob_int 0x0
16 # INPUT-REL-NEXT: 0x0 R_PPC64_PCREL_OPT - 0x8
19 # INPUT-ASM-LABEL: <test>:
20 # INPUT-ASM: pld 3, 0(0), 1
21 # INPUT-ASM-NEXT: lwa 3, 0(3)
24 # SO-REL: Relocation section '.rela.dyn'
25 # SO-REL: 00000000000203a0 0000000100000014 R_PPC64_GLOB_DAT 00000000000102d0 glob_int + 0
27 # SO-GOT: Hex dump of section '.got':
28 # SO-GOT: 0x00020398 98830200 00000000 00000000 00000000
30 # SO-SYM: Symbol table '.symtab' contains 4 entries:
31 # SO-SYM: 3: 00000000000102d0 4 NOTYPE GLOBAL DEFAULT 6 glob_int
34 pld
3, glob_int@got@pcrel
(0), 1
36 .reloc .Lpcrel0-8,R_PPC64_PCREL_OPT,.-(.Lpcrel0-8)