This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH, ARM] Add support for value 3 of Tag_ABI_VFP_args attribute
- From: Alan Modra <amodra at gmail dot com>
- To: Nicholas Clifton <nickc at redhat dot com>
- Cc: Thomas Preud'homme <thomas dot preudhomme at arm dot com>, binutils at sourceware dot org
- Date: Thu, 25 Dec 2014 22:22:05 +1030
- Subject: Re: [PATCH, ARM] Add support for value 3 of Tag_ABI_VFP_args attribute
- Authentication-results: sourceware.org; auth=none
- References: <002e01cfdafa$10ac4c00$3204e400$ at arm dot com> <002501cfe390$3edc1440$bc943cc0$ at arm dot com> <54510F8D dot 9020202 at redhat dot com> <001201cff392$27668a40$76339ec0$ at arm dot com> <001601cfff20$e6bce850$b436b8f0$ at arm dot com> <54996EE0 dot 2080407 at redhat dot com>
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