[0/3] Checking HWCAP bits against compiler flags

Message ID cover.1620304013.git.fweimer@redhat.com
Headers
Series Checking HWCAP bits against compiler flags |

Message

Florian Weimer May 6, 2021, 12:30 p.m. UTC
  This series adds checks after HWCAP parsing that all bits required for
compiler flags are present.  It is brittle by design because invalid
instructions could already have been used by the dynamic loader at this
point, but for our downstream use case, it is an improvement over a
plain SIGILL.  (If this is deemed too hackish, I'll probably revert our
downstream changes.)

Tested on various variants on z13, z15, POWER8 and POWER9, and also
built with build-many-glibcs.py.

Thanks,
Florian

Florian Weimer (3):
  elf: Add hook for checking HWCAP bits after auxiliary vector parsing
  powerpc64le: Check HWCAP bits against compiler build flags
  s390x: Check HWCAP bits against compiler flags

 elf/dl-sysdep.c                               |  3 ++
 sysdeps/generic/dl-hwcap-check.h              | 28 +++++++++++
 sysdeps/powerpc/powerpc64/le/dl-hwcap-check.h | 49 +++++++++++++++++++
 sysdeps/s390/s390-64/dl-hwcap-check.h         | 40 +++++++++++++++
 4 files changed, 120 insertions(+)
 create mode 100644 sysdeps/generic/dl-hwcap-check.h
 create mode 100644 sysdeps/powerpc/powerpc64/le/dl-hwcap-check.h
 create mode 100644 sysdeps/s390/s390-64/dl-hwcap-check.h