]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - bfd/coff-m68k.c
Touches most files in bfd/, so likely will be blamed for everything..
[thirdparty/binutils-gdb.git] / bfd / coff-m68k.c
index abab63292557e789c418dbc8f39f17419a67a60c..397d98378d77315a67349f8efccaf68abb68485d 100644 (file)
@@ -316,7 +316,7 @@ m68kcoff_common_addend_special_fn (abfd, reloc_entry, symbol, data,
          {
            short x = bfd_get_16 (abfd, addr);
            DOIT (x);
-           bfd_put_16 (abfd, x, addr);
+           bfd_put_16 (abfd, (bfd_vma) x, addr);
          }
          break;
 
@@ -324,7 +324,7 @@ m68kcoff_common_addend_special_fn (abfd, reloc_entry, symbol, data,
          {
            long x = bfd_get_32 (abfd, addr);
            DOIT (x);
-           bfd_put_32 (abfd, x, addr);
+           bfd_put_32 (abfd, (bfd_vma) x, addr);
          }
          break;
 
@@ -442,6 +442,7 @@ bfd_m68k_coff_create_embedded_relocs (abfd, info, datasec, relsec, errmsg)
   bfd_size_type symesz;
   struct internal_reloc *irel, *irelend;
   bfd_byte *p;
+  bfd_size_type amt;
 
   BFD_ASSERT (! info->relocateable);
 
@@ -457,7 +458,8 @@ bfd_m68k_coff_create_embedded_relocs (abfd, info, datasec, relsec, errmsg)
                                         NULL);
   irelend = irel + datasec->reloc_count;
 
-  relsec->contents = (bfd_byte *) bfd_alloc (abfd, datasec->reloc_count * 12);
+  amt = (bfd_size_type) datasec->reloc_count * 12;
+  relsec->contents = (bfd_byte *) bfd_alloc (abfd, amt);
   if (relsec->contents == NULL)
     return false;