[PATCH] Call exit directly in clone (BZ #21512)
Joseph Myers
joseph@codesourcery.com
Fri Jun 23 13:14:00 GMT 2017
On Fri, 23 Jun 2017, Adhemerval Zanella wrote:
> diff --git a/sysdeps/unix/sysv/linux/arm/clone.S b/sysdeps/unix/sysv/linux/arm/clone.S
> @@ -76,7 +73,8 @@ PSEUDO_END (__clone)
> BLX (ip)
>
> @ and we are done, passing the return value through r0
> - b PLTJMP(HIDDEN_JUMPTARGET(_exit))
> + ldr r7, =SYS_ify(clone)
> + swi 0x0
This looks like it would call the clone syscall, not exit.
> diff --git a/sysdeps/unix/sysv/linux/mips/clone.S b/sysdeps/unix/sysv/linux/mips/clone.S
> @@ -137,14 +134,9 @@ L(thread_start):
> /* Call the user's function. */
> jal t9
>
> - /* Call _exit rather than doing it inline for breakpoint purposes. */
> move a0,v0
> -#ifdef __PIC__
> - PTR_LA t9,_exit
> - jalr t9
> -#else
> - jal _exit
> -#endif
> + li v0,__NR_clone
> + syscall
Likewise.
--
Joseph S. Myers
joseph@codesourcery.com
More information about the Libc-alpha
mailing list