| 1 | /* BFD back-end for Hitachi Super-H COFF binaries.
|
|---|
| 2 | Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
|
|---|
| 3 | Free Software Foundation, Inc.
|
|---|
| 4 | Contributed by Cygnus Support.
|
|---|
| 5 | Written by Steve Chamberlain, <[email protected]>.
|
|---|
| 6 | Relaxing code written by Ian Lance Taylor, <[email protected]>.
|
|---|
| 7 |
|
|---|
| 8 | This file is part of BFD, the Binary File Descriptor library.
|
|---|
| 9 |
|
|---|
| 10 | This program is free software; you can redistribute it and/or modify
|
|---|
| 11 | it under the terms of the GNU General Public License as published by
|
|---|
| 12 | the Free Software Foundation; either version 2 of the License, or
|
|---|
| 13 | (at your option) any later version.
|
|---|
| 14 |
|
|---|
| 15 | This program is distributed in the hope that it will be useful,
|
|---|
| 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|---|
| 18 | GNU General Public License for more details.
|
|---|
| 19 |
|
|---|
| 20 | You should have received a copy of the GNU General Public License
|
|---|
| 21 | along with this program; if not, write to the Free Software
|
|---|
| 22 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|---|
| 23 |
|
|---|
| 24 | #include "bfd.h"
|
|---|
| 25 | #include "sysdep.h"
|
|---|
| 26 | #include "libbfd.h"
|
|---|
| 27 | #include "bfdlink.h"
|
|---|
| 28 | #include "coff/sh.h"
|
|---|
| 29 | #include "coff/internal.h"
|
|---|
| 30 |
|
|---|
| 31 | #ifdef COFF_WITH_PE
|
|---|
| 32 | #include "coff/pe.h"
|
|---|
| 33 |
|
|---|
| 34 | #ifndef COFF_IMAGE_WITH_PE
|
|---|
| 35 | static boolean sh_align_load_span
|
|---|
| 36 | PARAMS ((bfd *, asection *, bfd_byte *,
|
|---|
| 37 | boolean (*) (bfd *, asection *, PTR, bfd_byte *, bfd_vma),
|
|---|
| 38 | PTR, bfd_vma **, bfd_vma *, bfd_vma, bfd_vma, boolean *));
|
|---|
| 39 |
|
|---|
| 40 | #define _bfd_sh_align_load_span sh_align_load_span
|
|---|
| 41 | #endif
|
|---|
| 42 | #endif
|
|---|
| 43 |
|
|---|
| 44 | #include "libcoff.h"
|
|---|
| 45 |
|
|---|
| 46 | /* Internal functions. */
|
|---|
| 47 | static bfd_reloc_status_type sh_reloc
|
|---|
| 48 | PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
|
|---|
| 49 | static long get_symbol_value PARAMS ((asymbol *));
|
|---|
| 50 | static boolean sh_relax_section
|
|---|
| 51 | PARAMS ((bfd *, asection *, struct bfd_link_info *, boolean *));
|
|---|
| 52 | static boolean sh_relax_delete_bytes
|
|---|
| 53 | PARAMS ((bfd *, asection *, bfd_vma, int));
|
|---|
| 54 | #ifndef COFF_IMAGE_WITH_PE
|
|---|
| 55 | static const struct sh_opcode *sh_insn_info PARAMS ((unsigned int));
|
|---|
| 56 | #endif
|
|---|
| 57 | static boolean sh_align_loads
|
|---|
| 58 | PARAMS ((bfd *, asection *, struct internal_reloc *, bfd_byte *, boolean *));
|
|---|
| 59 | static boolean sh_swap_insns
|
|---|
| 60 | PARAMS ((bfd *, asection *, PTR, bfd_byte *, bfd_vma));
|
|---|
| 61 | static boolean sh_relocate_section
|
|---|
| 62 | PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
|
|---|
|
|---|