Initialize count_ field, tweak parameters testing.
[deliverable/binutils-gdb.git] / bfd / coff-h8500.c
index 656bb48f37f240bf59e44ae8a64db48caa3a8ef6..186923a9d1ca30d6329e17bc54c4c942a155bb23 100644 (file)
@@ -1,6 +1,6 @@
 /* BFD back-end for Renesas H8/500 COFF binaries.
-   Copyright 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2002, 2003
-   Free Software Foundation, Inc.
+   Copyright 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2002, 2003, 2004,
+   2005, 2007 Free Software Foundation, Inc.
    Contributed by Cygnus Support.
    Written by Steve Chamberlain, <sac@cygnus.com>.
 
@@ -8,7 +8,7 @@
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+   MA 02110-1301, USA.  */
 
-#include "bfd.h"
 #include "sysdep.h"
+#include "bfd.h"
 #include "libbfd.h"
 #include "bfdlink.h"
 #include "coff/h8500.h"
@@ -245,16 +246,17 @@ extra_case (in_abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)
       {
        bfd_vma dst = bfd_coff_reloc16_get_value (reloc, link_info,
                                                  input_section);
-       bfd_vma dot = link_order->offset
-         + *dst_ptr
-           + link_order->u.indirect.section->output_section->vma;
+       bfd_vma dot = (*dst_ptr
+                      + input_section->output_offset
+                      + input_section->output_section->vma);
        int gap = dst - dot - 1; /* -1 since were in the odd byte of the
                                    word and the pc's been incremented.  */
 
        if (gap > 128 || gap < -128)
          {
            if (! ((*link_info->callbacks->reloc_overflow)
-                  (link_info, bfd_asymbol_name (*reloc->sym_ptr_ptr),
+                  (link_info, NULL,
+                   bfd_asymbol_name (*reloc->sym_ptr_ptr),
                    reloc->howto->name, reloc->addend, input_section->owner,
                    input_section, reloc->address)))
              abort ();
@@ -268,16 +270,17 @@ extra_case (in_abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)
       {
        bfd_vma dst = bfd_coff_reloc16_get_value (reloc, link_info,
                                                  input_section);
-       bfd_vma dot = link_order->offset
-         + *dst_ptr
-           + link_order->u.indirect.section->output_section->vma;
+       bfd_vma dot = (*dst_ptr
+                      + input_section->output_offset
+                      + input_section->output_section->vma);
        int gap = dst - dot - 1; /* -1 since were in the odd byte of the
                                    word and the pc's been incremented.  */
 
        if (gap > 32767 || gap < -32768)
          {
            if (! ((*link_info->callbacks->reloc_overflow)
-                  (link_info, bfd_asymbol_name (*reloc->sym_ptr_ptr),
+                  (link_info, NULL,
+                   bfd_asymbol_name (*reloc->sym_ptr_ptr),
                    reloc->howto->name, reloc->addend, input_section->owner,
                    input_section, reloc->address)))
              abort ();
@@ -303,4 +306,4 @@ extra_case (in_abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)
   bfd_coff_reloc16_get_relocated_section_contents
 #define coff_bfd_relax_section bfd_coff_reloc16_relax_section
 
-CREATE_BIG_COFF_TARGET_VEC (h8500coff_vec, "coff-h8500", 0, 0, '_', NULL)
+CREATE_BIG_COFF_TARGET_VEC (h8500coff_vec, "coff-h8500", 0, 0, '_', NULL, COFF_SWAP_TABLE)
This page took 0.041539 seconds and 4 git commands to generate.