|
1 |
| -// REQUIRES: ppc |
2 |
| - |
3 |
| -// RUN: llvm-mc -filetype=obj -triple=powerpc64le-unknown-linux %s -o %t.o |
4 |
| -// RUN: llvm-mc -filetype=obj -triple=powerpc64le-unknown-linux %p/Inputs/shared-ppc64.s -o %t2.o |
5 |
| -// RUN: ld.lld -shared %t2.o -o %t2.so |
6 |
| -// RUN: ld.lld %t.o %t2.so -o %t |
7 |
| -// RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s |
8 |
| - |
9 |
| -// RUN: llvm-mc -filetype=obj -triple=powerpc64-unknown-linux %s -o %t.o |
10 |
| -// RUN: llvm-mc -filetype=obj -triple=powerpc64-unknown-linux %p/Inputs/shared-ppc64.s -o %t2.o |
11 |
| -// RUN: ld.lld -shared %t2.o -o %t2.so |
12 |
| -// RUN: ld.lld %t.o %t2.so -o %t |
13 |
| -// RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s |
14 |
| - |
15 |
| -// CHECK: Disassembly of section .text: |
16 |
| -// CHECK-EMPTY: |
17 |
| -// CHECK-NEXT: _start: |
18 |
| -// CHECK: 10010008: bl .+16 |
19 |
| - |
20 |
| -// CHECK-LABEL: 0000000010010018 __plt_foo: |
21 |
| -// CHECK-NEXT: std 2, 24(1) |
22 |
| -// CHECK-NEXT: addis 12, 2, 0 |
23 |
| -// CHECK-NEXT: ld 12, 32560(12) |
24 |
| -// CHECK-NEXT: mtctr 12 |
25 |
| -// CHECK-NEXT: bctr |
| 1 | +# REQUIRES: ppc |
| 2 | + |
| 3 | +# RUN: llvm-mc -filetype=obj -triple=powerpc64le-unknown-linux %s -o %t.o |
| 4 | +# RUN: llvm-mc -filetype=obj -triple=powerpc64le-unknown-linux %p/Inputs/shared-ppc64.s -o %t2.o |
| 5 | +# RUN: ld.lld -shared %t2.o -soname=t2.so -o %t2.so |
| 6 | +# RUN: ld.lld %t.o %t2.so -o %t |
| 7 | +# RUN: llvm-readelf -S -d %t | FileCheck --check-prefix=SEC %s |
| 8 | +# RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s |
| 9 | + |
| 10 | +# RUN: llvm-mc -filetype=obj -triple=powerpc64-unknown-linux %s -o %t.o |
| 11 | +# RUN: llvm-mc -filetype=obj -triple=powerpc64-unknown-linux %p/Inputs/shared-ppc64.s -o %t2.o |
| 12 | +# RUN: ld.lld -shared %t2.o -soname=t2.so -o %t2.so |
| 13 | +# RUN: ld.lld %t.o %t2.so -o %t |
| 14 | +# RUN: llvm-readelf -S -d %t | FileCheck --check-prefix=SEC %s |
| 15 | +# RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s |
| 16 | + |
| 17 | +## DT_PLTGOT points to .plt |
| 18 | +# SEC: .plt NOBITS 0000000010030000 030000 000018 |
| 19 | +# SEC: 0x0000000000000003 (PLTGOT) 0x10030000 |
| 20 | + |
| 21 | +## .plt[0] holds the address of _dl_runtime_resolve. |
| 22 | +## .plt[1] holds the link map. |
| 23 | +## The JMP_SLOT relocation is stored at .plt[2] |
| 24 | +# RELOC: 0x10030010 R_PPC64_JMP_SLOT foo 0x0 |
| 25 | + |
| 26 | +# CHECK: _start: |
| 27 | +# CHECK: 10010008: bl .+16 |
| 28 | + |
| 29 | +# CHECK-LABEL: 0000000010010018 __plt_foo: |
| 30 | +# CHECK-NEXT: std 2, 24(1) |
| 31 | +# CHECK-NEXT: addis 12, 2, 0 |
| 32 | +# CHECK-NEXT: ld 12, 32560(12) |
| 33 | +# CHECK-NEXT: mtctr 12 |
| 34 | +# CHECK-NEXT: bctr |
26 | 35 |
|
27 | 36 |
|
28 | 37 | .text
|
|
0 commit comments