59 lines · plain
1# REQUIRES: ppc2# RUN: echo 'SECTIONS { \3# RUN: .text_low 0x10010000: { *(.text_low) } \4# RUN: .text_high 0x10080000 : { *(.text_high) } \5# RUN: }' > %t.script6 7# RUN: llvm-mc -filetype=obj -triple=powerpc64le %s -o %t.o8# RUN: ld.lld -T %t.script --shared %t.o -o %t9# RUN: llvm-readelf -s %t | FileCheck %s --check-prefix=SYMBOL10# RUN: llvm-readelf -r %t | FileCheck %s --check-prefix=RELA11# RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s12 13# RUN: llvm-mc -filetype=obj -triple=powerpc64 %s -o %t.o14# RUN: ld.lld -T %t.script --shared %t.o -o %t15# RUN: llvm-readelf -s %t | FileCheck %s --check-prefix=SYMBOL16# RUN: llvm-readelf -r %t | FileCheck %s --check-prefix=RELA17# RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s18 19.text20.section .text_low, "ax", %progbits21# CHECK-LABEL: <GlobIntPCRel>:22# CHECK-NEXT: pld 3, 458952(0), 123# CHECK-NEXT: lwa 3, 0(3)24 25# SYMBOL: Symbol table '.dynsym' contains 4 entries:26# SYMBOL: 00000000 0 NOTYPE GLOBAL DEFAULT UND glob_int27# RELA: 100800c8 0000000100000014 R_PPC64_GLOB_DAT 0000000000000000 glob_int + 028GlobIntPCRel:29 pld 3, glob_int@got@PCREL(0), 130 lwa 3, 0(3)31 blr32 33# CHECK-LABEL: <GlobIntPCRelOffset>:34# CHECK-NEXT: pld 3, 458944(0), 135# CHECK-NEXT: lwa 3, 8(3)36# SYMBOL: 00000000 0 NOTYPE GLOBAL DEFAULT UND glob_int837# RELA: 100800d0 0000000200000014 R_PPC64_GLOB_DAT 0000000000000000 glob_int8 + 038GlobIntPCRelOffset:39 pld 3, glob_int8@got@PCREL(0), 140 lwa 3, 8(3)41 blr42 43# CHECK-LABEL: <GlobIntPCRelBigOffset>:44# CHECK-NEXT: pld 3, 216(0), 145# CHECK-NEXT: lwa 3, 64(3)46# SYMBOL: 00000000 0 NOTYPE GLOBAL DEFAULT UND glob_int8_big47# RELA: 100800d8 0000000300000014 R_PPC64_GLOB_DAT 0000000000000000 glob_int8_big + 048 49## Note that the first entry of the .got[0] should always be .TOC.50# SYMBOL: Symbol table '.symtab' contains 8 entries:51# SYMBOL: 1: 0000000010010000 0 NOTYPE LOCAL DEFAULT 6 GlobIntPCRel52# SYMBOL: 2: 0000000010010010 0 NOTYPE LOCAL DEFAULT 6 GlobIntPCRelOffset53# SYMBOL: 3: 0000000010080000 0 NOTYPE LOCAL DEFAULT 7 GlobIntPCRelBigOffset54.section .text_high, "ax", %progbits55GlobIntPCRelBigOffset:56 pld 3, glob_int8_big@got@PCREL(0), 157 lwa 3, 64(3)58 blr59