about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/sh/abort-instr.h3
-rw-r--r--sysdeps/unix/sysv/linux/sh/makecontext.S7
2 files changed, 7 insertions, 3 deletions
diff --git a/sysdeps/sh/abort-instr.h b/sysdeps/sh/abort-instr.h
new file mode 100644
index 0000000000..69381aec8e
--- /dev/null
+++ b/sysdeps/sh/abort-instr.h
@@ -0,0 +1,3 @@
+/* An instruction which should crash any program is `sleep'.  */
+#define ABORT_INSTRUCTION_ASM sleep
+#define ABORT_INSTRUCTION asm ("sleep")
diff --git a/sysdeps/unix/sysv/linux/sh/makecontext.S b/sysdeps/unix/sysv/linux/sh/makecontext.S
index a847bb60b6..ec9ce91693 100644
--- a/sysdeps/unix/sysv/linux/sh/makecontext.S
+++ b/sysdeps/unix/sysv/linux/sh/makecontext.S
@@ -17,6 +17,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 #include <sysdep.h>
+#include <abort-instr.h>
 
 #include "ucontext_i.h"
 
@@ -124,9 +125,9 @@ ENTRY(__makecontext)
 #endif
 	jsr	@r1
 	 mov	r0, r4
-0:
-	bra	0b
-	 nop
+	/* The 'exit' call should never return.  In case it does cause the
+	   process to terminate.  */
+	ABORT_INSTRUCTION_ASM
 
 	.align	2
 #ifdef PIC