]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
2006-10-28 Paul Brook <paul@codesourcery.com>
authorPaul Brook <paul@codesourcery.com>
Sun, 29 Oct 2006 00:03:03 +0000 (00:03 +0000)
committerPaul Brook <paul@codesourcery.com>
Sun, 29 Oct 2006 00:03:03 +0000 (00:03 +0000)
Julian Brown  <julian@codesourcery.com>

bfd/
* elf32-arm.c (copy_eabi_attributes): Correct starting offset.
(elf32_arm_merge_eabi_attributes): Mark output as initialized.
Only set Tag_CPU_name and Tag_ABI_PCS_R9_use if input attribute
is present.

ChangeLog.csl
bfd/elf32-arm.c

index e4ce5dce367b1ad535ad3680dda9f8761025e35e..dbe5cc8d22064d5a28c17f19794b90e9a189b208 100644 (file)
@@ -1,3 +1,12 @@
+2006-10-28  Paul Brook  <paul@codesourcery.com>
+       Julian Brown  <julian@codesourcery.com>
+
+       bfd/
+       * elf32-arm.c (copy_eabi_attributes): Correct starting offset.
+       (elf32_arm_merge_eabi_attributes): Mark output as initialized.
+       Only set Tag_CPU_name and Tag_ABI_PCS_R9_use if input attribute
+       is present.
+
 2006-10-28  Kazu Hirata  <kazu@codesourcery.com>
 
        include/opcode/
index 9859b65dc4a9a65f7b3da6f6e20f54bb5cb3d2f8..fa9867ec8ea40c9bcafa360c2c1925b70d2a5986 100644 (file)
@@ -5997,8 +5997,8 @@ copy_eabi_attributes (bfd *ibfd, bfd *obfd)
   aeabi_attribute_list *list;
   int i;
 
-  in_attr = elf32_arm_tdata (ibfd)->known_eabi_attributes;
-  out_attr = elf32_arm_tdata (obfd)->known_eabi_attributes;
+  in_attr = &elf32_arm_tdata (ibfd)->known_eabi_attributes[4];
+  out_attr = &elf32_arm_tdata (obfd)->known_eabi_attributes[4];
   for (i = 4; i < NUM_KNOWN_ATTRIBUTES; i++)
     {
       out_attr->i = in_attr->i;
@@ -6129,17 +6129,18 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, bfd *obfd)
   static const int order_312[3] = {3, 1, 2};
   int i;
 
-  if (!elf32_arm_tdata (ibfd)->known_eabi_attributes[0].i)
+  if (!elf32_arm_tdata (obfd)->known_eabi_attributes[0].i)
     {
       /* This is the first object.  Copy the attributes.  */
       copy_eabi_attributes (ibfd, obfd);
+
+      /* Use the Tag_null value to indicate the attributes have been
+        initialized.  */
+      elf32_arm_tdata (obfd)->known_eabi_attributes[0].i = 1;
+
       return TRUE;
     }
 
-  /* Use the Tag_null value to indicate the attributes have been
-     initialized.  */
-  elf32_arm_tdata (ibfd)->known_eabi_attributes[0].i = 1;
-
   in_attr = elf32_arm_tdata (ibfd)->known_eabi_attributes;
   out_attr = elf32_arm_tdata (obfd)->known_eabi_attributes;
   /* This needs to happen before Tag_ABI_FP_number_model is merged.  */
@@ -6164,8 +6165,11 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, bfd *obfd)
        {
        case Tag_CPU_raw_name:
        case Tag_CPU_name:
-         /* Use whichever has the greatest architecture requirements.  */
-         if (in_attr[Tag_CPU_arch].i > out_attr[Tag_CPU_arch].i)
+         /* Use whichever has the greatest architecture requirements.  We
+            won't necessarily have both the above tags, so make sure input
+            name is non-NULL.  */
+         if (in_attr[Tag_CPU_arch].i > out_attr[Tag_CPU_arch].i
+             && in_attr[i].s)
            out_attr[i].s = attr_strdup(obfd, in_attr[i].s);
          break;
 
@@ -6217,7 +6221,8 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, bfd *obfd)
            }
          break;
        case Tag_ABI_PCS_R9_use:
-         if (out_attr[i].i != AEABI_R9_unused
+         if (in_attr[i].i != out_attr[i].i
+             && out_attr[i].i != AEABI_R9_unused
              && in_attr[i].i != AEABI_R9_unused)
            {
              _bfd_error_handler