powerpc: Consolidate Linux syscall definition

System Internals / glibc - Adhemerval Zanella [linaro.org] - 15 February 2020 00:09 EST

The diferences between powerpc64{le} and powerpc32 Linux sysdep.h are:

1. On both vDSO and syscall macros the volatile registers r9, r10, r11, and r12 are used as input operands on powerpc32 and as clobber registers on powerpc64. However the outcome is essentially the same, it advertise the register might be clobbered by the kernel (although Linux won't leak register information to userland in such case).

2. The LOADARGS* macros uses a different size to check for invalid types.

3. The pointer mangling support guard pointer loading uses ABI specific instruction and register.

This patch consolidates on only one sysdep by using the the powerpc64
version as default and add the adjustments required for powerpc32.

Checked on powerpc64-linux-gnu, powerpc64le-linux-gnu, and powerpc-linux-gnu-power4.

cd72a13f22 powerpc: Consolidate Linux syscall definition
sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h | 214 ---------------------
sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h | 196 +------------------
sysdeps/unix/sysv/linux/powerpc/sysdep.h | 208 +++++++++++++++++++-
3 files changed, 209 insertions(+), 409 deletions(-)

Upstream: sourceware.org


  • Share