1179404Sobrien/* MIPS ELF specific backend routines.
2218822Sdim   Copyright 2002, 2003, 2004, 2005, 2006
3218822Sdim   Free Software Foundation, Inc.
4179404Sobrien
5179404SobrienThis file is part of BFD, the Binary File Descriptor library.
6179404Sobrien
7179404SobrienThis program is free software; you can redistribute it and/or modify
8179404Sobrienit under the terms of the GNU General Public License as published by
9179404Sobrienthe Free Software Foundation; either version 2 of the License, or
10179404Sobrien(at your option) any later version.
11179404Sobrien
12179404SobrienThis program is distributed in the hope that it will be useful,
13179404Sobrienbut WITHOUT ANY WARRANTY; without even the implied warranty of
14179404SobrienMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15179404SobrienGNU General Public License for more details.
16179404Sobrien
17179404SobrienYou should have received a copy of the GNU General Public License
18179404Sobrienalong with this program; if not, write to the Free Software
19218822SdimFoundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
20179404Sobrien
21179404Sobrien#include "elf/common.h"
22179404Sobrien#include "elf/internal.h"
23179404Sobrien
24179404Sobrienextern bfd_boolean _bfd_mips_elf_new_section_hook
25179404Sobrien  (bfd *, asection *);
26179404Sobrienextern void _bfd_mips_elf_symbol_processing
27179404Sobrien  (bfd *, asymbol *);
28218822Sdimextern unsigned int _bfd_mips_elf_eh_frame_address_size
29218822Sdim  (bfd *, asection *);
30179404Sobrienextern bfd_boolean _bfd_mips_elf_name_local_section_symbols
31179404Sobrien  (bfd *);
32179404Sobrienextern bfd_boolean _bfd_mips_elf_section_processing
33179404Sobrien  (bfd *, Elf_Internal_Shdr *);
34179404Sobrienextern bfd_boolean _bfd_mips_elf_section_from_shdr
35218822Sdim  (bfd *, Elf_Internal_Shdr *, const char *, int);
36179404Sobrienextern bfd_boolean _bfd_mips_elf_fake_sections
37179404Sobrien  (bfd *, Elf_Internal_Shdr *, asection *);
38179404Sobrienextern bfd_boolean _bfd_mips_elf_section_from_bfd_section
39179404Sobrien  (bfd *, asection *, int *);
40179404Sobrienextern bfd_boolean _bfd_mips_elf_add_symbol_hook
41179404Sobrien  (bfd *, struct bfd_link_info *, Elf_Internal_Sym *,
42179404Sobrien   const char **, flagword *, asection **, bfd_vma *);
43179404Sobrienextern bfd_boolean _bfd_mips_elf_link_output_symbol_hook
44179404Sobrien  (struct bfd_link_info *, const char *, Elf_Internal_Sym *,
45179404Sobrien   asection *, struct elf_link_hash_entry *);
46179404Sobrienextern bfd_boolean _bfd_mips_elf_create_dynamic_sections
47179404Sobrien  (bfd *, struct bfd_link_info *);
48179404Sobrienextern bfd_boolean _bfd_mips_elf_check_relocs
49179404Sobrien  (bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *);
50179404Sobrienextern bfd_boolean _bfd_mips_elf_adjust_dynamic_symbol
51179404Sobrien  (struct bfd_link_info *, struct elf_link_hash_entry *);
52218822Sdimextern bfd_boolean _bfd_mips_vxworks_adjust_dynamic_symbol
53218822Sdim  (struct bfd_link_info *, struct elf_link_hash_entry *);
54179404Sobrienextern bfd_boolean _bfd_mips_elf_always_size_sections
55179404Sobrien  (bfd *, struct bfd_link_info *);
56179404Sobrienextern bfd_boolean _bfd_mips_elf_size_dynamic_sections
57179404Sobrien  (bfd *, struct bfd_link_info *);
58179404Sobrienextern bfd_boolean _bfd_mips_elf_relocate_section
59179404Sobrien  (bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
60179404Sobrien   Elf_Internal_Rela *, Elf_Internal_Sym *, asection **);
61179404Sobrienextern bfd_boolean _bfd_mips_elf_finish_dynamic_symbol
62179404Sobrien  (bfd *, struct bfd_link_info *, struct elf_link_hash_entry *,
63179404Sobrien   Elf_Internal_Sym *);
64218822Sdimextern bfd_boolean _bfd_mips_vxworks_finish_dynamic_symbol
65218822Sdim  (bfd *, struct bfd_link_info *, struct elf_link_hash_entry *,
66218822Sdim   Elf_Internal_Sym *);
67179404Sobrienextern bfd_boolean _bfd_mips_elf_finish_dynamic_sections
68179404Sobrien  (bfd *, struct bfd_link_info *);
69179404Sobrienextern void _bfd_mips_elf_final_write_processing
70179404Sobrien  (bfd *, bfd_boolean);
71179404Sobrienextern int _bfd_mips_elf_additional_program_headers
72218822Sdim  (bfd *, struct bfd_link_info *);
73179404Sobrienextern bfd_boolean _bfd_mips_elf_modify_segment_map
74179404Sobrien  (bfd *, struct bfd_link_info *);
75179404Sobrienextern asection * _bfd_mips_elf_gc_mark_hook
76179404Sobrien  (asection *, struct bfd_link_info *, Elf_Internal_Rela *,
77179404Sobrien   struct elf_link_hash_entry *, Elf_Internal_Sym *);
78179404Sobrienextern bfd_boolean _bfd_mips_elf_gc_sweep_hook
79179404Sobrien  (bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *);
80179404Sobrienextern void _bfd_mips_elf_copy_indirect_symbol
81218822Sdim  (struct bfd_link_info *, struct elf_link_hash_entry *,
82179404Sobrien   struct elf_link_hash_entry *);
83179404Sobrienextern void _bfd_mips_elf_hide_symbol
84179404Sobrien  (struct bfd_link_info *, struct elf_link_hash_entry *, bfd_boolean);
85179404Sobrienextern bfd_boolean _bfd_mips_elf_ignore_discarded_relocs
86179404Sobrien  (asection *);
87179404Sobrienextern bfd_boolean _bfd_mips_elf_find_nearest_line
88179404Sobrien  (bfd *, asection *, asymbol **, bfd_vma, const char **,
89179404Sobrien   const char **, unsigned int *);
90218822Sdimextern bfd_boolean _bfd_mips_elf_find_inliner_info
91218822Sdim  (bfd *, const char **, const char **, unsigned int *);
92179404Sobrienextern bfd_boolean _bfd_mips_elf_set_section_contents
93179404Sobrien  (bfd *, asection *, const void *, file_ptr, bfd_size_type);
94179404Sobrienextern bfd_byte *_bfd_elf_mips_get_relocated_section_contents
95179404Sobrien  (bfd *, struct bfd_link_info *, struct bfd_link_order *,
96179404Sobrien   bfd_byte *, bfd_boolean, asymbol **);
97179404Sobrienextern struct bfd_link_hash_table *_bfd_mips_elf_link_hash_table_create
98179404Sobrien  (bfd *);
99218822Sdimextern struct bfd_link_hash_table *_bfd_mips_vxworks_link_hash_table_create
100218822Sdim  (bfd *);
101179404Sobrienextern bfd_boolean _bfd_mips_elf_final_link
102179404Sobrien  (bfd *, struct bfd_link_info *);
103179404Sobrienextern bfd_boolean _bfd_mips_elf_merge_private_bfd_data
104179404Sobrien  (bfd *, bfd *);
105179404Sobrienextern bfd_boolean _bfd_mips_elf_set_private_flags
106179404Sobrien  (bfd *, flagword);
107179404Sobrienextern bfd_boolean _bfd_mips_elf_print_private_bfd_data
108179404Sobrien  (bfd *, void *);
109179404Sobrienextern bfd_boolean _bfd_mips_elf_discard_info
110179404Sobrien  (bfd *, struct elf_reloc_cookie *, struct bfd_link_info *);
111179404Sobrienextern bfd_boolean _bfd_mips_elf_write_section
112218822Sdim  (bfd *, struct bfd_link_info *, asection *, bfd_byte *);
113179404Sobrien
114179404Sobrienextern bfd_boolean _bfd_mips_elf_read_ecoff_info
115179404Sobrien  (bfd *, asection *, struct ecoff_debug_info *);
116218822Sdimextern void _bfd_mips16_elf_reloc_unshuffle
117218822Sdim  (bfd *, int, bfd_boolean, bfd_byte *);
118218822Sdimextern void _bfd_mips16_elf_reloc_shuffle
119218822Sdim  (bfd *, int, bfd_boolean, bfd_byte *);
120179404Sobrienextern bfd_reloc_status_type _bfd_mips_elf_gprel16_with_gp
121179404Sobrien  (bfd *, asymbol *, arelent *, asection *, bfd_boolean, void *, bfd_vma);
122179404Sobrienextern bfd_reloc_status_type _bfd_mips_elf32_gprel16_reloc
123179404Sobrien  (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
124179404Sobrienextern bfd_reloc_status_type _bfd_mips_elf_hi16_reloc
125179404Sobrien  (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
126179404Sobrienextern bfd_reloc_status_type _bfd_mips_elf_got16_reloc
127179404Sobrien  (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
128179404Sobrienextern bfd_reloc_status_type _bfd_mips_elf_lo16_reloc
129179404Sobrien  (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
130179404Sobrienextern bfd_reloc_status_type _bfd_mips_elf_generic_reloc
131179404Sobrien  (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
132179404Sobrienextern unsigned long _bfd_elf_mips_mach
133179404Sobrien  (flagword);
134179404Sobrienextern bfd_boolean _bfd_mips_relax_section
135179404Sobrien  (bfd *, asection *, struct bfd_link_info *, bfd_boolean *);
136179404Sobrienextern bfd_vma _bfd_mips_elf_sign_extend
137179404Sobrien  (bfd_vma, int);
138218822Sdimextern void _bfd_mips_elf_merge_symbol_attribute
139218822Sdim  (struct elf_link_hash_entry *, const Elf_Internal_Sym *, bfd_boolean, bfd_boolean);
140218822Sdimextern bfd_boolean _bfd_mips_elf_ignore_undef_symbol
141218822Sdim  (struct elf_link_hash_entry *);
142179404Sobrien
143218822Sdimextern const struct bfd_elf_special_section _bfd_mips_elf_special_sections [];
144218822Sdim
145218822Sdimextern bfd_boolean _bfd_mips_elf_common_definition (Elf_Internal_Sym *);
146218822Sdim
147218822Sdim#define elf_backend_common_definition   _bfd_mips_elf_common_definition
148179404Sobrien#define elf_backend_name_local_section_symbols \
149179404Sobrien  _bfd_mips_elf_name_local_section_symbols
150179404Sobrien#define elf_backend_special_sections _bfd_mips_elf_special_sections
151218822Sdim#define elf_backend_eh_frame_address_size _bfd_mips_elf_eh_frame_address_size
152218822Sdim#define elf_backend_merge_symbol_attribute  _bfd_mips_elf_merge_symbol_attribute
153218822Sdim#define elf_backend_ignore_undef_symbol _bfd_mips_elf_ignore_undef_symbol
154