summaryrefslogtreecommitdiff
path: root/src/thread/mips64
diff options
context:
space:
mode:
authorAlex Rønne Petersen <alex@alexrp.com>2024-12-12 17:56:04 +0100
committerRich Felker <dalias@aerifal.cx>2025-02-21 20:53:41 -0500
commitb6b81f697b38ef915a5dbf1311baba164822e917 (patch)
treee43a8a1710aaca8f276034bfa4fc048e94113aca /src/thread/mips64
parent5e03c03fcde3534b37a0b995a438cd176d6882d3 (diff)
downloadmusl-b6b81f697b38ef915a5dbf1311baba164822e917.tar.gz
clone: clear the frame pointer in the child process on relevant ports
This just mirrors what is done in the start code for the affected ports, as well as what is already done for the three x86 ports. Clearing the frame pointer helps protect FP-based unwinders from wrongly attempting to traverse into the parent thread's call frame stack.
Diffstat (limited to 'src/thread/mips64')
-rw-r--r--src/thread/mips64/clone.s3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/thread/mips64/clone.s b/src/thread/mips64/clone.s
index 2d86899a..8de3db6c 100644
--- a/src/thread/mips64/clone.s
+++ b/src/thread/mips64/clone.s
@@ -25,7 +25,8 @@ __clone:
nop
jr $ra
nop
-1: ld $25, 0($sp) # function pointer
+1: move $fp, $0
+ ld $25, 0($sp) # function pointer
ld $4, 8($sp) # argument pointer
jalr $25 # call the user's function
nop