[libunwind] [libunwind][AIX] Fix up TOC register if unw_getcontext is called from a different module (PR #66549)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 18 07:46:59 PDT 2023
================
@@ -305,9 +305,22 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
mflr 0
std 0, PPC64_OFFS_SRR0(3) // store lr as ssr0
PPC64_STR(1)
+ PPC64_STR(4) // Save r4 first since it will be used for fixing r2.
+#if defined(_AIX)
+ // The TOC register (r2) was changed by the glue code if unw_getcontext
+ // is called from a different module. Save the original TOC register
+ // in the context if this is the case.
+ mflr 4
----------------
stephenpeckham wrote:
Either way is fine with me.
https://github.com/llvm/llvm-project/pull/66549
More information about the cfe-commits
mailing list