fix(ghidra): make qualified function renames idempotent

This commit is contained in:
morluto
2026-10-09 05:27:39 +08:00
parent 34f7c4fd66
commit 4458128a84
7 changed files with 216 additions and 3 deletions
+22
View File
@@ -0,0 +1,22 @@
// Emit C++ ABI names with the host C compiler; no C++ runtime is required.
#if defined(__APPLE__)
#define REA_CPP_SYMBOL(name) "_" name
#else
#define REA_CPP_SYMBOL(name) name
#endif
__attribute__((noinline, used)) int rea_namespace_alpha(int value)
__asm__(REA_CPP_SYMBOL("_ZN5alpha4sameEi"));
__attribute__((noinline, used)) int rea_namespace_beta(int value)
__asm__(REA_CPP_SYMBOL("_ZN4beta4sameEi"));
__attribute__((noinline, used)) int rea_namespace_nested(int value)
__asm__(REA_CPP_SYMBOL("_ZN5outer5inner4sameEi"));
int rea_namespace_alpha(int value) { return value + 3; }
int rea_namespace_beta(int value) { return value * 2; }
int rea_namespace_nested(int value) { return value - 1; }
int main(void) {
return rea_namespace_alpha(1) + rea_namespace_beta(2) +
rea_namespace_nested(3);
}