From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14680 invoked by alias); 23 Aug 2012 15:37:25 -0000 Received: (qmail 14442 invoked by uid 22791); 23 Aug 2012 15:37:23 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from cheddar.halon.org.uk (HELO cheddar.halon.org.uk) (217.10.144.130) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 23 Aug 2012 15:37:08 +0000 Received: from bsmtp by cheddar.halon.org.uk with local-bsmtp (Exim 4.72) (envelope-from ) id 1T4ZSw-0003Lf-Fs; Thu, 23 Aug 2012 16:37:02 +0100 Received: from stemci01 by e102122-lin with local (Exim 4.76) (envelope-from ) id 1T4ZRz-0003m9-Ex; Thu, 23 Aug 2012 16:36:03 +0100 Date: Thu, 23 Aug 2012 15:37:00 -0000 From: Steve McIntyre To: "Joseph S. Myers" Cc: Roland McGrath , libc-alpha@sourceware.org, libc-ports@sourceware.org Subject: Re: ARM hard-float ABI: add ldconfig flag value Message-ID: <20120823153556.GB8449@linaro.org> References: <20120802181352.GJ24537@linaro.org> <20120802182602.77E082C0A8@topped-with-meat.com> <20120803164526.GO24537@linaro.org> <20120808134012.GA25789@linaro.org> <20120809002913.GA2131@einval.com> <20120809132012.GT24537@linaro.org> <20120822153954.GA8449@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-attached: none User-Agent: Mutt/1.5.21 (2010-09-15) Mailing-List: contact libc-ports-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: libc-ports-owner@sourceware.org X-SW-Source: 2012-08/txt/msg00160.txt.bz2 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 Linaro.org | Open source software for ARM SoCs