Skip to content
Closed
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion lld/MachO/Arch/ARM64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,16 @@ void ARM64::populateThunk(InputSection *thunk, Symbol *funcSym) {
/*offset=*/0, /*addend=*/0,
/*referent=*/funcSym);
}
// Just a single direct branch to the target function.
// Just a single direct branch to the target function and a nop.
// The nop will improve the debuggability.
//
// Debug lines in DWARF does not recognize one-instruction sequence, and this
// thunk will be merged into other sequences if it only had one instruction.
// Adding a nop after the branch has no runtime cost, and little size impact,
// but it would make DWARF linker and debuggers happier.
static constexpr uint32_t icfSafeThunkCode[] = {
0x14000000, // 08: b target
0xD503201F, // 0c: nop
};

void ARM64::initICFSafeThunkBody(InputSection *thunk, Symbol *targetSym) const {
Expand Down
Loading
Loading