[lld] [lld-macho] Fix compatibility between --icf=safe_thunks and --keep-icf-stabs (PR #116687)
Ellis Hoag via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 19 11:01:29 PST 2024
================
@@ -1204,6 +1205,17 @@ void SymtabSection::emitEndFunStab(Defined *defined) {
stabs.emplace_back(std::move(stab));
}
+// Given a pointer to a function symbol, return the symbol that points to the
+// actual function body that will go in the final binary. Generally this is the
+// symbol itself, but if the symbol was folded using a thunk, we retrieve the
+// target function body from the thunk.
+Defined *SymtabSection::getFuncBodySym(Defined *originalSym) {
+ if (originalSym->identicalCodeFoldingKind != Symbol::ICFFoldKind::Thunk)
----------------
ellishg wrote:
This would be slightly more intuitive to me if the condition was flipped.
https://github.com/llvm/llvm-project/pull/116687
More information about the llvm-commits
mailing list