source: trunk/src/binutils/bfd/coff-sh.c@ 10

Last change on this file since 10 was 10, checked in by bird, 23 years ago

Initial revision

  • Property cvs2svn:cvs-rev set to 1.1
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 98.3 KB
Line 
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
8This file is part of BFD, the Binary File Descriptor library.
9
10This program is free software; you can redistribute it and/or modify
11it under the terms of the GNU General Public License as published by
12the Free Software Foundation; either version 2 of the License, or
13(at your option) any later version.
14
15This program is distributed in the hope that it will be useful,
16but WITHOUT ANY WARRANTY; without even the implied warranty of
17MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18GNU General Public License for more details.
19
20You should have received a copy of the GNU General Public License
21along with this program; if not, write to the Free Software
22Foundation, 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
35static 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. */
47static bfd_reloc_status_type sh_reloc
48 PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
49static long get_symbol_value PARAMS ((asymbol *));
50static boolean sh_relax_section
51 PARAMS ((bfd *, asection *, struct bfd_link_info *, boolean *));
52static boolean sh_relax_delete_bytes
53 PARAMS ((bfd *, asection *, bfd_vma, int));
54#ifndef COFF_IMAGE_WITH_PE
55static const struct sh_opcode *sh_insn_info PARAMS ((unsigned int));
56#endif
57static boolean sh_align_loads
58 PARAMS ((bfd *, asection *, struct internal_reloc *, bfd_byte *, boolean *));
59static boolean sh_swap_insns
60 PARAMS ((bfd *, asection *, PTR, bfd_byte *, bfd_vma));
61static boolean sh_relocate_section
62 PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,