public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH, ARM] Add support for value 3 of Tag_ABI_VFP_args attribute
@ 2014-09-28  8:58 Thomas Preud'homme
  2014-10-09  7:11 ` Thomas Preud'homme
  0 siblings, 1 reply; 8+ messages in thread
From: Thomas Preud'homme @ 2014-09-28  8:58 UTC (permalink / raw)
  To: binutils

[-- Attachment #1: Type: text/plain, Size: 2070 bytes --]

Hi,

This patch adds support for the value 3 of the Tag_ABI_VFP_args EABI attribute, in particular with linking. A file with value 3 for this attribute can be linked to other files with any value for this attribute, for instance with value 0 (softfloat, default) or value 1 (hardfloat). The patchs also extends readelf and gdb to handle this new value and add testcases in bfd.

ChangeLog are as follows:

*** bfd/ChangeLog ***

2014-07-23  Thomas Preud'homme  <thomas.preudhomme@arm.com>

	* elf32-arm.c (elf32_arm_merge_eabi_attributes): Handle new
	Tag_ABI_VFP_args value.
	(elf32_arm_post_process_headers): Set e_flags in ELF header as soft
	float instead of hard float when Tag_ABI_VFP_args is 2 or 3.

*** binutils/ChangeLog ***

2014-07-23  Thomas Preud'homme  <thomas.preudhomme@arm.com>

	* readelf.c (arm_attr_tag_ABI_VFP_args): Add "compatible".

*** gdb/ChangeLog ***

2014-07-23  Thomas Preud'homme  <thomas.preudhomme@arm.com>

	* arm-tdep.c (arm_gdbarch_init): Explicitely handle value 3 of
	Tag_ABI_VFP_args.

*** gold/ChangeLog ***

2014-07-23  Thomas Preud'homme  <thomas.preudhomme@arm.com>

	* arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
	as soft float instead of hard float when Tag_ABI_VFP_args is 2 or 3.
	(Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
	value.

*** ld/testsuite/ChangeLog ***

2014-07-23  Thomas Preud'homme  <thomas.preudhomme@arm.com>

	* ld-arm/attr-merge-2a.s: Add Tag_ABI_VFP_args.
	* ld-arm/attr-merge-2b.s: Likewise.
	* ld-arm/attr-merge-2.attr: Likewise.
	* ld-arm/attr-merge-4a.s: Add Tag_ABI_FP_number_model and
	Tag_ABI_VFP_args.
	* ld-arm/attr-merge-4b.s: Likewise.
	* ld-arm/attr-merge-4.attr: Likewise.
	* ld-arm/attr-merge-6a.s: Likewise.
	* ld-arm/attr-merge-6b.s: Likewise.
	* ld-arm/attr-merge-6.attr: Add Tag_ABI_FP_number_model.


See patch in attachment.

This was tested with with the binutils regression testsuite and no new regressions were found. Is it OK for trunk?

Best regards,

Thomas Preud'homme

[-- Attachment #2: Tag_ABI_VFP_args_3.diff --]
[-- Type: application/octet-stream, Size: 7679 bytes --]

diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index e6f4a9f..063d437 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -11717,10 +11717,14 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, bfd *obfd)
   /* This needs to happen before Tag_ABI_FP_number_model is merged.  */
   if (in_attr[Tag_ABI_VFP_args].i != out_attr[Tag_ABI_VFP_args].i)
     {
-      /* Ignore mismatches if the object doesn't use floating point.  */
-      if (out_attr[Tag_ABI_FP_number_model].i == 0)
+      /* Ignore mismatches if the object doesn't use floating point or is
+	 floating point ABI independent.  */
+      if (out_attr[Tag_ABI_FP_number_model].i == 0
+	  || (in_attr[Tag_ABI_FP_number_model].i != 0
+	      && out_attr[Tag_ABI_VFP_args].i == 3))
 	out_attr[Tag_ABI_VFP_args].i = in_attr[Tag_ABI_VFP_args].i;
-      else if (in_attr[Tag_ABI_FP_number_model].i != 0)
+      else if (in_attr[Tag_ABI_FP_number_model].i != 0
+	       && in_attr[Tag_ABI_VFP_args].i != 3)
 	{
 	  _bfd_error_handler
 	    (_("error: %B uses VFP register arguments, %B does not"),
@@ -14671,7 +14675,7 @@ elf32_arm_post_process_headers (bfd * abfd, struct bfd_link_info * link_info ATT
       && ((i_ehdrp->e_type == ET_DYN) || (i_ehdrp->e_type == ET_EXEC)))
     {
       int abi = bfd_elf_get_obj_attr_int (abfd, OBJ_ATTR_PROC, Tag_ABI_VFP_args);
-      if (abi)
+      if (abi == 1)
 	i_ehdrp->e_flags |= EF_ARM_ABI_FLOAT_HARD;
       else
 	i_ehdrp->e_flags |= EF_ARM_ABI_FLOAT_SOFT;
diff --git a/binutils/readelf.c b/binutils/readelf.c
index f038422..2e451bf 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -11585,7 +11585,7 @@ static const char * arm_attr_tag_ABI_enum_size[] =
 static const char * arm_attr_tag_ABI_HardFP_use[] =
   {"As Tag_FP_arch", "SP only", "DP only", "SP and DP"};
 static const char * arm_attr_tag_ABI_VFP_args[] =
-  {"AAPCS", "VFP registers", "custom"};
+  {"AAPCS", "VFP registers", "custom", "compatible"};
 static const char * arm_attr_tag_ABI_WMMX_args[] =
   {"AAPCS", "WMMX registers", "custom"};
 static const char * arm_attr_tag_ABI_optimization_goals[] =
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index cb0030c..17473b3 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -9997,9 +9997,16 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 			     conventions" - we don't know any such
 			     conventions, so leave it as "auto".  */
 			  break;
+			case 3:
+			  /* "Code is compatible with both the base
+			     and VFP variants; the user did not permit
+			     non-variadic functions to pass FP
+			     parameters/results" - leave it as
+			     "auto".  */
+			  break;
 			default:
 			  /* Attribute value not mentioned in the
-			     October 2008 ABI, so leave it as
+			     November 2012 ABI, so leave it as
 			     "auto".  */
 			  break;
 			}
diff --git a/gold/arm.cc b/gold/arm.cc
index 6c472bb..4af9f62 100644
--- a/gold/arm.cc
+++ b/gold/arm.cc
@@ -10056,7 +10056,7 @@ Target_arm<big_endian>::do_adjust_elf_header(
     if (type == elfcpp::ET_EXEC || type == elfcpp::ET_DYN)
       {
 	Object_attribute* attr = this->get_aeabi_object_attribute(elfcpp::Tag_ABI_VFP_args);
-	if (attr->int_value())
+	if (attr->int_value() == 1)
 	  flags |= elfcpp::EF_ARM_ABI_FLOAT_HARD;
 	else
 	  flags |= elfcpp::EF_ARM_ABI_FLOAT_SOFT;
@@ -10493,10 +10493,13 @@ Target_arm<big_endian>::merge_object_attributes(
       != out_attr[elfcpp::Tag_ABI_VFP_args].int_value())
     {
       // Ignore mismatches if the object doesn't use floating point.  */
-      if (out_attr[elfcpp::Tag_ABI_FP_number_model].int_value() == 0)
+      if (out_attr[elfcpp::Tag_ABI_FP_number_model].int_value() == 0
+	  || (in_attr[elfcpp::Tag_ABI_FP_number_model].int_value() != 0
+	      && out_attr[elfcpp::Tag_ABI_VFP_args].int_value() == 3))
 	out_attr[elfcpp::Tag_ABI_VFP_args].set_int_value(
 	    in_attr[elfcpp::Tag_ABI_VFP_args].int_value());
       else if (in_attr[elfcpp::Tag_ABI_FP_number_model].int_value() != 0
+	       && in_attr[elfcpp::Tag_ABI_VFP_args].int_value() != 3
 	       && parameters->options().warn_mismatch())
 	gold_error(_("%s uses VFP register arguments, output does not"),
 		   name);
diff --git a/ld/testsuite/ld-arm/attr-merge-2.attr b/ld/testsuite/ld-arm/attr-merge-2.attr
index 578333b..9f63df4 100644
--- a/ld/testsuite/ld-arm/attr-merge-2.attr
+++ b/ld/testsuite/ld-arm/attr-merge-2.attr
@@ -11,4 +11,5 @@ File Attributes
   Tag_ABI_align_needed: 8-byte
   Tag_ABI_align_preserved: 8-byte, except leaf SP
   Tag_ABI_enum_size: small
+  Tag_ABI_VFP_args: VFP registers
   Tag_ABI_optimization_goals: Aggressive Debug
diff --git a/ld/testsuite/ld-arm/attr-merge-2a.s b/ld/testsuite/ld-arm/attr-merge-2a.s
index 0303163..8a7260c 100644
--- a/ld/testsuite/ld-arm/attr-merge-2a.s
+++ b/ld/testsuite/ld-arm/attr-merge-2a.s
@@ -6,5 +6,6 @@
 	.eabi_attribute 24, 1
 	.eabi_attribute 25, 1
 	.eabi_attribute 26, 1
+	.eabi_attribute 28, 3
 	.eabi_attribute 30, 6
 	.file	"attr-merge-2a.s"
diff --git a/ld/testsuite/ld-arm/attr-merge-2b.s b/ld/testsuite/ld-arm/attr-merge-2b.s
index 047890a..a22776b 100644
--- a/ld/testsuite/ld-arm/attr-merge-2b.s
+++ b/ld/testsuite/ld-arm/attr-merge-2b.s
@@ -6,6 +6,7 @@
 	.eabi_attribute 24, 1
 	.eabi_attribute 25, 1
 	.eabi_attribute 26, 1
+	.eabi_attribute 28, 1
 	.eabi_attribute 30, 6
 	.eabi_attribute 18, 4
 	.file	"attr-merge-2b.s"
diff --git a/ld/testsuite/ld-arm/attr-merge-4.attr b/ld/testsuite/ld-arm/attr-merge-4.attr
index 75fd063..f74b024 100644
--- a/ld/testsuite/ld-arm/attr-merge-4.attr
+++ b/ld/testsuite/ld-arm/attr-merge-4.attr
@@ -5,4 +5,6 @@ File Attributes
   Tag_CPU_arch_profile: Microcontroller
   Tag_ARM_ISA_use: Yes
   Tag_THUMB_ISA_use: Thumb-1
+  Tag_ABI_FP_number_model: IEEE 754
+  Tag_ABI_VFP_args: compatible
   Tag_also_compatible_with: v6-M
diff --git a/ld/testsuite/ld-arm/attr-merge-4a.s b/ld/testsuite/ld-arm/attr-merge-4a.s
index b5b77bf..9282fa2 100644
--- a/ld/testsuite/ld-arm/attr-merge-4a.s
+++ b/ld/testsuite/ld-arm/attr-merge-4a.s
@@ -5,3 +5,6 @@
 
 	@ Tag_also_compatible_with = v6-M
 	.eabi_attribute Tag_also_compatible_with, "\006\013"
+
+	.eabi_attribute Tag_ABI_FP_number_model, 3
+	.eabi_attribute Tag_ABI_VFP_args, 3
diff --git a/ld/testsuite/ld-arm/attr-merge-4b.s b/ld/testsuite/ld-arm/attr-merge-4b.s
index d2eb6de..2cf68df 100644
--- a/ld/testsuite/ld-arm/attr-merge-4b.s
+++ b/ld/testsuite/ld-arm/attr-merge-4b.s
@@ -5,3 +5,6 @@
 
 	@ Tag_also_compatible_with = v4T
 	.eabi_attribute Tag_also_compatible_with, "\006\002"
+
+	.eabi_attribute Tag_ABI_FP_number_model, 0
+	.eabi_attribute Tag_ABI_VFP_args, 0
diff --git a/ld/testsuite/ld-arm/attr-merge-6.attr b/ld/testsuite/ld-arm/attr-merge-6.attr
index 0af32f7..1ee5d40 100644
--- a/ld/testsuite/ld-arm/attr-merge-6.attr
+++ b/ld/testsuite/ld-arm/attr-merge-6.attr
@@ -5,5 +5,6 @@ File Attributes
   Tag_CPU_arch_profile: Application
   Tag_ARM_ISA_use: Yes
   Tag_THUMB_ISA_use: Thumb-2
+  Tag_ABI_FP_number_model: IEEE 754
   Tag_MPextension_use: Allowed
   Tag_Virtualization_use: TrustZone
diff --git a/ld/testsuite/ld-arm/attr-merge-6a.s b/ld/testsuite/ld-arm/attr-merge-6a.s
index 056d8c8..0423bbf 100644
--- a/ld/testsuite/ld-arm/attr-merge-6a.s
+++ b/ld/testsuite/ld-arm/attr-merge-6a.s
@@ -1,4 +1,6 @@
 	.cpu cortex-a9
 	.fpu softvfp
+	.eabi_attribute 23, 3
+	.eabi_attribute 28, 0
 	.eabi_attribute 70, 1
 	.file	"attr-merge-6a.s"
diff --git a/ld/testsuite/ld-arm/attr-merge-6b.s b/ld/testsuite/ld-arm/attr-merge-6b.s
index b9ef4d2..9383bcc 100644
--- a/ld/testsuite/ld-arm/attr-merge-6b.s
+++ b/ld/testsuite/ld-arm/attr-merge-6b.s
@@ -1,3 +1,5 @@
 	.cpu cortex-a9
 	.fpu softvfp
+	.eabi_attribute 23, 3
+	.eabi_attribute 28, 3
 	.file	"attr-merge-6b.s"

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

* RE: [PATCH, ARM] Add support for value 3 of Tag_ABI_VFP_args attribute
  2014-09-28  8:58 [PATCH, ARM] Add support for value 3 of Tag_ABI_VFP_args attribute Thomas Preud'homme
@ 2014-10-09  7:11 ` Thomas Preud'homme
  2014-10-29 16:02   ` Nicholas Clifton
  0 siblings, 1 reply; 8+ messages in thread
From: Thomas Preud'homme @ 2014-10-09  7:11 UTC (permalink / raw)
  To: binutils

[-- Attachment #1: Type: text/plain, Size: 2707 bytes --]

Ping?

I reattached the patch to this email.

Please apologize if an answer usually takes more time, I'm not au fait of
how binutils community works.

Best regards,

Thomas

> -----Original Message-----
> From: binutils-owner@sourceware.org [mailto:binutils-
> owner@sourceware.org] On Behalf Of Thomas Preud'homme
> Sent: Sunday, September 28, 2014 4:56 PM
> To: binutils@sourceware.org
> Subject: [PATCH, ARM] Add support for value 3 of Tag_ABI_VFP_args
> attribute
> 
> Hi,
> 
> This patch adds support for the value 3 of the Tag_ABI_VFP_args EABI
> attribute, in particular with linking. A file with value 3 for this attribute can
> be linked to other files with any value for this attribute, for instance with
> value 0 (softfloat, default) or value 1 (hardfloat). The patchs also extends
> readelf and gdb to handle this new value and add testcases in bfd.
> 
> ChangeLog are as follows:
> 
> *** bfd/ChangeLog ***
> 
> 2014-07-23  Thomas Preud'homme  <thomas.preudhomme@arm.com>
> 
> 	* elf32-arm.c (elf32_arm_merge_eabi_attributes): Handle new
> 	Tag_ABI_VFP_args value.
> 	(elf32_arm_post_process_headers): Set e_flags in ELF header as
> soft
> 	float instead of hard float when Tag_ABI_VFP_args is 2 or 3.
> 
> *** binutils/ChangeLog ***
> 
> 2014-07-23  Thomas Preud'homme  <thomas.preudhomme@arm.com>
> 
> 	* readelf.c (arm_attr_tag_ABI_VFP_args): Add "compatible".
> 
> *** gdb/ChangeLog ***
> 
> 2014-07-23  Thomas Preud'homme  <thomas.preudhomme@arm.com>
> 
> 	* arm-tdep.c (arm_gdbarch_init): Explicitely handle value 3 of
> 	Tag_ABI_VFP_args.
> 
> *** gold/ChangeLog ***
> 
> 2014-07-23  Thomas Preud'homme  <thomas.preudhomme@arm.com>
> 
> 	* arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF
> header
> 	as soft float instead of hard float when Tag_ABI_VFP_args is 2 or
> 3.
> 	(Target_arm::merge_object_attributes): Handle new
> Tag_ABI_VFP_args
> 	value.
> 
> *** ld/testsuite/ChangeLog ***
> 
> 2014-07-23  Thomas Preud'homme  <thomas.preudhomme@arm.com>
> 
> 	* ld-arm/attr-merge-2a.s: Add Tag_ABI_VFP_args.
> 	* ld-arm/attr-merge-2b.s: Likewise.
> 	* ld-arm/attr-merge-2.attr: Likewise.
> 	* ld-arm/attr-merge-4a.s: Add Tag_ABI_FP_number_model and
> 	Tag_ABI_VFP_args.
> 	* ld-arm/attr-merge-4b.s: Likewise.
> 	* ld-arm/attr-merge-4.attr: Likewise.
> 	* ld-arm/attr-merge-6a.s: Likewise.
> 	* ld-arm/attr-merge-6b.s: Likewise.
> 	* ld-arm/attr-merge-6.attr: Add Tag_ABI_FP_number_model.
> 
> 
> See patch in attachment.
> 
> This was tested with with the binutils regression testsuite and no new
> regressions were found. Is it OK for trunk?
> 
> Best regards,
> 
> Thomas Preud'homme

[-- Attachment #2: gcc32rm-291.2.3.diff --]
[-- Type: application/octet-stream, Size: 7272 bytes --]

diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index 1c6965e..f0531fe 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -11717,10 +11717,14 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, bfd *obfd)
   /* This needs to happen before Tag_ABI_FP_number_model is merged.  */
   if (in_attr[Tag_ABI_VFP_args].i != out_attr[Tag_ABI_VFP_args].i)
     {
-      /* Ignore mismatches if the object doesn't use floating point.  */
-      if (out_attr[Tag_ABI_FP_number_model].i == 0)
+      /* Ignore mismatches if the object doesn't use floating point or is
+	 floating point ABI independent.  */
+      if (out_attr[Tag_ABI_FP_number_model].i == 0
+	  || (in_attr[Tag_ABI_FP_number_model].i != 0
+	      && out_attr[Tag_ABI_VFP_args].i == 3))
 	out_attr[Tag_ABI_VFP_args].i = in_attr[Tag_ABI_VFP_args].i;
-      else if (in_attr[Tag_ABI_FP_number_model].i != 0)
+      else if (in_attr[Tag_ABI_FP_number_model].i != 0
+	       && in_attr[Tag_ABI_VFP_args].i != 3)
 	{
 	  _bfd_error_handler
 	    (_("error: %B uses VFP register arguments, %B does not"),
diff --git a/binutils/readelf.c b/binutils/readelf.c
index d85786e..ca700a4 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -11590,7 +11590,7 @@ static const char * arm_attr_tag_ABI_enum_size[] =
 static const char * arm_attr_tag_ABI_HardFP_use[] =
   {"As Tag_FP_arch", "SP only", "DP only", "SP and DP"};
 static const char * arm_attr_tag_ABI_VFP_args[] =
-  {"AAPCS", "VFP registers", "custom"};
+  {"AAPCS", "VFP registers", "custom", "compatible"};
 static const char * arm_attr_tag_ABI_WMMX_args[] =
   {"AAPCS", "WMMX registers", "custom"};
 static const char * arm_attr_tag_ABI_optimization_goals[] =
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index 8cc60a4..c6b4229 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -9994,9 +9994,16 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 			     conventions" - we don't know any such
 			     conventions, so leave it as "auto".  */
 			  break;
+			case 3:
+			  /* "Code is compatible with both the base
+			     and VFP variants; the user did not permit
+			     non-variadic functions to pass FP
+			     parameters/results" - leave it as
+			     "auto".  */
+			  break;
 			default:
 			  /* Attribute value not mentioned in the
-			     October 2008 ABI, so leave it as
+			     November 2012 ABI, so leave it as
 			     "auto".  */
 			  break;
 			}
diff --git a/gold/arm.cc b/gold/arm.cc
index 607f9d6..e1c0084 100644
--- a/gold/arm.cc
+++ b/gold/arm.cc
@@ -10056,7 +10056,7 @@ Target_arm<big_endian>::do_adjust_elf_header(
     if (type == elfcpp::ET_EXEC || type == elfcpp::ET_DYN)
       {
 	Object_attribute* attr = this->get_aeabi_object_attribute(elfcpp::Tag_ABI_VFP_args);
-	if (attr->int_value())
+	if (attr->int_value() == 1)
 	  flags |= elfcpp::EF_ARM_ABI_FLOAT_HARD;
 	else
 	  flags |= elfcpp::EF_ARM_ABI_FLOAT_SOFT;
@@ -10493,10 +10493,13 @@ Target_arm<big_endian>::merge_object_attributes(
       != out_attr[elfcpp::Tag_ABI_VFP_args].int_value())
     {
       // Ignore mismatches if the object doesn't use floating point.  */
-      if (out_attr[elfcpp::Tag_ABI_FP_number_model].int_value() == 0)
+      if (out_attr[elfcpp::Tag_ABI_FP_number_model].int_value() == 0
+	  || (in_attr[elfcpp::Tag_ABI_FP_number_model].int_value() != 0
+	      && out_attr[elfcpp::Tag_ABI_VFP_args].int_value() == 3))
 	out_attr[elfcpp::Tag_ABI_VFP_args].set_int_value(
 	    in_attr[elfcpp::Tag_ABI_VFP_args].int_value());
       else if (in_attr[elfcpp::Tag_ABI_FP_number_model].int_value() != 0
+	       && in_attr[elfcpp::Tag_ABI_VFP_args].int_value() != 3
 	       && parameters->options().warn_mismatch())
 	gold_error(_("%s uses VFP register arguments, output does not"),
 		   name);
diff --git a/ld/testsuite/ld-arm/attr-merge-2.attr b/ld/testsuite/ld-arm/attr-merge-2.attr
index 578333b..9f63df4 100644
--- a/ld/testsuite/ld-arm/attr-merge-2.attr
+++ b/ld/testsuite/ld-arm/attr-merge-2.attr
@@ -11,4 +11,5 @@ File Attributes
   Tag_ABI_align_needed: 8-byte
   Tag_ABI_align_preserved: 8-byte, except leaf SP
   Tag_ABI_enum_size: small
+  Tag_ABI_VFP_args: VFP registers
   Tag_ABI_optimization_goals: Aggressive Debug
diff --git a/ld/testsuite/ld-arm/attr-merge-2a.s b/ld/testsuite/ld-arm/attr-merge-2a.s
index 0303163..8a7260c 100644
--- a/ld/testsuite/ld-arm/attr-merge-2a.s
+++ b/ld/testsuite/ld-arm/attr-merge-2a.s
@@ -6,5 +6,6 @@
 	.eabi_attribute 24, 1
 	.eabi_attribute 25, 1
 	.eabi_attribute 26, 1
+	.eabi_attribute 28, 3
 	.eabi_attribute 30, 6
 	.file	"attr-merge-2a.s"
diff --git a/ld/testsuite/ld-arm/attr-merge-2b.s b/ld/testsuite/ld-arm/attr-merge-2b.s
index 047890a..a22776b 100644
--- a/ld/testsuite/ld-arm/attr-merge-2b.s
+++ b/ld/testsuite/ld-arm/attr-merge-2b.s
@@ -6,6 +6,7 @@
 	.eabi_attribute 24, 1
 	.eabi_attribute 25, 1
 	.eabi_attribute 26, 1
+	.eabi_attribute 28, 1
 	.eabi_attribute 30, 6
 	.eabi_attribute 18, 4
 	.file	"attr-merge-2b.s"
diff --git a/ld/testsuite/ld-arm/attr-merge-4.attr b/ld/testsuite/ld-arm/attr-merge-4.attr
index 75fd063..f74b024 100644
--- a/ld/testsuite/ld-arm/attr-merge-4.attr
+++ b/ld/testsuite/ld-arm/attr-merge-4.attr
@@ -5,4 +5,6 @@ File Attributes
   Tag_CPU_arch_profile: Microcontroller
   Tag_ARM_ISA_use: Yes
   Tag_THUMB_ISA_use: Thumb-1
+  Tag_ABI_FP_number_model: IEEE 754
+  Tag_ABI_VFP_args: compatible
   Tag_also_compatible_with: v6-M
diff --git a/ld/testsuite/ld-arm/attr-merge-4a.s b/ld/testsuite/ld-arm/attr-merge-4a.s
index b5b77bf..9282fa2 100644
--- a/ld/testsuite/ld-arm/attr-merge-4a.s
+++ b/ld/testsuite/ld-arm/attr-merge-4a.s
@@ -5,3 +5,6 @@
 
 	@ Tag_also_compatible_with = v6-M
 	.eabi_attribute Tag_also_compatible_with, "\006\013"
+
+	.eabi_attribute Tag_ABI_FP_number_model, 3
+	.eabi_attribute Tag_ABI_VFP_args, 3
diff --git a/ld/testsuite/ld-arm/attr-merge-4b.s b/ld/testsuite/ld-arm/attr-merge-4b.s
index d2eb6de..2cf68df 100644
--- a/ld/testsuite/ld-arm/attr-merge-4b.s
+++ b/ld/testsuite/ld-arm/attr-merge-4b.s
@@ -5,3 +5,6 @@
 
 	@ Tag_also_compatible_with = v4T
 	.eabi_attribute Tag_also_compatible_with, "\006\002"
+
+	.eabi_attribute Tag_ABI_FP_number_model, 0
+	.eabi_attribute Tag_ABI_VFP_args, 0
diff --git a/ld/testsuite/ld-arm/attr-merge-6.attr b/ld/testsuite/ld-arm/attr-merge-6.attr
index 0af32f7..1ee5d40 100644
--- a/ld/testsuite/ld-arm/attr-merge-6.attr
+++ b/ld/testsuite/ld-arm/attr-merge-6.attr
@@ -5,5 +5,6 @@ File Attributes
   Tag_CPU_arch_profile: Application
   Tag_ARM_ISA_use: Yes
   Tag_THUMB_ISA_use: Thumb-2
+  Tag_ABI_FP_number_model: IEEE 754
   Tag_MPextension_use: Allowed
   Tag_Virtualization_use: TrustZone
diff --git a/ld/testsuite/ld-arm/attr-merge-6a.s b/ld/testsuite/ld-arm/attr-merge-6a.s
index 056d8c8..0423bbf 100644
--- a/ld/testsuite/ld-arm/attr-merge-6a.s
+++ b/ld/testsuite/ld-arm/attr-merge-6a.s
@@ -1,4 +1,6 @@
 	.cpu cortex-a9
 	.fpu softvfp
+	.eabi_attribute 23, 3
+	.eabi_attribute 28, 0
 	.eabi_attribute 70, 1
 	.file	"attr-merge-6a.s"
diff --git a/ld/testsuite/ld-arm/attr-merge-6b.s b/ld/testsuite/ld-arm/attr-merge-6b.s
index b9ef4d2..9383bcc 100644
--- a/ld/testsuite/ld-arm/attr-merge-6b.s
+++ b/ld/testsuite/ld-arm/attr-merge-6b.s
@@ -1,3 +1,5 @@
 	.cpu cortex-a9
 	.fpu softvfp
+	.eabi_attribute 23, 3
+	.eabi_attribute 28, 3
 	.file	"attr-merge-6b.s"

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

* Re: [PATCH, ARM] Add support for value 3 of Tag_ABI_VFP_args attribute
  2014-10-09  7:11 ` Thomas Preud'homme
@ 2014-10-29 16:02   ` Nicholas Clifton
  2014-10-29 16:05     ` Thomas Preud'homme
  0 siblings, 1 reply; 8+ messages in thread
From: Nicholas Clifton @ 2014-10-29 16:02 UTC (permalink / raw)
  To: Thomas Preud'homme, binutils

Hi Thomas,

> Ping?

Sorry for the long time in responding to your post.

The patch itself is basically fine, although I do have one request for a
change (see below).  I should mention however that we can only approve
the changes to the binutils sources.  For the change to the GDB sources
you will have to submit a separate email to the
gdb-patches@sourceware.org mailing list.

The one change I would like to see is to replace the use of numeric
values 0, 1, 2, and 3 for the Tag_ABI_VFP tag with words instead.  Ie 
please create an enum for the values and then use the enum values in the 
patch.  This makes the code easier to read in my opinion.

Cheers
   Nick


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

* RE: [PATCH, ARM] Add support for value 3 of Tag_ABI_VFP_args attribute
  2014-10-29 16:02   ` Nicholas Clifton
@ 2014-10-29 16:05     ` Thomas Preud'homme
  2014-11-13  9:05       ` Thomas Preud'homme
  0 siblings, 1 reply; 8+ messages in thread
From: Thomas Preud'homme @ 2014-10-29 16:05 UTC (permalink / raw)
  To: 'Nicholas Clifton', binutils

> From: Nicholas Clifton [mailto:nickc@redhat.com]
> Sent: Wednesday, October 29, 2014 4:02 PM
> 
> The patch itself is basically fine, although I do have one request for a
> change (see below).  I should mention however that we can only
> approve
> the changes to the binutils sources.  For the change to the GDB sources
> you will have to submit a separate email to the
> gdb-patches@sourceware.org mailing list.

Ah thanks for telling me. I didn't know that.

> 
> The one change I would like to see is to replace the use of numeric
> values 0, 1, 2, and 3 for the Tag_ABI_VFP tag with words instead.  Ie
> please create an enum for the values and then use the enum values in
> the
> patch.  This makes the code easier to read in my opinion.

Yep, it makes sense. I'll make a new revision of that patch.

Best regards,

Thomas 




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

* RE: [PATCH, ARM] Add support for value 3 of Tag_ABI_VFP_args attribute
  2014-10-29 16:05     ` Thomas Preud'homme
@ 2014-11-13  9:05       ` Thomas Preud'homme
  2014-12-23 13:32         ` Nicholas Clifton
  0 siblings, 1 reply; 8+ messages in thread
From: Thomas Preud'homme @ 2014-11-13  9:05 UTC (permalink / raw)
  To: nickc, binutils

[-- Attachment #1: Type: text/plain, Size: 2329 bytes --]

Hi Nick,

Please find attach a new version of the patch to add support for the value 3
of the ARM attribute Tag_ABI_VFP_args with your comment addressed.

ChangeLog entries are as follows:

*** bfd/ChangeLog ***

2014-11-06  Thomas Preud'homme  <thomas.preudhomme@arm.com>

	* elf32-arm.c (elf32_arm_merge_eabi_attributes): Handle new
	Tag_ABI_VFP_args value and replace hardcoded values by enum values.
	(elf32_arm_post_process_headers): Set e_flags in ELF header as hard
	float only when Tag_ABI_VFP_args is 1, using new enum value
	AEABI_VFP_args_vfp to check that.


*** binutils/ChangeLog ***

2014-11-03  Thomas Preud'homme  <thomas.preudhomme@arm.com>

        * readelf.c (arm_attr_tag_ABI_VFP_args): Add "compatible".


*** gdb/ChangeLog ***

2014-11-06  Thomas Preud'homme  <thomas.preudhomme@arm.com>

	* arm-tdep.c (arm_gdbarch_init): Explicitely handle value 3 of
	Tag_ABI_VFP_args. Also replace hardcoded values by enum values in the
	switch handling the different values of Tag_ABI_VFP_args.


*** gold/ChangeLog ***

2014-11-06  Thomas Preud'homme  <thomas.preudhomme@arm.com>

	* arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
	as hard float only when Tag_ABI_VFP_args is 1, using new enum value
	AEABI_VFP_args_vfp to check that.
	(Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
	value and replace hardcoded values by enum values.


*** include/elf/ChangeLog ***

2014-11-03  Thomas Preud'homme  <thomas.preudhomme@arm.com>

        * arm.h: New AEABI_FP_number_model_* and AEABI_VFP_args_* enum values.


*** ld/testsuite/ChangeLog ***

2014-11-03  Thomas Preud'homme  <thomas.preudhomme@arm.com>

	* ld-arm/attr-merge-2a.s: Add Tag_ABI_VFP_args.
	* ld-arm/attr-merge-2b.s: Likewise.
	* ld-arm/attr-merge-2.attr: Likewise.
	* ld-arm/attr-merge-4a.s: Add Tag_ABI_FP_number_model and
	Tag_ABI_VFP_args.
	* ld-arm/attr-merge-4b.s: Likewise.
	* ld-arm/attr-merge-4.attr: Likewise.
	* ld-arm/attr-merge-6a.s: Likewise.
	* ld-arm/attr-merge-6b.s: Likewise.
	* ld-arm/attr-merge-6.attr: Add Tag_ABI_FP_number_model. 


Patch in attachment. Testsuite was run without any regression and GCC bootstrapped
and its regression test run without regression neither.

Is it ok for trunk?

Best regards,

Thomas

[-- Attachment #2: gcc32rm-291.3.1.diff --]
[-- Type: application/octet-stream, Size: 9393 bytes --]

diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index 49d0f65..c2bc300 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -11746,10 +11746,14 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, bfd *obfd)
   /* This needs to happen before Tag_ABI_FP_number_model is merged.  */
   if (in_attr[Tag_ABI_VFP_args].i != out_attr[Tag_ABI_VFP_args].i)
     {
-      /* Ignore mismatches if the object doesn't use floating point.  */
-      if (out_attr[Tag_ABI_FP_number_model].i == 0)
+      /* Ignore mismatches if the object doesn't use floating point or is
+	 floating point ABI independent.  */
+      if (out_attr[Tag_ABI_FP_number_model].i == AEABI_FP_number_model_none
+	  || (in_attr[Tag_ABI_FP_number_model].i != AEABI_FP_number_model_none
+	      && out_attr[Tag_ABI_VFP_args].i == AEABI_VFP_args_compatible))
 	out_attr[Tag_ABI_VFP_args].i = in_attr[Tag_ABI_VFP_args].i;
-      else if (in_attr[Tag_ABI_FP_number_model].i != 0)
+      else if (in_attr[Tag_ABI_FP_number_model].i != AEABI_FP_number_model_none
+	       && in_attr[Tag_ABI_VFP_args].i != AEABI_VFP_args_compatible)
 	{
 	  _bfd_error_handler
 	    (_("error: %B uses VFP register arguments, %B does not"),
@@ -14711,7 +14715,7 @@ elf32_arm_post_process_headers (bfd * abfd, struct bfd_link_info * link_info ATT
       && ((i_ehdrp->e_type == ET_DYN) || (i_ehdrp->e_type == ET_EXEC)))
     {
       int abi = bfd_elf_get_obj_attr_int (abfd, OBJ_ATTR_PROC, Tag_ABI_VFP_args);
-      if (abi)
+      if (abi == AEABI_VFP_args_vfp)
 	i_ehdrp->e_flags |= EF_ARM_ABI_FLOAT_HARD;
       else
 	i_ehdrp->e_flags |= EF_ARM_ABI_FLOAT_SOFT;
diff --git a/binutils/readelf.c b/binutils/readelf.c
index 6ddc078..90dda23 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -11621,7 +11621,7 @@ static const char * arm_attr_tag_ABI_enum_size[] =
 static const char * arm_attr_tag_ABI_HardFP_use[] =
   {"As Tag_FP_arch", "SP only", "DP only", "SP and DP"};
 static const char * arm_attr_tag_ABI_VFP_args[] =
-  {"AAPCS", "VFP registers", "custom"};
+  {"AAPCS", "VFP registers", "custom", "compatible"};
 static const char * arm_attr_tag_ABI_WMMX_args[] =
   {"AAPCS", "WMMX registers", "custom"};
 static const char * arm_attr_tag_ABI_optimization_goals[] =
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index 43520cc..a917862 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -10007,27 +10007,34 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 							OBJ_ATTR_PROC,
 							Tag_ABI_VFP_args))
 			{
-			case 0:
+			case (int) AEABI_VFP_args_base:
 			  /* "The user intended FP parameter/result
 			     passing to conform to AAPCS, base
 			     variant".  */
 			  fp_model = ARM_FLOAT_SOFT_VFP;
 			  break;
-			case 1:
+			case (int) AEABI_VFP_args_vfp:
 			  /* "The user intended FP parameter/result
 			     passing to conform to AAPCS, VFP
 			     variant".  */
 			  fp_model = ARM_FLOAT_VFP;
 			  break;
-			case 2:
+			case (int) AEABI_VFP_args_toolchain:
 			  /* "The user intended FP parameter/result
 			     passing to conform to tool chain-specific
 			     conventions" - we don't know any such
 			     conventions, so leave it as "auto".  */
 			  break;
+			case (int) AEABI_VFP_args_compatible:
+			  /* "Code is compatible with both the base
+			     and VFP variants; the user did not permit
+			     non-variadic functions to pass FP
+			     parameters/results" - leave it as
+			     "auto".  */
+			  break;
 			default:
 			  /* Attribute value not mentioned in the
-			     October 2008 ABI, so leave it as
+			     November 2012 ABI, so leave it as
 			     "auto".  */
 			  break;
 			}
diff --git a/gold/arm.cc b/gold/arm.cc
index 6c472bb..4186a2a 100644
--- a/gold/arm.cc
+++ b/gold/arm.cc
@@ -10056,7 +10056,7 @@ Target_arm<big_endian>::do_adjust_elf_header(
     if (type == elfcpp::ET_EXEC || type == elfcpp::ET_DYN)
       {
 	Object_attribute* attr = this->get_aeabi_object_attribute(elfcpp::Tag_ABI_VFP_args);
-	if (attr->int_value())
+	if (attr->int_value() == AEABI_VFP_args_vfp)
 	  flags |= elfcpp::EF_ARM_ABI_FLOAT_HARD;
 	else
 	  flags |= elfcpp::EF_ARM_ABI_FLOAT_SOFT;
@@ -10493,10 +10493,18 @@ Target_arm<big_endian>::merge_object_attributes(
       != out_attr[elfcpp::Tag_ABI_VFP_args].int_value())
     {
       // Ignore mismatches if the object doesn't use floating point.  */
-      if (out_attr[elfcpp::Tag_ABI_FP_number_model].int_value() == 0)
+      if (out_attr[elfcpp::Tag_ABI_FP_number_model].int_value()
+	  == AEABI_FP_number_model_none
+	  || (in_attr[elfcpp::Tag_ABI_FP_number_model].int_value()
+	      != AEABI_FP_number_model_none
+	      && out_attr[elfcpp::Tag_ABI_VFP_args].int_value()
+		 == AEABI_VFP_args_compatible))
 	out_attr[elfcpp::Tag_ABI_VFP_args].set_int_value(
 	    in_attr[elfcpp::Tag_ABI_VFP_args].int_value());
-      else if (in_attr[elfcpp::Tag_ABI_FP_number_model].int_value() != 0
+      else if (in_attr[elfcpp::Tag_ABI_FP_number_model].int_value()
+	       != AEABI_FP_number_model_none
+	       && in_attr[elfcpp::Tag_ABI_VFP_args].int_value()
+		  != AEABI_VFP_args_compatible
 	       && parameters->options().warn_mismatch())
 	gold_error(_("%s uses VFP register arguments, output does not"),
 		   name);
diff --git a/include/elf/arm.h b/include/elf/arm.h
index 34afdfd..e85536b 100644
--- a/include/elf/arm.h
+++ b/include/elf/arm.h
@@ -319,6 +319,23 @@ enum
   Tag_VFP_HP_extension = Tag_FP_HP_extension
 };
 
+/* Values for Tag_ABI_FP_number_model.  */
+enum
+{
+  AEABI_FP_number_model_none = 0,
+  AEABI_FP_number_model_ieee754_number = 1,
+  AEABI_FP_number_model_rtabi = 2,
+  AEABI_FP_number_model_ieee754_all = 3
+};
+
+/* Values for Tag_ABI_VFP_args.  */
+enum
+{
+  AEABI_VFP_args_base = 0,
+  AEABI_VFP_args_vfp = 1,
+  AEABI_VFP_args_toolchain = 2,
+  AEABI_VFP_args_compatible = 3
+};
 #endif
 
 /* The name of the note section used to identify arm variants.  */
diff --git a/ld/testsuite/ld-arm/attr-merge-2.attr b/ld/testsuite/ld-arm/attr-merge-2.attr
index 578333b..9f63df4 100644
--- a/ld/testsuite/ld-arm/attr-merge-2.attr
+++ b/ld/testsuite/ld-arm/attr-merge-2.attr
@@ -11,4 +11,5 @@ File Attributes
   Tag_ABI_align_needed: 8-byte
   Tag_ABI_align_preserved: 8-byte, except leaf SP
   Tag_ABI_enum_size: small
+  Tag_ABI_VFP_args: VFP registers
   Tag_ABI_optimization_goals: Aggressive Debug
diff --git a/ld/testsuite/ld-arm/attr-merge-2a.s b/ld/testsuite/ld-arm/attr-merge-2a.s
index 0303163..8a7260c 100644
--- a/ld/testsuite/ld-arm/attr-merge-2a.s
+++ b/ld/testsuite/ld-arm/attr-merge-2a.s
@@ -6,5 +6,6 @@
 	.eabi_attribute 24, 1
 	.eabi_attribute 25, 1
 	.eabi_attribute 26, 1
+	.eabi_attribute 28, 3
 	.eabi_attribute 30, 6
 	.file	"attr-merge-2a.s"
diff --git a/ld/testsuite/ld-arm/attr-merge-2b.s b/ld/testsuite/ld-arm/attr-merge-2b.s
index 047890a..a22776b 100644
--- a/ld/testsuite/ld-arm/attr-merge-2b.s
+++ b/ld/testsuite/ld-arm/attr-merge-2b.s
@@ -6,6 +6,7 @@
 	.eabi_attribute 24, 1
 	.eabi_attribute 25, 1
 	.eabi_attribute 26, 1
+	.eabi_attribute 28, 1
 	.eabi_attribute 30, 6
 	.eabi_attribute 18, 4
 	.file	"attr-merge-2b.s"
diff --git a/ld/testsuite/ld-arm/attr-merge-4.attr b/ld/testsuite/ld-arm/attr-merge-4.attr
index 75fd063..f74b024 100644
--- a/ld/testsuite/ld-arm/attr-merge-4.attr
+++ b/ld/testsuite/ld-arm/attr-merge-4.attr
@@ -5,4 +5,6 @@ File Attributes
   Tag_CPU_arch_profile: Microcontroller
   Tag_ARM_ISA_use: Yes
   Tag_THUMB_ISA_use: Thumb-1
+  Tag_ABI_FP_number_model: IEEE 754
+  Tag_ABI_VFP_args: compatible
   Tag_also_compatible_with: v6-M
diff --git a/ld/testsuite/ld-arm/attr-merge-4a.s b/ld/testsuite/ld-arm/attr-merge-4a.s
index b5b77bf..9282fa2 100644
--- a/ld/testsuite/ld-arm/attr-merge-4a.s
+++ b/ld/testsuite/ld-arm/attr-merge-4a.s
@@ -5,3 +5,6 @@
 
 	@ Tag_also_compatible_with = v6-M
 	.eabi_attribute Tag_also_compatible_with, "\006\013"
+
+	.eabi_attribute Tag_ABI_FP_number_model, 3
+	.eabi_attribute Tag_ABI_VFP_args, 3
diff --git a/ld/testsuite/ld-arm/attr-merge-4b.s b/ld/testsuite/ld-arm/attr-merge-4b.s
index d2eb6de..2cf68df 100644
--- a/ld/testsuite/ld-arm/attr-merge-4b.s
+++ b/ld/testsuite/ld-arm/attr-merge-4b.s
@@ -5,3 +5,6 @@
 
 	@ Tag_also_compatible_with = v4T
 	.eabi_attribute Tag_also_compatible_with, "\006\002"
+
+	.eabi_attribute Tag_ABI_FP_number_model, 0
+	.eabi_attribute Tag_ABI_VFP_args, 0
diff --git a/ld/testsuite/ld-arm/attr-merge-6.attr b/ld/testsuite/ld-arm/attr-merge-6.attr
index 0af32f7..1ee5d40 100644
--- a/ld/testsuite/ld-arm/attr-merge-6.attr
+++ b/ld/testsuite/ld-arm/attr-merge-6.attr
@@ -5,5 +5,6 @@ File Attributes
   Tag_CPU_arch_profile: Application
   Tag_ARM_ISA_use: Yes
   Tag_THUMB_ISA_use: Thumb-2
+  Tag_ABI_FP_number_model: IEEE 754
   Tag_MPextension_use: Allowed
   Tag_Virtualization_use: TrustZone
diff --git a/ld/testsuite/ld-arm/attr-merge-6a.s b/ld/testsuite/ld-arm/attr-merge-6a.s
index 056d8c8..0423bbf 100644
--- a/ld/testsuite/ld-arm/attr-merge-6a.s
+++ b/ld/testsuite/ld-arm/attr-merge-6a.s
@@ -1,4 +1,6 @@
 	.cpu cortex-a9
 	.fpu softvfp
+	.eabi_attribute 23, 3
+	.eabi_attribute 28, 0
 	.eabi_attribute 70, 1
 	.file	"attr-merge-6a.s"
diff --git a/ld/testsuite/ld-arm/attr-merge-6b.s b/ld/testsuite/ld-arm/attr-merge-6b.s
index b9ef4d2..9383bcc 100644
--- a/ld/testsuite/ld-arm/attr-merge-6b.s
+++ b/ld/testsuite/ld-arm/attr-merge-6b.s
@@ -1,3 +1,5 @@
 	.cpu cortex-a9
 	.fpu softvfp
+	.eabi_attribute 23, 3
+	.eabi_attribute 28, 3
 	.file	"attr-merge-6b.s"

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

* Re: [PATCH, ARM] Add support for value 3 of Tag_ABI_VFP_args attribute
  2014-11-13  9:05       ` Thomas Preud'homme
@ 2014-12-23 13:32         ` Nicholas Clifton
  2014-12-25 11:52           ` Alan Modra
  0 siblings, 1 reply; 8+ messages in thread
From: Nicholas Clifton @ 2014-12-23 13:32 UTC (permalink / raw)
  To: Thomas Preud'homme, binutils

Hi Thomas,

> *** bfd/ChangeLog ***
>
> 2014-11-06  Thomas Preud'homme  <thomas.preudhomme@arm.com>
>
> 	* elf32-arm.c (elf32_arm_merge_eabi_attributes): Handle new
> 	Tag_ABI_VFP_args value and replace hardcoded values by enum values.
> 	(elf32_arm_post_process_headers): Set e_flags in ELF header as hard
> 	float only when Tag_ABI_VFP_args is 1, using new enum value
> 	AEABI_VFP_args_vfp to check that.
>
>
> *** binutils/ChangeLog ***
>
> 2014-11-03  Thomas Preud'homme  <thomas.preudhomme@arm.com>
>
>          * readelf.c (arm_attr_tag_ABI_VFP_args): Add "compatible".
>
>
> *** gdb/ChangeLog ***
>
> 2014-11-06  Thomas Preud'homme  <thomas.preudhomme@arm.com>
>
> 	* arm-tdep.c (arm_gdbarch_init): Explicitely handle value 3 of
> 	Tag_ABI_VFP_args. Also replace hardcoded values by enum values in the
> 	switch handling the different values of Tag_ABI_VFP_args.
>
>
> *** gold/ChangeLog ***
>
> 2014-11-06  Thomas Preud'homme  <thomas.preudhomme@arm.com>
>
> 	* arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
> 	as hard float only when Tag_ABI_VFP_args is 1, using new enum value
> 	AEABI_VFP_args_vfp to check that.
> 	(Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
> 	value and replace hardcoded values by enum values.
>
>
> *** include/elf/ChangeLog ***
>
> 2014-11-03  Thomas Preud'homme  <thomas.preudhomme@arm.com>
>
>          * arm.h: New AEABI_FP_number_model_* and AEABI_VFP_args_* enum values.
>
>
> *** ld/testsuite/ChangeLog ***
>
> 2014-11-03  Thomas Preud'homme  <thomas.preudhomme@arm.com>
>
> 	* ld-arm/attr-merge-2a.s: Add Tag_ABI_VFP_args.
> 	* ld-arm/attr-merge-2b.s: Likewise.
> 	* ld-arm/attr-merge-2.attr: Likewise.
> 	* ld-arm/attr-merge-4a.s: Add Tag_ABI_FP_number_model and
> 	Tag_ABI_VFP_args.
> 	* ld-arm/attr-merge-4b.s: Likewise.
> 	* ld-arm/attr-merge-4.attr: Likewise.
> 	* ld-arm/attr-merge-6a.s: Likewise.
> 	* ld-arm/attr-merge-6b.s: Likewise.
> 	* ld-arm/attr-merge-6.attr: Add Tag_ABI_FP_number_model.


Approved - please apply.

Once again, sorry for the delay in reviewing this patch. :-(

Cheers
   Nick



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

* Re: [PATCH, ARM] Add support for value 3 of Tag_ABI_VFP_args attribute
  2014-12-23 13:32         ` Nicholas Clifton
@ 2014-12-25 11:52           ` Alan Modra
  2014-12-26  8:29             ` Thomas Preud'homme
  0 siblings, 1 reply; 8+ messages in thread
From: Alan Modra @ 2014-12-25 11:52 UTC (permalink / raw)
  To: Nicholas Clifton; +Cc: Thomas Preud'homme, binutils

On Tue, Dec 23, 2014 at 01:32:16PM +0000, Nicholas Clifton wrote:
> >*** gold/ChangeLog ***
> >
> >2014-11-06  Thomas Preud'homme  <thomas.preudhomme@arm.com>
> >
> >	* arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
> >	as hard float only when Tag_ABI_VFP_args is 1, using new enum value
> >	AEABI_VFP_args_vfp to check that.
> >	(Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
> >	value and replace hardcoded values by enum values.

This part doesn't even compile.  :-(

Committing the following to fix it.

elfcpp/
	* arm.h: Add enums for Tag_ABI_FP_number_model and Tag_ABI_VFP_args.
gold/
	* arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
	new enums.
	(Target_arm::merge_object_attributes, ): Likewise.

diff --git a/elfcpp/arm.h b/elfcpp/arm.h
index 8c6b6bf..8a86595 100644
--- a/elfcpp/arm.h
+++ b/elfcpp/arm.h
@@ -340,6 +340,24 @@ enum
   AEABI_enum_forced_wide = 3
 };
 
+// Values for Tag_ABI_FP_number_model.
+enum
+{
+  AEABI_FP_number_model_none = 0,
+  AEABI_FP_number_model_ieee754_number = 1,
+  AEABI_FP_number_model_rtabi = 2,
+  AEABI_FP_number_model_ieee754_all = 3
+};
+
+// Values for Tag_ABI_VFP_args.
+enum
+{
+  AEABI_VFP_args_base = 0,
+  AEABI_VFP_args_vfp = 1,
+  AEABI_VFP_args_toolchain = 2,
+  AEABI_VFP_args_compatible = 3
+};
+
 // For Exception Index Table. (Exception handling ABI for the ARM
 // architectue, Section 5)
 enum
diff --git a/gold/arm.cc b/gold/arm.cc
index 4186a2a..8485ab3 100644
--- a/gold/arm.cc
+++ b/gold/arm.cc
@@ -10056,7 +10056,7 @@ Target_arm<big_endian>::do_adjust_elf_header(
     if (type == elfcpp::ET_EXEC || type == elfcpp::ET_DYN)
       {
 	Object_attribute* attr = this->get_aeabi_object_attribute(elfcpp::Tag_ABI_VFP_args);
-	if (attr->int_value() == AEABI_VFP_args_vfp)
+	if (attr->int_value() == elfcpp::AEABI_VFP_args_vfp)
 	  flags |= elfcpp::EF_ARM_ABI_FLOAT_HARD;
 	else
 	  flags |= elfcpp::EF_ARM_ABI_FLOAT_SOFT;
@@ -10494,17 +10494,17 @@ Target_arm<big_endian>::merge_object_attributes(
     {
       // Ignore mismatches if the object doesn't use floating point.  */
       if (out_attr[elfcpp::Tag_ABI_FP_number_model].int_value()
-	  == AEABI_FP_number_model_none
+	  == elfcpp::AEABI_FP_number_model_none
 	  || (in_attr[elfcpp::Tag_ABI_FP_number_model].int_value()
-	      != AEABI_FP_number_model_none
+	      != elfcpp::AEABI_FP_number_model_none
 	      && out_attr[elfcpp::Tag_ABI_VFP_args].int_value()
-		 == AEABI_VFP_args_compatible))
+		 == elfcpp::AEABI_VFP_args_compatible))
 	out_attr[elfcpp::Tag_ABI_VFP_args].set_int_value(
 	    in_attr[elfcpp::Tag_ABI_VFP_args].int_value());
       else if (in_attr[elfcpp::Tag_ABI_FP_number_model].int_value()
-	       != AEABI_FP_number_model_none
+	       != elfcpp::AEABI_FP_number_model_none
 	       && in_attr[elfcpp::Tag_ABI_VFP_args].int_value()
-		  != AEABI_VFP_args_compatible
+		  != elfcpp::AEABI_VFP_args_compatible
 	       && parameters->options().warn_mismatch())
 	gold_error(_("%s uses VFP register arguments, output does not"),
 		   name);

-- 
Alan Modra
Australia Development Lab, IBM

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

* RE: [PATCH, ARM] Add support for value 3 of Tag_ABI_VFP_args attribute
  2014-12-25 11:52           ` Alan Modra
@ 2014-12-26  8:29             ` Thomas Preud'homme
  0 siblings, 0 replies; 8+ messages in thread
From: Thomas Preud'homme @ 2014-12-26  8:29 UTC (permalink / raw)
  To: 'Alan Modra', nickc; +Cc: binutils

Oh my. Sincere apologize. I remember doing a version with the two headers and then removing the changes in one with the source still compiling and the testsuite passing. I probably had some stale version of the file somewhere.

Thanks a lot for fixing the failure.

Best regards and merry Christmas,

Thomas


> -----Original Message-----
> From: Alan Modra [mailto:amodra@gmail.com]
> Sent: Thursday, December 25, 2014 11:52 AM
> To: nickc@redhat.com
> Cc: Thomas Preud'homme; binutils@sourceware.org
> Subject: Re: [PATCH, ARM] Add support for value 3 of Tag_ABI_VFP_args
> attribute
> 
> On Tue, Dec 23, 2014 at 01:32:16PM +0000, Nicholas Clifton wrote:
> > >*** gold/ChangeLog ***
> > >
> > >2014-11-06  Thomas Preud'homme
> <thomas.preudhomme@arm.com>
> > >
> > >	* arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF
> header
> > >	as hard float only when Tag_ABI_VFP_args is 1, using new enum
> value
> > >	AEABI_VFP_args_vfp to check that.
> > >	(Target_arm::merge_object_attributes): Handle new
> Tag_ABI_VFP_args
> > >	value and replace hardcoded values by enum values.
> 
> This part doesn't even compile.  :-(
> 
> Committing the following to fix it.
> 
> elfcpp/
> 	* arm.h: Add enums for Tag_ABI_FP_number_model and
> Tag_ABI_VFP_args.
> gold/
> 	* arm.cc (Target_arm::do_adjust_elf_header): Provide
> namespace on
> 	new enums.
> 	(Target_arm::merge_object_attributes, ): Likewise.
> 
> diff --git a/elfcpp/arm.h b/elfcpp/arm.h
> index 8c6b6bf..8a86595 100644
> --- a/elfcpp/arm.h
> +++ b/elfcpp/arm.h
> @@ -340,6 +340,24 @@ enum
>    AEABI_enum_forced_wide = 3
>  };
> 
> +// Values for Tag_ABI_FP_number_model.
> +enum
> +{
> +  AEABI_FP_number_model_none = 0,
> +  AEABI_FP_number_model_ieee754_number = 1,
> +  AEABI_FP_number_model_rtabi = 2,
> +  AEABI_FP_number_model_ieee754_all = 3
> +};
> +
> +// Values for Tag_ABI_VFP_args.
> +enum
> +{
> +  AEABI_VFP_args_base = 0,
> +  AEABI_VFP_args_vfp = 1,
> +  AEABI_VFP_args_toolchain = 2,
> +  AEABI_VFP_args_compatible = 3
> +};
> +
>  // For Exception Index Table. (Exception handling ABI for the ARM
>  // architectue, Section 5)
>  enum
> diff --git a/gold/arm.cc b/gold/arm.cc
> index 4186a2a..8485ab3 100644
> --- a/gold/arm.cc
> +++ b/gold/arm.cc
> @@ -10056,7 +10056,7 @@
> Target_arm<big_endian>::do_adjust_elf_header(
>      if (type == elfcpp::ET_EXEC || type == elfcpp::ET_DYN)
>        {
>  	Object_attribute* attr = this-
> >get_aeabi_object_attribute(elfcpp::Tag_ABI_VFP_args);
> -	if (attr->int_value() == AEABI_VFP_args_vfp)
> +	if (attr->int_value() == elfcpp::AEABI_VFP_args_vfp)
>  	  flags |= elfcpp::EF_ARM_ABI_FLOAT_HARD;
>  	else
>  	  flags |= elfcpp::EF_ARM_ABI_FLOAT_SOFT;
> @@ -10494,17 +10494,17 @@
> Target_arm<big_endian>::merge_object_attributes(
>      {
>        // Ignore mismatches if the object doesn't use floating point.  */
>        if (out_attr[elfcpp::Tag_ABI_FP_number_model].int_value()
> -	  == AEABI_FP_number_model_none
> +	  == elfcpp::AEABI_FP_number_model_none
>  	  || (in_attr[elfcpp::Tag_ABI_FP_number_model].int_value()
> -	      != AEABI_FP_number_model_none
> +	      != elfcpp::AEABI_FP_number_model_none
>  	      && out_attr[elfcpp::Tag_ABI_VFP_args].int_value()
> -		 == AEABI_VFP_args_compatible))
> +		 == elfcpp::AEABI_VFP_args_compatible))
>  	out_attr[elfcpp::Tag_ABI_VFP_args].set_int_value(
>  	    in_attr[elfcpp::Tag_ABI_VFP_args].int_value());
>        else if (in_attr[elfcpp::Tag_ABI_FP_number_model].int_value()
> -	       != AEABI_FP_number_model_none
> +	       != elfcpp::AEABI_FP_number_model_none
>  	       && in_attr[elfcpp::Tag_ABI_VFP_args].int_value()
> -		  != AEABI_VFP_args_compatible
> +		  != elfcpp::AEABI_VFP_args_compatible
>  	       && parameters->options().warn_mismatch())
>  	gold_error(_("%s uses VFP register arguments, output does
> not"),
>  		   name);
> 
> --
> Alan Modra
> Australia Development Lab, IBM




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

end of thread, other threads:[~2014-12-26  8:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-28  8:58 [PATCH, ARM] Add support for value 3 of Tag_ABI_VFP_args attribute Thomas Preud'homme
2014-10-09  7:11 ` Thomas Preud'homme
2014-10-29 16:02   ` Nicholas Clifton
2014-10-29 16:05     ` Thomas Preud'homme
2014-11-13  9:05       ` Thomas Preud'homme
2014-12-23 13:32         ` Nicholas Clifton
2014-12-25 11:52           ` Alan Modra
2014-12-26  8:29             ` Thomas Preud'homme

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).