[v4,0/4] Args adjustment with ./ld.so exe [BZ #23293]

Message ID cover.1651643916.git.szabolcs.nagy@arm.com
Headers
Series Args adjustment with ./ld.so exe [BZ #23293] |

Message

Szabolcs Nagy May 4, 2022, 6:26 a.m. UTC
  Instead of opt-in, now all targets use the same logic.  This may be a
slight regression on targets where argv does not have to be moved,
but in exchange ld.so behaviour is more consistent.

I only tested on aarch64, the patches are available in nsz/bug23293
branch and may need runtime testing on other targets too.
(run the tests without --enable-hardcoded-path-in-tests)

Szabolcs Nagy (4):
  rtld: Use generic argv adjustment in ld.so [BZ #23293]
  rtld: Remove DL_ARGV_NOT_RELRO
  linux: Add a getauxval test [BZ #23293]
  aarch64: Move ld.so _start to separate file and drop _dl_skip_args

 elf/rtld.c                               | 90 ++++++++++++++++++------
 sysdeps/aarch64/Makefile                 |  1 +
 sysdeps/aarch64/dl-machine.h             | 77 +-------------------
 sysdeps/aarch64/dl-start.S               | 53 ++++++++++++++
 sysdeps/aarch64/dl-sysdep.h              |  4 --
 sysdeps/alpha/dl-sysdep.h                | 23 ------
 sysdeps/arc/dl-sysdep.h                  |  4 --
 sysdeps/arm/dl-sysdep.h                  |  4 --
 sysdeps/csky/dl-sysdep.h                 | 23 ------
 sysdeps/generic/ldsodefs.h               | 15 ++--
 sysdeps/ia64/dl-sysdep.h                 | 23 ------
 sysdeps/nios2/dl-sysdep.h                |  4 --
 sysdeps/s390/s390-32/dl-sysdep.h         | 23 ------
 sysdeps/sparc/dl-sysdep.h                | 23 ------
 sysdeps/unix/sysv/linux/Makefile         |  1 +
 sysdeps/unix/sysv/linux/dl-sysdep.c      |  5 +-
 sysdeps/unix/sysv/linux/ia64/dl-sysdep.h |  4 --
 sysdeps/unix/sysv/linux/tst-getauxval.c  | 74 +++++++++++++++++++
 18 files changed, 206 insertions(+), 245 deletions(-)
 create mode 100644 sysdeps/aarch64/dl-start.S
 delete mode 100644 sysdeps/alpha/dl-sysdep.h
 delete mode 100644 sysdeps/csky/dl-sysdep.h
 delete mode 100644 sysdeps/ia64/dl-sysdep.h
 delete mode 100644 sysdeps/s390/s390-32/dl-sysdep.h
 delete mode 100644 sysdeps/sparc/dl-sysdep.h
 create mode 100644 sysdeps/unix/sysv/linux/tst-getauxval.c