linux: Consolidate brk implementation

System Internals / glibc - Adhemerval Zanella [linaro.org] - 10 December 2020 20:42 UTC

It removes all the arch-specific assembly implementation. The outliers are alpha, where its kernel ABI explict return -ENOMEM in case of failure; and i686, where it can't use "call *%gs:SYSINFO_OFFSET" during statup in static PIE.

Also some ABIs exports an additional ___brk_addr symbol and to handle it an internal HAVE_INTERNAL_BRK_ADDR_SYMBOL is added.

Checked on x86_64-linux-gnu, i686-linux-gnu, adn with builsd for the affected ABIs.

720480934a linux: Consolidate brk implementation
sysdeps/unix/sysv/linux/aarch64/sysdep.h | 3 +
sysdeps/unix/sysv/linux/alpha/brk.S | 83 -------------------
sysdeps/unix/sysv/linux/{arm => alpha}/brk.c | 13 ++-
sysdeps/unix/sysv/linux/alpha/dl-brk.S | 1 -
sysdeps/unix/sysv/linux/arc/sysdep.h | 3 +
sysdeps/unix/sysv/linux/{generic => }/brk.c | 6 +-
sysdeps/unix/sysv/linux/csky/sysdep.h | 3 +
sysdeps/unix/sysv/linux/dl-brk.c | 5 --
sysdeps/unix/sysv/linux/hppa/brk.c | 41 ----------
sysdeps/unix/sysv/linux/i386/brk.c | 23 +-----
sysdeps/unix/sysv/linux/i386/sysdep.h | 3 +
sysdeps/unix/sysv/linux/ia64/brk.S | 50 ------------
sysdeps/unix/sysv/linux/ia64/dl-brk.S | 1 -
sysdeps/unix/sysv/linux/ia64/sysdep.h | 3 +
sysdeps/unix/sysv/linux/m68k/brk.c | 46 -----------
sysdeps/unix/sysv/linux/m68k/sysdep.h | 3 +
sysdeps/unix/sysv/linux/microblaze/brk.c | 42 ----------
sysdeps/unix/sysv/linux/microblaze/sysdep.h | 3 +
sysdeps/unix/sysv/linux/mips/brk.c | 46 -----------
sysdeps/unix/sysv/linux/mips/mips32/sysdep.h | 3 +
sysdeps/unix/sysv/linux/mips/mips64/sysdep.h | 3 +
sysdeps/unix/sysv/linux/nios2/sysdep.h | 3 +
sysdeps/unix/sysv/linux/powerpc/dl-brk.S | 1 -
sysdeps/unix/sysv/linux/powerpc/powerpc32/brk.S | 52 ------------
sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S | 43 ----------
sysdeps/unix/sysv/linux/riscv/sysdep.h | 3 +
sysdeps/unix/sysv/linux/s390/brk.c | 55 -------------
sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h | 5 ++
sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h | 5 ++
sysdeps/unix/sysv/linux/sh/brk.c | 47 -----------
sysdeps/unix/sysv/linux/sparc/sparc32/brk.c | 54 ------------
sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h | 3 +
sysdeps/unix/sysv/linux/sparc/sparc64/brk.S | 104 ------------------------
sysdeps/unix/sysv/linux/sparc/sparc64/dl-brk.S | 1 -
sysdeps/unix/sysv/linux/sysdep.h | 4 +
sysdeps/unix/sysv/linux/x86_64/brk.c | 41 ----------
36 files changed, 60 insertions(+), 745 deletions(-)

Upstream: sourceware.org


  • Share