From 045cd8195f5d8e171d6ccfbaf6893896fce25f79 Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Tue, 30 Jun 2020 11:12:08 +0000 Subject: Add missing comparison instruction. Load %r12 with the indirect branch address to load the correct TOC address. --- lib/libc/arch/powerpc64/sys/tfork_thread.S | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/libc/arch/powerpc64/sys/tfork_thread.S b/lib/libc/arch/powerpc64/sys/tfork_thread.S index 0968077b847..ba64ca63b4e 100644 --- a/lib/libc/arch/powerpc64/sys/tfork_thread.S +++ b/lib/libc/arch/powerpc64/sys/tfork_thread.S @@ -1,4 +1,4 @@ -/* $OpenBSD: tfork_thread.S,v 1.1 2020/06/25 02:38:28 drahn Exp $ */ +/* $OpenBSD: tfork_thread.S,v 1.2 2020/06/30 11:12:07 kettenis Exp $ */ /* * Copyright (c) 2005 Tim Wiess @@ -22,6 +22,7 @@ ENTRY(__tfork_thread) /* call __tfork */ li %r0, SYS___tfork sc + cmpwi %r0, 0 bne 1f /* check if we are parent or child */ @@ -29,6 +30,7 @@ ENTRY(__tfork_thread) bnelr /* child */ + mr %r12, %r5 mtlr %r5 /* fp */ mr %r3, %r6 /* arg */ subi %r1, %r1, 32 /* fixup sp to get headroom */ -- cgit v1.2.3