aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorMatthew Gretton-Dann <matthew.gretton-dann@arm.com>2010-02-18 10:56:28 +0000
committerMatthew Gretton-Dann <matthew.gretton-dann@arm.com>2010-02-18 10:56:28 +0000
commitcd21e5460f664d311f34645388138a44c228dc97 (patch)
tree7e54cb6be39aecfd063c1883fe5b8a7f81b9df5a /bfd
parentb2fc24d469b6025b1a7729acb6032e74a875a734 (diff)
downloadgdb-cd21e5460f664d311f34645388138a44c228dc97.zip
gdb-cd21e5460f664d311f34645388138a44c228dc97.tar.gz
gdb-cd21e5460f664d311f34645388138a44c228dc97.tar.bz2
* bfd/elf32-arm.c (elf32_arm_merge_eabi_attributes): Add support for
merging Tag_DIV_use, Tag_MPextension_use, and Tag_MPextension_use_legacy tags. * binutils/readelf.c (arm_attr_tag_Advanced_SIMD_arch): Add description of newly permitted attribute values. (arm_attr_tag_Virtualization_use): Likewise. (arm_attr_tag_DIV_use): Add description of new attribute. (arm_attr_tag_MPextension_use_legacy): Likewise. * gas/config/tc-arm.c (arm_convert_symbolic_attribute): Add Tag_DIV_use. * gas/doc/c-arm.texi: Likewise. * gas/testsuite/gas/arm/attr-order.d: Fix test for new names for attribute values. * include/elf/arm.h (Tag_MPextension_use): Renumber. (Tag_DIV_use): Add. (Tag_MPextension_use_legacy): Likewise. * ld/testsuite/ld-arm/attr-merge-3.attr: Fix test for new attribute values. * ld/testsuite/ld-arm/attr-merge-3b.s: Likewise. * ld/testsuite/ld-arm/attr-merge-unknown-1.d: Fix test now that 42 is a recognised attribute ID. * ld/testsuite/ld-arm/attr-merge-unknown-1.s: Likewise. * ld/testsuite/ld-arm/attr-merge-6.attr: New test. * ld/testsuite/ld-arm/attr-merge-6a.s: Likewise. * ld/testsuite/ld-arm/attr-merge-6b.s: Likewise. * ld/testsuite/ld-arm/attr-merge-7.attr: Likewise. * ld/testsuite/ld-arm/attr-merge-7a.s: Likewise. * ld/testsuite/ld-arm/attr-merge-7b.s: Likewise. * ld/testsuite/ld-arm/arm-elf.exp: Run the new tests.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elf32-arm.c72
2 files changed, 76 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 60d0ecc..8e0e2dd 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2010-02-18 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
+
+ * elf32-arm.c (elf32_arm_merge_eabi_attributes): Add support for
+ merging Tag_DIV_use, Tag_MPextension_use, and
+ Tag_MPextension_use_legacy tags.
+
2010-02-18 Alan Modra <amodra@gmail.com>
* elf.c (bfd_elf_set_group_contents): Revert accidental 2009-01-15
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index 0661369..a0694c1 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -9812,11 +9812,33 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, bfd *obfd)
/* This is the first object. Copy the attributes. */
_bfd_elf_copy_obj_attributes (ibfd, obfd);
+ out_attr = elf_known_obj_attributes_proc (obfd);
+
/* Use the Tag_null value to indicate the attributes have been
initialized. */
- elf_known_obj_attributes_proc (obfd)[0].i = 1;
+ out_attr[0].i = 1;
- return TRUE;
+ /* We do not output objects with Tag_MPextension_use_legacy - we move
+ the attribute's value to Tag_MPextension_use. */
+ if (out_attr[Tag_MPextension_use_legacy].i != 0)
+ {
+ if (out_attr[Tag_MPextension_use].i != 0
+ && out_attr[Tag_MPextension_use_legacy].i
+ != out_attr[Tag_MPextension_use].i)
+ {
+ _bfd_error_handler
+ (_("Error: %B has both the current and legacy "
+ "Tag_MPextension_use attributes"), ibfd);
+ result = FALSE;
+ }
+
+ out_attr[Tag_MPextension_use] =
+ out_attr[Tag_MPextension_use_legacy];
+ out_attr[Tag_MPextension_use_legacy].type = 0;
+ out_attr[Tag_MPextension_use_legacy].i = 0;
+ }
+
+ return result;
}
in_attr = elf_known_obj_attributes_proc (ibfd);
@@ -10151,6 +10173,52 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, bfd *obfd)
out_attr[i].i = in_attr[i].i;
break;
+ case Tag_DIV_use:
+ /* This tag is set to zero if we can use UDIV and SDIV in Thumb
+ mode on a v7-M or v7-R CPU; to one if we can not use UDIV or
+ SDIV at all; and to two if we can use UDIV or SDIV on a v7-A
+ CPU. We will merge as follows: If the input attribute's value
+ is one then the output attribute's value remains unchanged. If
+ the input attribute's value is zero or two then if the output
+ attribute's value is one the output value is set to the input
+ value, otherwise the output value must be the same as the
+ inputs. */
+ if (in_attr[i].i != 1 && out_attr[i].i != 1)
+ {
+ if (in_attr[i].i != out_attr[i].i)
+ {
+ _bfd_error_handler
+ (_("DIV usage mismatch between %B and %B"),
+ ibfd, obfd);
+ result = FALSE;
+ }
+ }
+
+ if (in_attr[i].i != 1)
+ out_attr[i].i = in_attr[i].i;
+
+ break;
+
+ case Tag_MPextension_use_legacy:
+ /* We don't output objects with Tag_MPextension_use_legacy - we
+ move the value to Tag_MPextension_use. */
+ if (in_attr[i].i != 0 && in_attr[Tag_MPextension_use].i != 0)
+ {
+ if (in_attr[Tag_MPextension_use].i != in_attr[i].i)
+ {
+ _bfd_error_handler
+ (_("%B has has both the current and legacy "
+ "Tag_MPextension_use attributes"),
+ ibfd);
+ result = FALSE;
+ }
+ }
+
+ if (in_attr[i].i > out_attr[Tag_MPextension_use].i)
+ out_attr[Tag_MPextension_use] = in_attr[i];
+
+ break;
+
case Tag_nodefaults:
/* This tag is set if it exists, but the value is unused (and is
typically zero). We don't actually need to do anything here -