]> git.ipfire.org Git - thirdparty/glibc.git/commit
elf: early conversion of elf p_flags to mprotect flags
authorCupertino Miranda <cupertino.miranda@oracle.com>
Fri, 22 Aug 2025 10:37:00 +0000 (11:37 +0100)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Wed, 27 Aug 2025 13:45:45 +0000 (10:45 -0300)
commit3b2b88cceeb79f73a72367800d91599e2af4bb39
treea4f7c0efe8d6c2a49ac448c977a639e609c3f45c
parent921e251e8f364d00fc753274095007275381ae65
elf: early conversion of elf p_flags to mprotect flags

This patch replaces _dl_stack_flags global variable by
_dl_stack_prot_flags.
The advantage is that any convertion from p_flags to final used mprotect
flags occurs at loading of p_flags. It avoids repeated spurious
convertions of _dl_stack_flags, for example in allocate_thread_stack.

This modification was suggested in:
  https://sourceware.org/pipermail/libc-alpha/2025-March/165537.html

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
30 files changed:
elf/Makefile
elf/dl-execstack-tunable.c
elf/dl-load.c
elf/dl-support.c
elf/rtld.c
include/alloca.h
include/stackinfo.h
nptl/allocatestack.c
support/support_stack_alloc.c
sysdeps/alpha/stackinfo.h
sysdeps/arm/stackinfo.h
sysdeps/generic/ldsodefs.h
sysdeps/generic/stackinfo.h
sysdeps/hppa/stackinfo.h
sysdeps/i386/stackinfo.h
sysdeps/m68k/stackinfo.h
sysdeps/mach/htl/pt-stack-alloc.c
sysdeps/mach/hurd/dl-execstack.c
sysdeps/mach/hurd/htl/pt-sysdep.c
sysdeps/microblaze/stackinfo.h
sysdeps/mips/stackinfo.h
sysdeps/or1k/stackinfo.h
sysdeps/powerpc/powerpc32/stackinfo.h
sysdeps/s390/stackinfo.h
sysdeps/sh/stackinfo.h
sysdeps/sparc/stackinfo.h
sysdeps/unix/sysv/linux/dl-execstack.c
sysdeps/unix/sysv/linux/machine-sp.h
sysdeps/unix/sysv/linux/spawni.c
sysdeps/x86_64/stackinfo.h