Skip to content

Commit 9d41ed4

Browse files
author
anoopkg6
committed
Fix Stub block Delta32dbl edge with Addend 2 at offset 2
1 parent 30c18e6 commit 9d41ed4

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

llvm/include/llvm/ExecutionEngine/JITLink/systemz.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@ inline Block &createPointerJumpStubBlock(LinkGraph &G, Section &StubSection,
792792
Symbol &PointerSymbol) {
793793
auto &B = G.createContentBlock(StubSection, getStubBlockContent(G),
794794
orc::ExecutorAddr(), 8, 0);
795-
B.addEdge(Delta32dbl, 2, PointerSymbol, 0);
795+
B.addEdge(Delta32dbl, 2, PointerSymbol, 2);
796796
return B;
797797
}
798798

llvm/test/ExecutionEngine/JITLink/systemz/ELF_systemz_reloc_call_pic.s

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,19 @@ test_call_extern_plt:
5858

5959
.size test_call_extern_plt, .-test_call_extern_plt
6060

61+
# Check PLT stub relocation for lgrl(Delta32dbl).
62+
#
63+
# jitlink-check: *{4}(stub_addr(elf_pic_reloc.o, extern_out_of_range32) + 2) = \
64+
# jitlink-check: (got_addr(elf_pic_reloc.o, extern_out_of_range32) - \
65+
# jitlink-check: stub_addr(elf_pic_reloc.o, extern_out_of_range32)) >> 1
66+
.globl test_call_extern_plt_stub
67+
.p2align 4
68+
.type test_call_extern_plt_stub,@function
69+
test_call_extern_plt_stub:
70+
brasl %r14, extern_out_of_range32@plt
71+
72+
.size test_call_extern_plt_stub, .-test_call_extern_plt_stub
73+
6174
# Check R_390_PLT32(DeltaPLT32dbl) handling with a call to an external.
6275
# This produces a Delta32dbl edge, because externals are not defined
6376
# locally. During resolution, the target turns out to be in-range from the

0 commit comments

Comments
 (0)