This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Call exit directly in clone (BZ #21512)



> On 23 Jun 2017, at 10:14, Joseph Myers <joseph@codesourcery.com> wrote:
> 
>> 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.
> 

Ugh... I will fix it.

>> 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.
> 

Same.

> -- 
> Joseph S. Myers
> joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]