|
12 | 12 | # RUN: llvm-objdump --section .data --full-contents %t | FileCheck --check-prefix=LE-DATA %s
|
13 | 13 | # RUN: llvm-objdump --section .got --full-contents %t | FileCheck --check-prefix=LE-GOT %s
|
14 | 14 |
|
| 15 | +## With -pie we still have the R_390_RELATIVE for the data element, but all GOT |
| 16 | +## entries should be fully resolved without any remaining R_390_TLS_TPOFF. |
| 17 | +# RUN: ld.lld -pie %t.o -o %t.pie |
| 18 | +# RUN: llvm-readelf -r %t.pie | FileCheck --check-prefix=PIE-REL %s |
| 19 | +# RUN: llvm-objdump -d --no-show-raw-insn %t.pie | FileCheck --check-prefix=PIE %s |
| 20 | +# RUN: llvm-objdump --section .data --full-contents %t.pie | FileCheck --check-prefix=PIE-DATA %s |
| 21 | +# RUN: llvm-objdump --section .got --full-contents %t.pie | FileCheck --check-prefix=PIE-GOT %s |
| 22 | + |
15 | 23 | # IE-REL: Relocation section '.rela.dyn' at offset {{.*}} contains 4 entries:
|
16 | 24 | # IE-REL: 0000000000003478 000000000000000c R_390_RELATIVE 2460
|
17 | 25 | # IE-REL: 0000000000002460 0000000100000038 R_390_TLS_TPOFF 0000000000000008 a + 0
|
|
58 | 66 | # LE-GOT: 1002248 00000000 00000000 ffffffff fffffff8
|
59 | 67 | # LE-GOT: 1002258 ffffffff fffffffc 00000000 00000000
|
60 | 68 |
|
| 69 | +# PIE-REL: Relocation section '.rela.dyn' at offset {{.*}} contains 1 entries: |
| 70 | +# PIE-REL: 00000000000033d0 000000000000000c R_390_RELATIVE 23b8 |
| 71 | + |
| 72 | +## TP offset for a is at 0x23b8 |
| 73 | +# PIE: lgrl %r1, 0x23b8 |
| 74 | +# PIE-NEXT: lgf %r1, 0(%r1,%r7) |
| 75 | + |
| 76 | +## TP offset for b is at 0x23c0 |
| 77 | +# PIE-NEXT: lgrl %r1, 0x23c0 |
| 78 | +# PIE-NEXT: lgf %r1, 0(%r1,%r7) |
| 79 | + |
| 80 | +## TP offset for c is at 0x23c8 |
| 81 | +# PIE-NEXT: lgrl %r1, 0x23c8 |
| 82 | +# PIE-NEXT: lgf %r1, 0(%r1,%r7) |
| 83 | + |
| 84 | +## Data element: TP offset for a is at 0x23b8 (relocated via R_390_RELATIVE above) |
| 85 | +# PIE-DATA: 33d0 00000000 00000000 |
| 86 | + |
| 87 | +## TP offsets in GOT: |
| 88 | +# a: -8 |
| 89 | +# b: -4 |
| 90 | +# c: 0 |
| 91 | +# PIE-GOT: 23a0 00000000 000022d0 00000000 00000000 |
| 92 | +# PIE-GOT: 23b0 00000000 00000000 ffffffff fffffff8 |
| 93 | +# PIE-GOT: 23c0 ffffffff fffffffc 00000000 00000000 |
| 94 | + |
61 | 95 | ear %r7,%a0
|
62 | 96 | sllg %r7,%r1,32
|
63 | 97 | ear %r7,%a1
|
|
0 commit comments