From: Segev Finer <segev208@gmail.com>
To: musl@lists.openwall.com
Subject: [PATCH 2/3] mips64: Call exit on return from fn in __clone
Date: Wed, 15 Aug 2018 20:46:19 +0300 [thread overview]
Message-ID: <20180815174620.10752-3-segev208@gmail.com> (raw)
In-Reply-To: <20180815174620.10752-1-segev208@gmail.com>
This is the expected behavior of this function. Without this the child
task will crash on return from fn, since it will return to
nowhere.
---
src/thread/mips64/clone.s | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/thread/mips64/clone.s b/src/thread/mips64/clone.s
index 229d2677..1b71e07c 100644
--- a/src/thread/mips64/clone.s
+++ b/src/thread/mips64/clone.s
@@ -26,5 +26,8 @@ __clone:
nop
1: ld $25, 0($sp) # function pointer
ld $4, 8($sp) # argument pointer
- jr $25 # call the user's function
+ jalr $25 # call the user's function
nop
+ move $4, $2
+ li $2, 5058
+ syscall
--
2.18.0
next prev parent reply other threads:[~2018-08-15 17:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-15 17:46 [PATCH 0/3] mips{,64,n32}: " Segev Finer
2018-08-15 17:46 ` [PATCH 1/3] mips: " Segev Finer
2018-08-15 17:46 ` Segev Finer [this message]
2018-08-15 17:46 ` [PATCH 3/3] mipsn32: " Segev Finer
2018-08-16 22:08 ` [PATCH 0/3] mips{,64,n32}: " Szabolcs Nagy
2018-08-16 23:11 ` Rich Felker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180815174620.10752-3-segev208@gmail.com \
--to=segev208@gmail.com \
--cc=musl@lists.openwall.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).