diff options
author | Timothy Pearson <tpearson@raptorengineering.com> | 2025-07-08 13:41:15 +0000 |
---|---|---|
committer | Justin Hibbits <jhibbits@FreeBSD.org> | 2025-07-13 18:00:56 +0000 |
commit | 8efa35fea384d209c683dfbae8f49f2737a41941 (patch) | |
tree | 5810ecf0c95a418598cb7b238cd1ec9e78ad2572 /usr.bin/look/(developers-only) | |
parent | 077e30e61d7e1c90af7df31989bb976a3ace0c69 (diff) |
On PowerPC platforms a valid link to the Table of Contents (TOC) is
required for PLT lookups to function. This TOC pointer is stored in
a dedicated register, and is used along with the stack pointer by both
C prologue and PLT lookup code.
When calling swapcontext() with uc_link != NULL, a PLT lookup to
setcontext(3) is attempted from within the _ctx_done context. The
exiting process has usually trashed both r1 and r2 at this point,
leading to a crash within the PLT lookup before setcontext(2) is
reached to restore the linked context.
Save and restore r2 as in a regular function. This ensures the
subsequent PLT lookup to setcontext(3) succeeds.
Signed-off-by: Timothy Pearson <tpearson@raptorengineering.com>
MFC after: 1 week
Pull Request: https://github.com/freebsd/freebsd-src/pull/1759
Diffstat (limited to 'usr.bin/look/(developers-only)')
0 files changed, 0 insertions, 0 deletions