This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] aarch64: fix errno address calculation in SYSCALL_ERROR_HANDLER()
- From: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- To: libc-alpha at sourceware dot org
- Date: Tue, 7 Feb 2017 10:10:42 -0200
- Subject: Re: [PATCH] aarch64: fix errno address calculation in SYSCALL_ERROR_HANDLER()
- Authentication-results: sourceware.org; auth=none
- References: <1486468092-20986-1-git-send-email-ynorov@caviumnetworks.com>
If it is an user visible issue it requires a bugzilla report (although I am not
sure in this situation since I think this issue should arise only for ilp32).
Also, errno for mmap in particular should be covered on 'posix/tst-mmap.c'.
When/how exactly this issues is triggered? It could be a good thing to have
at least a regression check or increase coverage in an existing test.
On 07/02/2017 09:48, Yury Norov wrote:
> This patch fixes the last regression in LTP lite scenario (mmap16) comparing
> to lp64 in my source trees [1, 2]. The fix has been suggested back in 2015 [3]
> but was never applied, so I reinvented the weel while debugging mmap16.
>
> [1] https://github.com/norov/glibc/tree/dev9
> [2] https://github.com/norov/linux/tree/ilp32-20170203
> [3] https://sourceware.org/ml/libc-alpha/2015-03/msg00587.html
>
> * sysdeps/unix/sysv/linux/aarch64/sysdep.h: use PTR_REG() for offset
> calculation in SYSCALL_ERROR_HANDLER().
>
> ---
> sysdeps/unix/sysv/linux/aarch64/sysdep.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sysdeps/unix/sysv/linux/aarch64/sysdep.h b/sysdeps/unix/sysv/linux/aarch64/sysdep.h
> index 1ffabc2..d926e19 100644
> --- a/sysdeps/unix/sysv/linux/aarch64/sysdep.h
> +++ b/sysdeps/unix/sysv/linux/aarch64/sysdep.h
> @@ -108,7 +108,7 @@
> .Lsyscall_error: \
> adrp x1, :gottprel:errno; \
> neg w2, w0; \
> - ldr x1, [x1, :gottprel_lo12:errno]; \
> + ldr PTR_REG (1), [x1, :gottprel_lo12:errno]; \
> mrs x3, tpidr_el0; \
> mov x0, -1; \
> str w2, [x1, x3]; \
>