zig/deps/lld/test/ELF/ppc64-shared-rel-toc.s
Andrew Kelley 4794281d64 embed LLD 5.0.0
This is 48aaa9f66120f72b5d7e4a90b32fee40a3386ce9 from the
git monorepo.
2017-08-27 17:46:59 -04:00

28 lines
773 B
ArmAsm

// RUN: llvm-mc -filetype=obj -triple=powerpc64-unknown-linux %s -o %t.o
// RUN: ld.lld -shared %t.o -o %t.so
// RUN: llvm-readobj -t -r -dyn-symbols %t.so | FileCheck %s
// REQUIRES: ppc
// When we create the TOC reference in the shared library, make sure that the
// R_PPC64_RELATIVE relocation uses the correct (non-zero) offset.
.globl foo
.align 2
.type foo,@function
.section .opd,"aw",@progbits
foo: # @foo
.align 3
.quad .Lfunc_begin0
.quad .TOC.@tocbase
.quad 0
.text
.Lfunc_begin0:
blr
// CHECK: 0x20000 R_PPC64_RELATIVE - 0x10000
// CHECK: 0x20008 R_PPC64_RELATIVE - 0x8000
// CHECK: Name: foo
// CHECK-NEXT: Value: 0x20000