|
5 | 5 | # RUN: -o %t/elf_riscv32_sm_pic_reloc.o %s
|
6 | 6 | # RUN: llvm-jitlink -noexec \
|
7 | 7 | # RUN: -slab-allocate 100Kb -slab-address 0x1ff00000 -slab-page-size 4096 \
|
8 |
| -# RUN: -abs external_func=0x1 -abs external_data=0x2 \ |
| 8 | +# RUN: -abs external_data=0x2 \ |
9 | 9 | # RUN: -check %s %t/elf_riscv64_sm_pic_reloc.o
|
10 | 10 | # RUN: llvm-jitlink -noexec \
|
11 | 11 | # RUN: -slab-allocate 100Kb -slab-address 0x1ff00000 -slab-page-size 4096 \
|
12 |
| -# RUN: -abs external_func=0x1 -abs external_data=0x2 \ |
| 12 | +# RUN: -abs external_data=0x2 \ |
13 | 13 | # RUN: -check %s %t/elf_riscv32_sm_pic_reloc.o
|
14 | 14 | #
|
15 | 15 | # Test ELF small/PIC relocations
|
@@ -51,14 +51,34 @@ test_pcrel32_s:
|
51 | 51 | .size test_pcrel32_s, .-test_pcrel32_s
|
52 | 52 |
|
53 | 53 | # Test R_RISCV_CALL
|
54 |
| -# jitlink-check: decode_operand(test_call, 1) = ((external_func - test_call) + 0x800)[31:12] |
55 |
| -# jitlink-check: decode_operand(test_call+4, 2)[11:0] = (external_func - test_call)[11:0] |
56 |
| - .globl test_call, external_func |
| 54 | +# jitlink-check: decode_operand(test_call, 1) = ((internal_func - test_call) + 0x800)[31:12] |
| 55 | +# jitlink-check: decode_operand(test_call+4, 2)[11:0] = (internal_func - test_call)[11:0] |
| 56 | + .globl test_call |
57 | 57 | .p2align 1
|
58 | 58 | .type test_call,@function
|
59 | 59 | test_call:
|
60 |
| - .reloc ., R_RISCV_CALL, external_func |
| 60 | + .reloc ., R_RISCV_CALL, internal_func |
61 | 61 | auipc ra, 0
|
62 | 62 | jalr ra
|
63 | 63 | ret
|
64 | 64 | .size test_call, .-test_call
|
| 65 | + |
| 66 | +# Test R_RISCV_CALL_PLT |
| 67 | +# jitlink-check: decode_operand(test_call_plt, 1) = ((internal_func - test_call_plt) + 0x800)[31:12] |
| 68 | +# jitlink-check: decode_operand(test_call_plt+4, 2)[11:0] = (internal_func - test_call_plt)[11:0] |
| 69 | + .globl test_call_plt |
| 70 | + .p2align 1 |
| 71 | + .type test_call_plt,@function |
| 72 | +test_call_plt: |
| 73 | + .reloc ., R_RISCV_CALL_PLT, internal_func |
| 74 | + auipc ra, 0 |
| 75 | + jalr ra |
| 76 | + ret |
| 77 | + .size test_call_plt, .-test_call_plt |
| 78 | + |
| 79 | + .globl internal_func |
| 80 | + .p2align 1 |
| 81 | + .type internal_func,@function |
| 82 | +internal_func: |
| 83 | + ret |
| 84 | + .size internal_func, .-internal_func |
0 commit comments