Fix compile time warnings (at -O3 with gcc 4.1.2)
authorNick Clifton <nickc@redhat.com>
Tue, 24 Apr 2007 13:05:46 +0000 (13:05 +0000)
committerNick Clifton <nickc@redhat.com>
Tue, 24 Apr 2007 13:05:46 +0000 (13:05 +0000)
bfd/ChangeLog
bfd/coff-m68k.c
bfd/coffcode.h

index 9fc72caca4fd67b7c434b5e9a60a2323090975d5..9cfa98dd41a5112d5df25a8f040adff33a585db8 100644 (file)
@@ -1,3 +1,8 @@
+2007-04-24  Nick Clifton  <nickc@redhat.com>
+
+       * coffcode.h (coff_slurp_reloc_table): Initialise dst.r_offset.
+       * coff-m68k.c (m68kcoff_rtype_to_howto): Initialize relent.howto.
+
 2007-04-24  Alan Modra  <amodra@bigpond.net.au>
 
        * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Warn if
index ae524e47e6a92a487743f580637b4ad2ba5a1321..3d162a0f068fba59b8806f27ab717af98d2bc007 100644 (file)
@@ -251,11 +251,12 @@ m68kcoff_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
   arelent relent;
   reloc_howto_type *howto;
 
+  relent.howto = NULL;
   RTYPE2HOWTO (&relent, rel);
 
   howto = relent.howto;
 
-  if (howto->pc_relative)
+  if (howto != NULL && howto->pc_relative)
     *addendp += sec->vma;
 
   return howto;
index 98d1c0886bf4aa02e2ff09ecd56e5de1c15e71be..a2aac5f63b4ccff42f4768a43d5ae82eb878d2ec 100644 (file)
@@ -4870,6 +4870,7 @@ coff_slurp_reloc_table (bfd * abfd, sec_ptr asect, asymbol ** symbols)
       cache_ptr = reloc_cache + idx;
       src = native_relocs + idx;
 
+      dst.r_offset = 0;
       coff_swap_reloc_in (abfd, src, &dst);
 
 #ifdef RELOC_PROCESSING