* bucomm.c (list_supported_targets): Use bfd_target_list.
[deliverable/binutils-gdb.git] / bfd / coff-z8k.c
index c626cd75257d97e9d1e917cc61254a5e4b4ba334..c1d6a88fbbb5edda26531613c54712006c911a46 100644 (file)
@@ -185,10 +185,25 @@ extra_case (in_abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)
       break;
 
     case R_IMM32:
-      bfd_put_32 (in_abfd,
-                 /* 0x80000000 indicates a long segmented address.  */
-                 bfd_coff_reloc16_get_value (reloc, link_info, input_section) | 0x80000000,
-                 data + *dst_ptr);
+      /* If no flags are set, assume immediate value.  */
+      if (! (*reloc->sym_ptr_ptr)->section->flags)
+       {
+         bfd_put_32 (in_abfd,
+                     bfd_coff_reloc16_get_value (reloc, link_info,
+                                                 input_section),
+                     data + *dst_ptr);
+       }
+      else
+       {
+         bfd_vma dst = bfd_coff_reloc16_get_value (reloc, link_info,
+                                                   input_section);
+         /* Adresses are 23 bit, and the layout of those in a 32-bit
+            value is as follows:
+              1AAAAAAA xxxxxxxx AAAAAAAA AAAAAAAA
+            (A - address bits,  x - ignore).  */
+         dst = (dst & 0xffff) | ((dst & 0xff0000) << 8) | 0x80000000;
+         bfd_put_32 (in_abfd, dst, data + *dst_ptr);
+       }
       (*dst_ptr) += 4;
       (*src_ptr) += 4;
       break;
This page took 0.027927 seconds and 4 git commands to generate.