public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Add support for new ABI choice e_flags values on ARM
@ 2012-08-30 13:22 Steve McIntyre
  2012-08-30 14:53 ` Joseph S. Myers
  0 siblings, 1 reply; 6+ messages in thread
From: Steve McIntyre @ 2012-08-30 13:22 UTC (permalink / raw)
  To: binutils

Hi folks,

Here's a small set of changes to add support for the new
EF_ARM_ABI_FLOAT_SOFT and EF_ARM_ABI_FLOAT_HARD e_flags values, as
added to glibc last week. How does this look?

bfd:
    * elf32-arm.c (elf32_arm_print_private_bfd_data): Recognise and
    display the new ARM hard-float/soft-float ABI flags for EABI_VER5

binutils:
    * readelf.c (decode_ARM_machine_flags): Recognise and display the
    new ARM hard-float/soft-float ABI flags for EABI_VER5. Split out
    the code for EABI_VER4 and EABI_VER5 to allow this.

elfcpp:
    * arm.h: New enum for EABI soft- and hard-float flags.

gas:
    * config/tc-arm.c (md_begin): Use the new ARM
    hard-float/soft-float ABI flags for EABI_VER5

include:
    * elf/arm.h (EF_ARM_ABI_FLOAT_SOFT): New define.
    (EF_ARM_ABI_FLOAT_HARD): Likewise.
---
 bfd/ChangeLog       |    5 +++++
 bfd/elf32-arm.c     |    9 +++++++++
 binutils/ChangeLog  |    6 ++++++
 binutils/readelf.c  |   35 +++++++++++++++++++++++++++++++++--
 elfcpp/ChangeLog    |    4 ++++
 elfcpp/arm.h        |    8 ++++++++
 gas/ChangeLog       |    5 +++++
 gas/config/tc-arm.c |   14 ++++++++++++--
 include/ChangeLog   |    5 +++++
 include/elf/arm.h   |    5 +++++
 10 files changed, 92 insertions(+), 4 deletions(-)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 3ec6b2f..9ee5e44 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2012-08-29  Steve McIntyre  <steve.mcintyre@linaro.org>
+
+	* elf32-arm.c (elf32_arm_print_private_bfd_data): Recognise and
+	display the new ARM hard-float/soft-float ABI flags for EABI_VER5
+
 2012-08-28  Maciej W. Rozycki  <macro@codesourcery.com>
 
 	* elf32-ppc.c (ppc_elf_relocate_section): Assert that dynindx is
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index a287fbb..e3b4d76 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -12110,6 +12110,15 @@ elf32_arm_print_private_bfd_data (bfd *abfd, void * ptr)
 
     case EF_ARM_EABI_VER5:
       fprintf (file, _(" [Version5 EABI]"));
+
+      if (flags & EF_ARM_ABI_FLOAT_SOFT)
+	fprintf (file, _(" [soft-float ABI]"));
+
+      if (flags & EF_ARM_ABI_FLOAT_HARD)
+	fprintf (file, _(" [hard-float ABI]"));
+
+      flags &= ~(EF_ARM_ABI_FLOAT_SOFT | EF_ARM_ABI_FLOAT_HARD);
+
     eabi:
       if (flags & EF_ARM_BE8)
 	fprintf (file, _(" [BE8]"));
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 922396a..66f450b 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,9 @@
+2012-08-29  Steve McIntyre  <steve.mcintyre@linaro.org>
+
+	* readelf.c (decode_ARM_machine_flags): Recognise and display the
+	new ARM hard-float/soft-float ABI flags for EABI_VER5. Split out
+	the code for EABI_VER4 and EABI_VER5 to allow this.
+
 2012-08-24  Matthew Gretton-Dann  <matthew.gretton-dann@arm.com>
 
 	* readelf.c (arm_attr_tag_CPU_arch): Update for ARMv8.
diff --git a/binutils/readelf.c b/binutils/readelf.c
index 89cff24..3054810 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -2104,11 +2104,34 @@ decode_ARM_machine_flags (unsigned e_flags, char buf[])
 
     case EF_ARM_EABI_VER4:
       strcat (buf, ", Version4 EABI");
-      goto eabi;
+      while (e_flags)
+	{
+	  unsigned flag;
+
+	  /* Process flags one bit at a time.  */
+	  flag = e_flags & - e_flags;
+	  e_flags &= ~ flag;
+
+	  switch (flag)
+	    {
+	    case EF_ARM_BE8:
+	      strcat (buf, ", BE8");
+	      break;
+
+	    case EF_ARM_LE8:
+	      strcat (buf, ", LE8");
+	      break;
+
+	    default:
+	      unknown = 1;
+	      break;
+	    }
+      break;
+	}
+      break;
 
     case EF_ARM_EABI_VER5:
       strcat (buf, ", Version5 EABI");
-    eabi:
       while (e_flags)
 	{
 	  unsigned flag;
@@ -2127,6 +2150,14 @@ decode_ARM_machine_flags (unsigned e_flags, char buf[])
 	      strcat (buf, ", LE8");
 	      break;
 
+	    case EF_ARM_ABI_FLOAT_SOFT: /* Conflicts with EF_ARM_SOFT_FLOAT.  */
+	      strcat (buf, ", soft-float ABI");
+	      break;
+
+	    case EF_ARM_ABI_FLOAT_HARD: /* Conflicts with EF_ARM_VFP_FLOAT.  */
+	      strcat (buf, ", hard-float ABI");
+	      break;
+
 	    default:
 	      unknown = 1;
 	      break;
diff --git a/elfcpp/ChangeLog b/elfcpp/ChangeLog
index 90b7229..f4b9135 100644
--- a/elfcpp/ChangeLog
+++ b/elfcpp/ChangeLog
@@ -1,3 +1,7 @@
+2012-08-29  Steve McIntyre  <steve.mcintyre@linaro.org>
+
+	* arm.h: New enum for EABI soft- and hard-float flags.
+
 2012-08-14  Alan Modra  <amodra@gmail.com>
 
 	* powerpc.h: Add more relocs.
diff --git a/elfcpp/arm.h b/elfcpp/arm.h
index cb85eeb..4cb79d6 100644
--- a/elfcpp/arm.h
+++ b/elfcpp/arm.h
@@ -222,6 +222,14 @@ inline Elf_Word
 arm_eabi_version(Elf_Word flags)
 { return flags & EF_ARM_EABIMASK; }
 
+// EABI_VER5 e_flags values for identifying soft- and hard-float ABI
+// choice.
+enum
+{
+  EF_ARM_ABI_FLOAT_SOFT = 0x200,
+  EF_ARM_ABI_FLOAT_HARD = 0x400,
+};
+
 // Values for the Tag_CPU_arch EABI attribute.
 enum
 {
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 88e9110..4ea5739 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,8 @@
+2012-08-29  Steve McIntyre  <steve.mcintyre@linaro.org>
+
+	* config/tc-arm.c (md_begin): Use the new ARM
+	hard-float/soft-float ABI flags for EABI_VER5
+
 2012-08-27  Walter Lee  <walt@tilera.com>
 
 	* tc-tilegx.c (O_hw0_plt): Define operator.
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index ad4018b..152bedf 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -23460,12 +23460,22 @@ md_begin (void)
 	if (ARM_CPU_HAS_FEATURE (cpu_variant, fpu_arch_maverick))
 	    flags |= EF_ARM_MAVERICK_FLOAT;
 	break;
-
       case EF_ARM_EABI_VER4:
-      case EF_ARM_EABI_VER5:
 	/* No additional flags to set.	*/
 	break;
+      case EF_ARM_EABI_VER5:
+	switch (mfloat_abi_opt)
+	  {
+	  case ARM_FLOAT_ABI_SOFT:
+	  case ARM_FLOAT_ABI_SOFTFP:
+	    flags |= EF_ARM_ABI_FLOAT_SOFT;
+	    break;
 
+	  case ARM_FLOAT_ABI_HARD:
+	    flags |= EF_ARM_ABI_FLOAT_HARD;
+	    break;
+	  }
+	break;
       default:
 	abort ();
       }
diff --git a/include/ChangeLog b/include/ChangeLog
index ad7f0f1..6c02897 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,8 @@
+2012-08-29  Steve McIntyre  <steve.mcintyre@linaro.org>
+
+	* elf/arm.h (EF_ARM_ABI_FLOAT_SOFT): New define.
+	(EF_ARM_ABI_FLOAT_HARD): Likewise.
+
 2012-08-24  Sriraman Tallam  <tmsriram@google.com>
 
 	* plugin-api.h (ld_plugin_allow_unique_segment_for_sections):
diff --git a/include/elf/arm.h b/include/elf/arm.h
index 8ea3fe8..d799303 100644
--- a/include/elf/arm.h
+++ b/include/elf/arm.h
@@ -46,6 +46,11 @@
 #define EF_ARM_MAPSYMSFIRST 0x10	/* NB conflicts with EF_APCS_FLOAT.  */
 #define EF_ARM_EABIMASK      0xFF000000
 
+/* New constants defined in the ARM ELF spec. version XXX.
+   Only valid in conjunction with EF_ARM_EABI_VER5. */
+#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.  */
+
 /* Constants defined in AAELF.  */
 #define EF_ARM_BE8	    0x00800000
 #define EF_ARM_LE8	    0x00400000
-- 
1.7.9.5



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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-10-26 14:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-30 13:22 [PATCH] Add support for new ABI choice e_flags values on ARM Steve McIntyre
2012-08-30 14:53 ` Joseph S. Myers
2012-08-31  1:03   ` Steve McIntyre
2012-09-04 17:26   ` Steve McIntyre
2012-09-17 13:45     ` Steve McIntyre
2012-10-26 14:57     ` nick clifton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).