[lld] [ICF] Add a NOP after branch in ICF thunk to improve debugability (PR #154986)
Peter Rong via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 22 09:54:07 PDT 2025
https://github.com/DataCorrupted created https://github.com/llvm/llvm-project/pull/154986
None
>From 35082deba3dd6f306ceefa8bd4a46f79674a327c Mon Sep 17 00:00:00 2001
From: Peter Rong <PeterRong at meta.com>
Date: Fri, 22 Aug 2025 09:48:56 -0700
Subject: [PATCH] [ICF] Add a NOP after branch in ICF thunk to improve
debugability
---
lld/MachO/Arch/ARM64.cpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/lld/MachO/Arch/ARM64.cpp b/lld/MachO/Arch/ARM64.cpp
index 04da702b48764..2479c2e2c72b8 100644
--- a/lld/MachO/Arch/ARM64.cpp
+++ b/lld/MachO/Arch/ARM64.cpp
@@ -176,6 +176,7 @@ void ARM64::populateThunk(InputSection *thunk, Symbol *funcSym) {
// Just a single direct branch to the target function.
static constexpr uint32_t icfSafeThunkCode[] = {
0x14000000, // 08: b target
+ 0xD503201F, // 0c: nop
};
void ARM64::initICFSafeThunkBody(InputSection *thunk, Symbol *targetSym) const {
More information about the llvm-commits
mailing list