2009-08-23 H.J. Lu <hongjiu.lu@intel.com>
[deliverable/binutils-gdb.git] / bfd / coff-i386.c
index 47c041d3c0c1f88caa3ba18619adac510069c2d9..30c81885d4caa775a320eab567166b6421884905 100644 (file)
@@ -1,6 +1,6 @@
 /* BFD back-end for Intel 386 COFF files.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003, 2004, 2007
+   2000, 2001, 2002, 2003, 2004, 2007, 2008
    Free Software Foundation, Inc.
    Written by Cygnus Support.
 
 #include "coff/go32exe.h"
 #endif
 
+#ifndef bfd_pe_print_pdata
+#define bfd_pe_print_pdata     NULL
+#endif
+
 #include "libcoff.h"
 
 static bfd_reloc_status_type coff_i386_reloc
@@ -450,7 +454,7 @@ coff_i386_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
 {
   reloc_howto_type *howto;
 
-  if (rel->r_type > sizeof (howto_table) / sizeof (howto_table[0]))
+  if (rel->r_type >= sizeof (howto_table) / sizeof (howto_table[0]))
     {
       bfd_set_error (bfd_error_bad_value);
       return NULL;
@@ -518,7 +522,8 @@ coff_i386_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
       *addendp -= pe_data(sec->output_section->owner)->pe_opthdr.ImageBase;
     }
 
-  if (rel->r_type == R_SECREL32)
+  BFD_ASSERT (sym != NULL);
+  if (rel->r_type == R_SECREL32 && sym != NULL)
     {
       bfd_vma osect_vma;
 
This page took 0.024983 seconds and 4 git commands to generate.