brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · 1c7fdfd Raw
37 lines · plain
1# REQUIRES: ppc2# RUN: llvm-mc -filetype=obj -triple=powerpc %s -o %t.o3# RUN: echo '.globl b; b:' | llvm-mc -filetype=obj -triple=powerpc - -o %t1.o4# RUN: ld.lld -shared %t1.o -soname=t1.so -o %t1.so5 6# RUN: ld.lld %t.o %t1.so -o %t7# RUN: llvm-readobj -r %t | FileCheck --check-prefix=RELOC %s8# RUN: llvm-nm %t | FileCheck --check-prefix=NM %s9# RUN: llvm-readobj -x .got %t | FileCheck --check-prefix=HEX %s10# RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s11 12## Check we can handle R_PPC_GOT16, which may be generated by -fpic code.13 14# RELOC:      .rela.dyn {15# RELOC-NEXT:   0x10020218 R_PPC_GLOB_DAT b 0x016# RELOC-NEXT: }17 18# NM: 1002020c d _GLOBAL_OFFSET_TABLE_19# NM: 10030220 d a20 21## The GOT slot of a can be filled at link time.22# HEX:      section '.got':23# HEX:      0x1002020c [[#%x,]] 00000000 00000000 0000000024# HEX-NEXT: 0x1002021c 1003022025 26## a: &.got[4] - _GLOBAL_OFFSET_TABLE_ = 0x1002021c - 0x1002020c = 1627## b: &.got[3] - _GLOBAL_OFFSET_TABLE_ = 0x10020218 - 0x1002020c = 1228# CHECK: lwz 3, 16(30)29# CHECK: lwz 4, 12(30)30 31lwz 3,a@got(30)32lwz 4,b@got(30)33 34.data35a:36.long _GLOBAL_OFFSET_TABLE_37