Skip to content

Commit

Permalink
[JITLink][aarch64] Pointer jump stubs should have 4-byte alignment.
Browse files Browse the repository at this point in the history
Pointer jump stubs content was incorrectly using 1-byte alignment. This bug
flew under the radar because the ordinary instruction streams (and aligned
section starts) usually left the block 4-byte aligned anyway. The bug was
observed when an out-of-tree pass introduced new content with arbitrary sizes
into the text section.

No testcase yet: We don't have a good way to replicate the perturbation that
was caused by the out-of-tree pass.
  • Loading branch information
lhames committed Dec 6, 2023
1 parent 61329bd commit 6016455
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion llvm/include/llvm/ExecutionEngine/JITLink/aarch64.h
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ inline Symbol &createAnonymousPointer(LinkGraph &G, Section &PointerSection,
inline Block &createPointerJumpStubBlock(LinkGraph &G, Section &StubSection,
Symbol &PointerSymbol) {
auto &B = G.createContentBlock(StubSection, PointerJumpStubContent,
orc::ExecutorAddr(~uint64_t(11)), 1, 0);
orc::ExecutorAddr(~uint64_t(11)), 4, 0);
B.addEdge(Page21, 0, PointerSymbol, 0);
B.addEdge(PageOffset12, 4, PointerSymbol, 0);
return B;
Expand Down

0 comments on commit 6016455

Please sign in to comment.