150
|
1 # REQUIRES: ppc
|
|
2 # RUN: llvm-mc -filetype=obj -triple=powerpc %s -o %t.o
|
|
3 # RUN: ld.lld %t.o -o %t
|
|
4 # RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck --check-prefix=PDE %s
|
|
5 # RUN: ld.lld -pie %t.o -o %t
|
|
6 # RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck --check-prefix=PIC %s
|
|
7 # RUN: ld.lld -shared %t.o -o %t
|
|
8 # RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck --check-prefix=PIC %s
|
|
9
|
|
10 ## It does not really matter how we fixup it, but we cannot overflow and
|
|
11 ## should not generate a call stub (this would waste space).
|
173
|
12 # PDE: bl 0x100100b4
|
150
|
13
|
|
14 ## With -pie or -shared, create a call stub. ld.bfd produces bl .+0
|
173
|
15 # PIC: bl 0x[[PLT:[0-9a-f]+]]
|
|
16 # PIC-EMPTY:
|
|
17 # PIC-NEXT: 000[[PLT]] <00000000.plt_pic32.foo>:
|
150
|
18
|
|
19 .weak foo
|
|
20 bl foo
|