diff options
author | Andreas Krebbel <Andreas.Krebbel@de.ibm.com> | 2010-01-15 09:10:44 -0800 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2010-01-15 09:10:44 -0800 |
commit | 7760ccced8883571bc00b42ed29384381d1413a5 (patch) | |
tree | c9663ac91bbe68511333b001cb4f63484ea0d52e /sysdeps/s390/s390-32/dl-machine.h | |
parent | 3a56ea26730755076cb5bc1d07727c7a4fcb8fd7 (diff) | |
download | glibc-7760ccced8883571bc00b42ed29384381d1413a5.zip glibc-7760ccced8883571bc00b42ed29384381d1413a5.tar.gz glibc-7760ccced8883571bc00b42ed29384381d1413a5.tar.bz2 |
/390: Add runtime check for the highgprs kernel feature.
Diffstat (limited to 'sysdeps/s390/s390-32/dl-machine.h')
-rw-r--r-- | sysdeps/s390/s390-32/dl-machine.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sysdeps/s390/s390-32/dl-machine.h b/sysdeps/s390/s390-32/dl-machine.h index 251a5f6..415b388 100644 --- a/sysdeps/s390/s390-32/dl-machine.h +++ b/sysdeps/s390/s390-32/dl-machine.h @@ -27,6 +27,7 @@ #include <sys/param.h> #include <string.h> #include <link.h> +#include <sysdeps/s390/dl-procinfo.h> /* This is an older, now obsolete value. */ #define EM_S390_OLD 0xA390 @@ -35,6 +36,12 @@ static inline int elf_machine_matches_host (const Elf32_Ehdr *ehdr) { + /* Check if the kernel provides the high gpr facility if needed by + the binary. */ + if ((ehdr->e_flags & EF_S390_HIGH_GPRS) + && !(GLRO (dl_hwcap) & HWCAP_S390_HIGH_GPRS)) + return 0; + return (ehdr->e_machine == EM_S390 || ehdr->e_machine == EM_S390_OLD) && ehdr->e_ident[EI_CLASS] == ELFCLASS32; } |