aboutsummaryrefslogtreecommitdiff
path: root/ports/sysdeps/unix
diff options
context:
space:
mode:
authorSteve McIntyre <steve.mcintyre@linaro.org>2012-08-23 20:38:25 +0000
committerJoseph Myers <joseph@codesourcery.com>2012-08-23 20:38:25 +0000
commitd3bafbc98e91e97b67b5402ec5f87eef7edfd64b (patch)
tree988246498843887e2742d62c9b86029834030b49 /ports/sysdeps/unix
parent4efcc022656a709cc78cd9078a5bfc2b19323bc7 (diff)
downloadglibc-d3bafbc98e91e97b67b5402ec5f87eef7edfd64b.tar
glibc-d3bafbc98e91e97b67b5402ec5f87eef7edfd64b.tar.gz
glibc-d3bafbc98e91e97b67b5402ec5f87eef7edfd64b.tar.bz2
glibc-d3bafbc98e91e97b67b5402ec5f87eef7edfd64b.zip
Check floating-point ABI in ARM VALID_ELF_HEADER.
Diffstat (limited to 'ports/sysdeps/unix')
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/ldsodefs.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/ports/sysdeps/unix/sysv/linux/arm/ldsodefs.h b/ports/sysdeps/unix/sysv/linux/arm/ldsodefs.h
index 8980bb1996..d958862225 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/ldsodefs.h
+++ b/ports/sysdeps/unix/sysv/linux/arm/ldsodefs.h
@@ -27,10 +27,22 @@
#define EXTRA_OSABI ELFOSABI_ARM_AEABI
+#ifdef __ARM_PCS_VFP
+# define VALID_FLOAT_ABI(x) \
+ ((EF_ARM_EABI_VERSION ((x)) != EF_ARM_EABI_VER5) \
+ || !((x) & EF_ARM_ABI_FLOAT_SOFT))
+#else
+# define VALID_FLOAT_ABI(x) \
+ ((EF_ARM_EABI_VERSION ((x)) != EF_ARM_EABI_VER5) \
+ || !((x) & EF_ARM_ABI_FLOAT_HARD))
+#endif
+
+#undef VALID_ELF_HEADER
#define VALID_ELF_HEADER(hdr,exp,size) \
- (memcmp (hdr, exp, size) == 0 \
- || memcmp (hdr, expected2, size) == 0 \
- || memcmp (hdr, expected3, size) == 0)
+ ((memcmp (hdr, exp, size) == 0 \
+ || memcmp (hdr, expected2, size) == 0 \
+ || memcmp (hdr, expected3, size) == 0) \
+ && VALID_FLOAT_ABI (ehdr->e_flags))
#define VALID_ELF_OSABI(osabi) (osabi == ELFOSABI_SYSV \
|| osabi == EXTRA_OSABI \
|| osabi == ELFOSABI_LINUX)