* elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link.
[deliverable/binutils-gdb.git] / bfd / coff-sh.c
index fcfee718982d190695d0e5ce6d8104f97dbd65cd..05d99d4583bc849839e8fb6dd3df8ab10ce095c6 100644 (file)
@@ -1,6 +1,6 @@
 /* BFD back-end for Renesas Super-H COFF binaries.
    Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-   2003, 2004, 2005 Free Software Foundation, Inc.
+   2003, 2004, 2005, 2007, 2008, 2009  Free Software Foundation, Inc.
    Contributed by Cygnus Support.
    Written by Steve Chamberlain, <sac@cygnus.com>.
    Relaxing code written by Ian Lance Taylor, <ian@cygnus.com>.
@@ -9,7 +9,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., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
+   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+   MA 02110-1301, USA.  */
 
-#include "bfd.h"
 #include "sysdep.h"
+#include "bfd.h"
 #include "libiberty.h"
 #include "libbfd.h"
 #include "bfdlink.h"
 #include "coff/sh.h"
 #include "coff/internal.h"
 
+#undef  bfd_pe_print_pdata
+
 #ifdef COFF_WITH_PE
 #include "coff/pe.h"
 
@@ -40,7 +43,14 @@ static bfd_boolean sh_align_load_span
 
 #define _bfd_sh_align_load_span sh_align_load_span
 #endif
-#endif
+
+#define        bfd_pe_print_pdata   _bfd_pe_print_ce_compressed_pdata
+
+#else
+
+#define        bfd_pe_print_pdata   NULL
+
+#endif /* COFF_WITH_PE.  */
 
 #include "libcoff.h"
 
@@ -494,6 +504,7 @@ static const struct shcoff_reloc_map sh_reloc_map[] =
 /* Given a BFD reloc code, return the howto structure for the
    corresponding SH PE reloc.  */
 #define coff_bfd_reloc_type_lookup     sh_coff_reloc_type_lookup
+#define coff_bfd_reloc_name_lookup sh_coff_reloc_name_lookup
 
 static reloc_howto_type *
 sh_coff_reloc_type_lookup (abfd, code)
@@ -510,6 +521,20 @@ sh_coff_reloc_type_lookup (abfd, code)
   return NULL;
 }
 
+static reloc_howto_type *
+sh_coff_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+                          const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0; i < sizeof (sh_coff_howtos) / sizeof (sh_coff_howtos[0]); i++)
+    if (sh_coff_howtos[i].name != NULL
+       && strcasecmp (sh_coff_howtos[i].name, r_name) == 0)
+      return &sh_coff_howtos[i];
+
+  return NULL;
+}
+
 /* This macro is used in coffcode.h to get the howto corresponding to
    an internal reloc.  */
 
@@ -2510,8 +2535,9 @@ _bfd_sh_align_load_span (abfd, sec, contents, swap, relocs,
 
                  next2_insn = bfd_get_16 (abfd, contents + i + 4);
                  next2_op = sh_insn_info (next2_insn);
-                 if ((next2_op->flags & (LOAD | STORE)) == 0
-                     && sh_load_use (insn, op, next2_insn, next2_op))
+                 if (next2_op == NULL
+                     || ((next2_op->flags & (LOAD | STORE)) == 0
+                         && sh_load_use (insn, op, next2_insn, next2_op)))
                    ok = FALSE;
                }
 
@@ -3095,7 +3121,7 @@ coff_small_new_section_hook (abfd, section)
 /* This is copied from bfd_coff_std_swap_table so that we can change
    the default section alignment power.  */
 
-static const bfd_coff_backend_data bfd_coff_small_swap_table =
+static bfd_coff_backend_data bfd_coff_small_swap_table =
 {
   coff_swap_aux_in, coff_swap_sym_in, coff_swap_lineno_in,
   coff_swap_aux_out, coff_swap_sym_out,
@@ -3108,11 +3134,7 @@ static const bfd_coff_backend_data bfd_coff_small_swap_table =
 #else
   FALSE,
 #endif
-#ifdef COFF_LONG_SECTION_NAMES
-  TRUE,
-#else
-  FALSE,
-#endif
+  COFF_DEFAULT_LONG_SECTION_NAMES,
   2,
 #ifdef COFF_FORCE_SYMBOLS_IN_STRINGS
   TRUE,
@@ -3132,7 +3154,8 @@ static const bfd_coff_backend_data bfd_coff_small_swap_table =
   coff_classify_symbol, coff_compute_section_file_positions,
   coff_start_final_link, coff_relocate_section, coff_rtype_to_howto,
   coff_adjust_symndx, coff_link_add_one_symbol,
-  coff_link_output_has_begun, coff_final_link_postscript
+  coff_link_output_has_begun, coff_final_link_postscript,
+  bfd_pe_print_pdata
 };
 
 #define coff_small_close_and_cleanup \
This page took 0.037245 seconds and 4 git commands to generate.