2009-07-26 M R Swami Reddy <MR.Swami.Reddy@nsc.com>
authorM R Swami Reddy <MR.Swami.Reddy@nsc.com>
Mon, 27 Jul 2009 06:52:33 +0000 (06:52 +0000)
committerM R Swami Reddy <MR.Swami.Reddy@nsc.com>
Mon, 27 Jul 2009 06:52:33 +0000 (06:52 +0000)
      * elf32-cr16.c (elf_cr16_final_link_relocate): Add code to handle
       to R_cr16_NUM32 relocation.

bfd/ChangeLog
bfd/elf32-cr16.c

index 5c338e9..8a1c041 100644 (file)
@@ -1,3 +1,8 @@
+2009-07-27  M R Swami Reddy <MR.Swami.Reddy@nsc.com>
+
+      * elf32-cr16.c (elf_cr16_final_link_relocate): Add code to handle
+       to R_cr16_NUM32 relocation.
+
 2009-07-26  Michael Eager  <eager@eagercon.com>
 
        * archures.c: Add bfd_mach_ppc_405
index 795590c..085c671 100644 (file)
@@ -1259,6 +1259,21 @@ cr16_elf_final_link_relocate (reloc_howto_type *howto,
                             | (bfd_get_32 (input_bfd, hit_data) & 0xf0ff));
 
               }
+            else if (r_type == R_CR16_NUM32)
+              {
+                 Rvalue1 = (bfd_get_32 (input_bfd, hit_data)); 
+
+                 /* Add or subtract the offset value */
+                 if (Rvalue1 & 0x80000000)
+                   Rvalue -= (~Rvalue1 + 1) & 0xffffffff;
+                 else
+                   Rvalue += Rvalue1;
+
+                /* Check for Ranga */
+                if (Rvalue > 0xffffffff)
+                  return bfd_reloc_overflow;
+              }
+
             bfd_put_32 (input_bfd, Rvalue, hit_data);
           }
         break;