[PATCH] getpid/vfork/raise fix
Jakub Jelinek
jakub@redhat.com
Wed Mar 10 18:19:00 GMT 2004
On Wed, Mar 10, 2004 at 09:45:00AM -0800, David Mosberger wrote:
> >>>>> On Wed, 10 Mar 2004 15:50:52 +0100, Jakub Jelinek <jakub@redhat.com> said:
>
> >> Most scratch registers are _not_ preserved across system calls.
> >> You could spill the register onto the memory stack though. If it
> >> uses at most 16 bytes, you won't have to adjust the stack pointer
> >> even.
>
> Jakub> But as soon as you spill something into memory the vfork
> Jakub> child can clobber it and you restore in the parent something
> Jakub> different from what you saved.
>
> How many registers need to be preserved? Just one? (Sorry, I could
> read the code but I'm a bit preoccupied with other stuff at the
> moment.) If it's just one, I think you could use r11 because that one
> is required to be preserved for the light-weight syscall convention.
One (plus b0) is needed.
But first of all I'd like to understand the differences between
NPTL pt-vfork.S and libc vfork.S on IA-64. Why does one use
DO_CALL_VIA_BREAK and the other one DO_CALL, one has gas workarounds and one
does not?
Jakub
More information about the Libc-hacker
mailing list