This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Call exit directly in clone (BZ #21512)
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- Cc: <libc-alpha at sourceware dot org>
- Date: Fri, 23 Jun 2017 13:14:47 +0000
- Subject: Re: [PATCH] Call exit directly in clone (BZ #21512)
- Authentication-results: sourceware.org; auth=none
- References: <1498221450-8381-1-git-send-email-adhemerval.zanella@linaro.org>
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