about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2017-02-08 16:30:43 -0200
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2017-02-08 16:30:43 -0200
commit42de7e20299e0bab8b8b761b34ebcd4b60c68132 (patch)
treef66af59db4fc36c046ed1b8f01b44543bb864ec8
parentef8659eab64fc24979afa2bd5a272dacf662a7d2 (diff)
downloadglibc-42de7e20299e0bab8b8b761b34ebcd4b60c68132.tar.gz
glibc-42de7e20299e0bab8b8b761b34ebcd4b60c68132.tar.xz
glibc-42de7e20299e0bab8b8b761b34ebcd4b60c68132.zip
aarch64: fix errno address calculation in SYSCALL_ERROR_HANDLER
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.

Checked on aarch64-linux-gnu.

	* sysdeps/unix/sysv/linux/aarch64/sysdep.h: use PTR_REG() for offset
	calculation in SYSCALL_ERROR_HANDLER().

[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
-rw-r--r--ChangeLog5
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/sysdep.h2
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 951daa7da0..e2fe0d752d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2017-02-08  Yury Norov  <ynorov@caviumnetworks.com>
+
+	* sysdeps/unix/sysv/linux/aarch64/sysdep.h: use PTR_REG() for offset
+	calculation in SYSCALL_ERROR_HANDLER().
+
 2017-02-08  Rical Jasan  <ricaljasan@pacific.net>
 
 	* manual/contrib.texi: Fix typo.
diff --git a/sysdeps/unix/sysv/linux/aarch64/sysdep.h b/sysdeps/unix/sysv/linux/aarch64/sysdep.h
index ad49241620..f301638a81 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];					\