1 2010-06-24 Carlos O'Donell <carlos@codesourcery.com>
3 * sysdeps/unix/sysv/linux/hppa/nptl/pt-vfork.S: Only create stack
4 frame around call to SYSCALL_ERROR_HANDLER. Do not restore %rp
5 from the stack frame on successfull return.
7 diff --git a/ports/sysdeps/unix/sysv/linux/hppa/nptl/pt-vfork.S b/ports/sysdeps/unix/sysv/linux/hppa/nptl/pt-vfork.S
8 index 83a70b7..15efa98 100644
9 --- a/ports/sysdeps/unix/sysv/linux/hppa/nptl/pt-vfork.S
10 +++ b/ports/sysdeps/unix/sysv/linux/hppa/nptl/pt-vfork.S
12 -/* Copyright (C) 2005 Free Software Foundation, Inc.
13 +/* Copyright (C) 2005, 2010 Free Software Foundation, Inc.
14 This file is part of the GNU C Library.
16 The GNU C Library is free software; you can redistribute it and/or
19 /* r26, r25, r24, r23 are free since vfork has no arguments */
25 + /* We must not create a frame. When the child unwinds to call
26 + exec it will clobber the same frame that the parent
29 /* Save the PIC register. */
31 @@ -75,12 +74,20 @@ ENTRY(__vfork)
32 comclr,>>= %r1,%ret0,%r0 /* Note: unsigned compare. */
35 - /* Return, no need to restore the PIC register. */
39 + /* Return, and DO NOT restore rp. The child may have called
40 + functions that updated the frame's rp. This works because
41 + the kernel ensures rp is preserved across the vfork
46 + /* Now we need a stack to call a function. We are assured
47 + that there is no child now, so it's safe to create
55 /* Restore the PIC register (in delay slot) on error */