This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ARM hard-float ABI: add ldconfig flag value


On Wed, Aug 22, 2012 at 04:12:40PM +0000, Joseph S. Myers wrote:
>On Wed, 22 Aug 2012, Steve McIntyre wrote:
>
>> Here's the text that we're planning to add for the next release of the
>> "ELF for the ARM Architecture" doc. I hope this covers what you're
>> asking for?
>
>Yes, I think this is sufficient.

Awesome :-)

>> There's minor changes to the exact spelling of the new flags
>> (s/EABI/ABI/). I'll send an updated patch with that change and
>> whatever coding style issues you'd like fixed, just let me know
>> please.
>
>I don't know exactly what coding style issues Roland had in mind.  Apart 
>from the spaces in function / macro calls that I already mentioned, I 
>wouldn't use a space after "!" (but there's nothing specific in the GNU 
>Coding Standards on that point, though for GCC avoiding space after "!" is 
>a documented convention).

OK, here's the updated patch with the name change and tweaks to
style. All OK?

diff --git a/elf/elf.h b/elf/elf.h
index 1e67ef5..6c85f92 100644
--- a/elf/elf.h
+++ b/elf/elf.h
@@ -2250,6 +2250,9 @@ typedef Elf32_Addr Elf32_Conflict;
 #define EF_ARM_VFP_FLOAT	0x400
 #define EF_ARM_MAVERICK_FLOAT	0x800
 
+#define EF_ARM_ABI_FLOAT_SOFT	0x200   /* NB conflicts with EF_ARM_SOFT_FLOAT */
+#define EF_ARM_ABI_FLOAT_HARD	0x400   /* NB conflicts with EF_ARM_VFP_FLOAT */
+
 
 /* Other constants defined in the ARM ELF spec. version B-01.  */
 /* NB. These conflict with values defined above.  */
diff --git a/ports/sysdeps/unix/sysv/linux/arm/ldsodefs.h b/ports/sysdeps/unix/sysv/linux/arm/ldsodefs.h
index 8980bb1..77c3d8a 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, exp, size) == 0		\
    || memcmp (hdr, expected2, size) == 0	\
-   || memcmp (hdr, expected3, 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)


Cheers,
-- 
Steve McIntyre                                steve.mcintyre@linaro.org
<http://www.linaro.org/> Linaro.org | Open source software for ARM SoCs


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]