[all-commits] [llvm/llvm-project] e25cd0: [libunwind][AIX] Fix up TOC register if unw_getcon...

xingxue-ibm via All-commits all-commits at lists.llvm.org
Tue Sep 19 07:37:44 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e25cd088a642d270c688611b85e22bc83f32f48e
  Author: xingxue-ibm <57193974+xingxue-ibm at users.noreply.github.com>
  Date:   2023-09-19 (Tue, 19 Sep 2023)

  Changed paths:
    M libunwind/src/UnwindRegistersSave.S
    M libunwind/test/unw_resume.pass.cpp

  Log Message:
  [libunwind][AIX] Fix up TOC register if unw_getcontext is called from a different module (#66549)

`unw_getcontext` saves the caller's registers in the context. However,
if the caller of `unw_getcontext` is in a different module, the glue
code of `unw_getcontext` sets the TOC register (r2) with the new TOC
base and saves the original TOC register value in the stack frame. This
causes the incorrect TOC value is used when the caller steps up frames,
which fails libunwind LIT test case `unw_resume.pass.cpp`. This PR fixes
the problem by using the original TOC register value saved in the stack
if the caller is in a different module and enables `unw_resume.pass.cpp`
on AIX.

More information about the All-commits mailing list