PATCH: Add Linux/x32 sysdep.h

H.J. Lu hjl.tools@gmail.com
Wed May 16 22:57:00 GMT 2012


On Wed, May 16, 2012 at 3:45 PM, Roland McGrath <roland@hack.frob.com> wrote:
>>       * sysdeps/unix/sysv/linux/x86_64/sysdep.h
>>       (SYSCALL_SET_ERROR_RETURN):  New.
>
> Spurious double space here.
>
>>       (SYSCALL_ERROR_HANDLER): Use R*LP on long and pointer
>>       Use SYSCALL_SET_ERROR_RETURN to set error return.
>>
>>       * sysdeps/unix/sysv/linux/x86_64/x32/llseek.S: New file.
>>       * sysdeps/unix/sysv/linux/x86_64/x32/sysdep.h: Likewise.
>
> No blank line here, because these are all part of one logical change.
>
>> --- /dev/null
>> +++ b/sysdeps/unix/sysv/linux/x86_64/x32/llseek.S
>> @@ -0,0 +1,35 @@
>> +/* Copyright (C) 2012 Free Software Foundation, Inc.
>> +   This file is part of the GNU C Library.
>
> Every single time you add a new file, make the top line a descriptive comment.
>
>> +/* Set error return to 64-bit -1 since the lseek system call returns a
>> +   64-bit integer.  */
>> +#undef SYSCALL_SET_ERROR_RETURN
>> +#define SYSCALL_SET_ERROR_RETURN or $-1, %rax
>> +
>> +PSEUDO (__libc_lseek64, lseek, 3)
>> +     ret
>> +PSEUDO_END (__libc_lseek64)
>
> What does the non-PIC llseek.o look like?
> I bet it jumps to __syscall_error, and so does the wrong thing.
>
> Exactly what I suggested still seems better.  If you find a different way
> to make the non-PIC case right, I bet it will be more convoluted and
> harder to read.
>

I will fix them.  Thanks.


-- 
H.J.



More information about the Libc-alpha mailing list