xref: /dflybsd-src/contrib/gdb-7/bfd/libecoff.h (revision 86d7f5d305c6adaa56ff4582ece9859d73106103)
1*86d7f5d3SJohn Marino /* BFD ECOFF object file private structure.
2*86d7f5d3SJohn Marino    Copyright 1993, 1994, 1995, 1996, 1999, 2001, 2002, 2003, 2004,
3*86d7f5d3SJohn Marino    2005, 2006, 2007, 2008, 2009, 2010
4*86d7f5d3SJohn Marino    Free Software Foundation, Inc.
5*86d7f5d3SJohn Marino    Written by Ian Lance Taylor, Cygnus Support.
6*86d7f5d3SJohn Marino 
7*86d7f5d3SJohn Marino    This file is part of BFD, the Binary File Descriptor library.
8*86d7f5d3SJohn Marino 
9*86d7f5d3SJohn Marino    This program is free software; you can redistribute it and/or modify
10*86d7f5d3SJohn Marino    it under the terms of the GNU General Public License as published by
11*86d7f5d3SJohn Marino    the Free Software Foundation; either version 3 of the License, or
12*86d7f5d3SJohn Marino    (at your option) any later version.
13*86d7f5d3SJohn Marino 
14*86d7f5d3SJohn Marino    This program is distributed in the hope that it will be useful,
15*86d7f5d3SJohn Marino    but WITHOUT ANY WARRANTY; without even the implied warranty of
16*86d7f5d3SJohn Marino    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17*86d7f5d3SJohn Marino    GNU General Public License for more details.
18*86d7f5d3SJohn Marino 
19*86d7f5d3SJohn Marino    You should have received a copy of the GNU General Public License
20*86d7f5d3SJohn Marino    along with this program; if not, write to the Free Software
21*86d7f5d3SJohn Marino    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
22*86d7f5d3SJohn Marino    MA 02110-1301, USA.  */
23*86d7f5d3SJohn Marino 
24*86d7f5d3SJohn Marino #include "bfdlink.h"
25*86d7f5d3SJohn Marino 
26*86d7f5d3SJohn Marino #ifndef ECOFF_H
27*86d7f5d3SJohn Marino #include "coff/ecoff.h"
28*86d7f5d3SJohn Marino #endif
29*86d7f5d3SJohn Marino 
30*86d7f5d3SJohn Marino /* This is the backend information kept for ECOFF files.  This
31*86d7f5d3SJohn Marino    structure is constant for a particular backend.  The first element
32*86d7f5d3SJohn Marino    is the COFF backend data structure, so that ECOFF targets can use
33*86d7f5d3SJohn Marino    the generic COFF code.  */
34*86d7f5d3SJohn Marino 
35*86d7f5d3SJohn Marino #define ecoff_backend(abfd) \
36*86d7f5d3SJohn Marino   ((struct ecoff_backend_data *) (abfd)->xvec->backend_data)
37*86d7f5d3SJohn Marino 
38*86d7f5d3SJohn Marino struct ecoff_backend_data
39*86d7f5d3SJohn Marino {
40*86d7f5d3SJohn Marino   /* COFF backend information.  This must be the first field.  */
41*86d7f5d3SJohn Marino   bfd_coff_backend_data coff;
42*86d7f5d3SJohn Marino   /* Supported architecture.  */
43*86d7f5d3SJohn Marino   enum bfd_architecture arch;
44*86d7f5d3SJohn Marino   /* Initial portion of armap string.  */
45*86d7f5d3SJohn Marino   const char *armap_start;
46*86d7f5d3SJohn Marino   /* The page boundary used to align sections in a demand-paged
47*86d7f5d3SJohn Marino      executable file.  E.g., 0x1000.  */
48*86d7f5d3SJohn Marino   bfd_vma round;
49*86d7f5d3SJohn Marino   /* TRUE if the .rdata section is part of the text segment, as on the
50*86d7f5d3SJohn Marino      Alpha.  FALSE if .rdata is part of the data segment, as on the
51*86d7f5d3SJohn Marino      MIPS.  */
52*86d7f5d3SJohn Marino   bfd_boolean rdata_in_text;
53*86d7f5d3SJohn Marino   /* Bitsize of constructor entries.  */
54*86d7f5d3SJohn Marino   unsigned int constructor_bitsize;
55*86d7f5d3SJohn Marino   /* Reloc to use for constructor entries.  */
56*86d7f5d3SJohn Marino   reloc_howto_type *constructor_reloc;
57*86d7f5d3SJohn Marino   /* How to swap debugging information.  */
58*86d7f5d3SJohn Marino   struct ecoff_debug_swap debug_swap;
59*86d7f5d3SJohn Marino   /* External reloc size.  */
60*86d7f5d3SJohn Marino   bfd_size_type external_reloc_size;
61*86d7f5d3SJohn Marino   /* Reloc swapping functions.  */
62*86d7f5d3SJohn Marino   void (*swap_reloc_in) (bfd *, void *, struct internal_reloc *);
63*86d7f5d3SJohn Marino   void (*swap_reloc_out) (bfd *, const struct internal_reloc *, void *);
64*86d7f5d3SJohn Marino   /* Backend reloc tweaking.  */
65*86d7f5d3SJohn Marino   void (*adjust_reloc_in)
66*86d7f5d3SJohn Marino     (bfd *, const struct internal_reloc *, arelent *);
67*86d7f5d3SJohn Marino   void (*adjust_reloc_out)
68*86d7f5d3SJohn Marino     (bfd *, const arelent *, struct internal_reloc *);
69*86d7f5d3SJohn Marino   /* Relocate section contents while linking.  */
70*86d7f5d3SJohn Marino   bfd_boolean (*relocate_section)
71*86d7f5d3SJohn Marino     (bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, void *);
72*86d7f5d3SJohn Marino   /* Do final adjustments to filehdr and aouthdr.  */
73*86d7f5d3SJohn Marino   bfd_boolean (*adjust_headers)
74*86d7f5d3SJohn Marino     (bfd *, struct internal_filehdr *, struct internal_aouthdr *);
75*86d7f5d3SJohn Marino   /* Read an element from an archive at a given file position.  This
76*86d7f5d3SJohn Marino      is needed because OSF/1 3.2 uses a weird archive format.  */
77*86d7f5d3SJohn Marino   bfd *(*get_elt_at_filepos) (bfd *, file_ptr);
78*86d7f5d3SJohn Marino };
79*86d7f5d3SJohn Marino 
80*86d7f5d3SJohn Marino /* ECOFF targets don't support COFF long section names, so this
81*86d7f5d3SJohn Marino   macro is provided to use as an initialiser for the related
82*86d7f5d3SJohn Marino   members of the embedded bfd_coff_backend_data struct.  */
83*86d7f5d3SJohn Marino #define ECOFF_NO_LONG_SECTION_NAMES (FALSE), _bfd_ecoff_no_long_sections
84*86d7f5d3SJohn Marino 
85*86d7f5d3SJohn Marino /* This is the target specific information kept for ECOFF files.  */
86*86d7f5d3SJohn Marino 
87*86d7f5d3SJohn Marino #define ecoff_data(abfd) ((abfd)->tdata.ecoff_obj_data)
88*86d7f5d3SJohn Marino 
89*86d7f5d3SJohn Marino typedef struct ecoff_tdata
90*86d7f5d3SJohn Marino {
91*86d7f5d3SJohn Marino   /* The reloc file position, set by
92*86d7f5d3SJohn Marino      ecoff_compute_section_file_positions.  */
93*86d7f5d3SJohn Marino   file_ptr reloc_filepos;
94*86d7f5d3SJohn Marino 
95*86d7f5d3SJohn Marino   /* The symbol table file position, set by _bfd_ecoff_mkobject_hook.  */
96*86d7f5d3SJohn Marino   file_ptr sym_filepos;
97*86d7f5d3SJohn Marino 
98*86d7f5d3SJohn Marino   /* The start and end of the text segment.  Only valid for an
99*86d7f5d3SJohn Marino      existing file, not for one we are creating.  */
100*86d7f5d3SJohn Marino   unsigned long text_start;
101*86d7f5d3SJohn Marino   unsigned long text_end;
102*86d7f5d3SJohn Marino 
103*86d7f5d3SJohn Marino   /* The cached gp value.  This is used when relocating.  */
104*86d7f5d3SJohn Marino   bfd_vma gp;
105*86d7f5d3SJohn Marino 
106*86d7f5d3SJohn Marino   /* The maximum size of objects to optimize using gp.  This is
107*86d7f5d3SJohn Marino      typically set by the -G option to the compiler, assembler or
108*86d7f5d3SJohn Marino      linker.  */
109*86d7f5d3SJohn Marino   unsigned int gp_size;
110*86d7f5d3SJohn Marino 
111*86d7f5d3SJohn Marino   /* The register masks.  When linking, all the masks found in the
112*86d7f5d3SJohn Marino      input files are combined into the masks of the output file.
113*86d7f5d3SJohn Marino      These are not all used for all targets, but that's OK, because
114*86d7f5d3SJohn Marino      the relevant ones are the only ones swapped in and out.  */
115*86d7f5d3SJohn Marino   unsigned long gprmask;
116*86d7f5d3SJohn Marino   unsigned long fprmask;
117*86d7f5d3SJohn Marino   unsigned long cprmask[4];
118*86d7f5d3SJohn Marino 
119*86d7f5d3SJohn Marino   /* The ECOFF symbolic debugging information.  */
120*86d7f5d3SJohn Marino   struct ecoff_debug_info debug_info;
121*86d7f5d3SJohn Marino 
122*86d7f5d3SJohn Marino   /* The unswapped ECOFF symbolic information.  */
123*86d7f5d3SJohn Marino   void * raw_syments;
124*86d7f5d3SJohn Marino 
125*86d7f5d3SJohn Marino   /* The canonical BFD symbols.  */
126*86d7f5d3SJohn Marino   struct ecoff_symbol_struct *canonical_symbols;
127*86d7f5d3SJohn Marino 
128*86d7f5d3SJohn Marino   /* A mapping from external symbol numbers to entries in the linker
129*86d7f5d3SJohn Marino      hash table, used when linking.  */
130*86d7f5d3SJohn Marino   struct ecoff_link_hash_entry **sym_hashes;
131*86d7f5d3SJohn Marino 
132*86d7f5d3SJohn Marino   /* A mapping from reloc symbol indices to sections, used when
133*86d7f5d3SJohn Marino      linking.  */
134*86d7f5d3SJohn Marino   asection **symndx_to_section;
135*86d7f5d3SJohn Marino 
136*86d7f5d3SJohn Marino   /* TRUE if this BFD was written by the backend linker.  */
137*86d7f5d3SJohn Marino   bfd_boolean linker;
138*86d7f5d3SJohn Marino 
139*86d7f5d3SJohn Marino   /* TRUE if a warning that multiple global pointer values are
140*86d7f5d3SJohn Marino      needed in the output binary was issued already.  */
141*86d7f5d3SJohn Marino   bfd_boolean issued_multiple_gp_warning;
142*86d7f5d3SJohn Marino 
143*86d7f5d3SJohn Marino   /* Used by find_nearest_line entry point.  The structure could be
144*86d7f5d3SJohn Marino      included directly in this one, but there's no point to wasting
145*86d7f5d3SJohn Marino      the memory just for the infrequently called find_nearest_line.  */
146*86d7f5d3SJohn Marino   struct ecoff_find_line *find_line_info;
147*86d7f5d3SJohn Marino 
148*86d7f5d3SJohn Marino   /* Whether the .rdata section is in the text segment for this
149*86d7f5d3SJohn Marino      particular ECOFF file.  This is not valid until
150*86d7f5d3SJohn Marino      ecoff_compute_section_file_positions is called.  */
151*86d7f5d3SJohn Marino   bfd_boolean rdata_in_text;
152*86d7f5d3SJohn Marino 
153*86d7f5d3SJohn Marino } ecoff_data_type;
154*86d7f5d3SJohn Marino 
155*86d7f5d3SJohn Marino /* Each canonical asymbol really looks like this.  */
156*86d7f5d3SJohn Marino 
157*86d7f5d3SJohn Marino typedef struct ecoff_symbol_struct
158*86d7f5d3SJohn Marino {
159*86d7f5d3SJohn Marino   /* The actual symbol which the rest of BFD works with */
160*86d7f5d3SJohn Marino   asymbol symbol;
161*86d7f5d3SJohn Marino 
162*86d7f5d3SJohn Marino   /* The fdr for this symbol.  */
163*86d7f5d3SJohn Marino   FDR *fdr;
164*86d7f5d3SJohn Marino 
165*86d7f5d3SJohn Marino   /* TRUE if this is a local symbol rather than an external one.  */
166*86d7f5d3SJohn Marino   bfd_boolean local;
167*86d7f5d3SJohn Marino 
168*86d7f5d3SJohn Marino   /* A pointer to the unswapped hidden information for this symbol.
169*86d7f5d3SJohn Marino      This is either a struct sym_ext or a struct ext_ext, depending on
170*86d7f5d3SJohn Marino      the value of the local field above.  */
171*86d7f5d3SJohn Marino   void * native;
172*86d7f5d3SJohn Marino } ecoff_symbol_type;
173*86d7f5d3SJohn Marino 
174*86d7f5d3SJohn Marino /* We take the address of the first element of an asymbol to ensure that the
175*86d7f5d3SJohn Marino    macro is only ever applied to an asymbol.  */
176*86d7f5d3SJohn Marino #define ecoffsymbol(asymbol) ((ecoff_symbol_type *) (&((asymbol)->the_bfd)))
177*86d7f5d3SJohn Marino 
178*86d7f5d3SJohn Marino /* We need to save the index of an external symbol when we write it
179*86d7f5d3SJohn Marino    out so that can set the symbol index correctly when we write out
180*86d7f5d3SJohn Marino    the relocs.  */
181*86d7f5d3SJohn Marino #define ecoff_get_sym_index(symbol) ((symbol)->udata.i)
182*86d7f5d3SJohn Marino #define ecoff_set_sym_index(symbol, idx) ((symbol)->udata.i = (idx))
183*86d7f5d3SJohn Marino 
184*86d7f5d3SJohn Marino /* A pointer to this structure is put in the used_by_bfd pointer of
185*86d7f5d3SJohn Marino    a section to keep track of any per-section data.
186*86d7f5d3SJohn Marino    The user_by_bfd pointer will be NULL if the information was not
187*86d7f5d3SJohn Marino    needed.  */
188*86d7f5d3SJohn Marino 
189*86d7f5d3SJohn Marino struct ecoff_section_tdata
190*86d7f5d3SJohn Marino {
191*86d7f5d3SJohn Marino   /* When producing an executable (i.e., final, non-relocatable link)
192*86d7f5d3SJohn Marino      on the Alpha, we may need to use multiple global pointer values
193*86d7f5d3SJohn Marino      to span the entire .lita section.  In essence, we allow each
194*86d7f5d3SJohn Marino      input .lita section to have its own gp value.  To support this,
195*86d7f5d3SJohn Marino      we need to keep track of the gp values that we picked for each
196*86d7f5d3SJohn Marino      input .lita section . */
197*86d7f5d3SJohn Marino   bfd_vma gp;
198*86d7f5d3SJohn Marino };
199*86d7f5d3SJohn Marino 
200*86d7f5d3SJohn Marino /* An accessor macro for the ecoff_section_tdata structure.  */
201*86d7f5d3SJohn Marino #define ecoff_section_data(abfd, sec) \
202*86d7f5d3SJohn Marino   ((struct ecoff_section_tdata *) (sec)->used_by_bfd)
203*86d7f5d3SJohn Marino 
204*86d7f5d3SJohn Marino /* ECOFF linker hash table entries.  */
205*86d7f5d3SJohn Marino 
206*86d7f5d3SJohn Marino struct ecoff_link_hash_entry
207*86d7f5d3SJohn Marino {
208*86d7f5d3SJohn Marino   struct bfd_link_hash_entry root;
209*86d7f5d3SJohn Marino   /* Symbol index in output file.  */
210*86d7f5d3SJohn Marino   long indx;
211*86d7f5d3SJohn Marino   /* BFD that ext field value came from.  */
212*86d7f5d3SJohn Marino   bfd *abfd;
213*86d7f5d3SJohn Marino   /* ECOFF external symbol information.  */
214*86d7f5d3SJohn Marino   EXTR esym;
215*86d7f5d3SJohn Marino   /* Nonzero if this symbol has been written out.  */
216*86d7f5d3SJohn Marino   char written;
217*86d7f5d3SJohn Marino   /* Nonzero if this symbol was referred to as small undefined.  */
218*86d7f5d3SJohn Marino   char small;
219*86d7f5d3SJohn Marino };
220*86d7f5d3SJohn Marino 
221*86d7f5d3SJohn Marino /* ECOFF linker hash table.  */
222*86d7f5d3SJohn Marino 
223*86d7f5d3SJohn Marino struct ecoff_link_hash_table
224*86d7f5d3SJohn Marino {
225*86d7f5d3SJohn Marino   struct bfd_link_hash_table root;
226*86d7f5d3SJohn Marino };
227*86d7f5d3SJohn Marino 
228*86d7f5d3SJohn Marino /* Make an ECOFF object.  */
229*86d7f5d3SJohn Marino extern bfd_boolean _bfd_ecoff_mkobject (bfd *);
230*86d7f5d3SJohn Marino 
231*86d7f5d3SJohn Marino /* Read in the ECOFF symbolic debugging information.  */
232*86d7f5d3SJohn Marino extern bfd_boolean _bfd_ecoff_slurp_symbolic_info
233*86d7f5d3SJohn Marino   (bfd *, asection *, struct ecoff_debug_info *);
234*86d7f5d3SJohn Marino 
235*86d7f5d3SJohn Marino /* Generic ECOFF BFD backend vectors.  */
236*86d7f5d3SJohn Marino 
237*86d7f5d3SJohn Marino extern bfd_boolean _bfd_ecoff_write_object_contents (bfd *);
238*86d7f5d3SJohn Marino 
239*86d7f5d3SJohn Marino #define	_bfd_ecoff_close_and_cleanup _bfd_generic_close_and_cleanup
240*86d7f5d3SJohn Marino #define _bfd_ecoff_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
241*86d7f5d3SJohn Marino extern bfd_boolean _bfd_ecoff_new_section_hook
242*86d7f5d3SJohn Marino   (bfd *, asection *);
243*86d7f5d3SJohn Marino extern bfd_boolean _bfd_ecoff_get_section_contents
244*86d7f5d3SJohn Marino   (bfd *, asection *, void * location, file_ptr, bfd_size_type);
245*86d7f5d3SJohn Marino 
246*86d7f5d3SJohn Marino #define _bfd_ecoff_bfd_link_split_section _bfd_generic_link_split_section
247*86d7f5d3SJohn Marino 
248*86d7f5d3SJohn Marino extern bfd_boolean _bfd_ecoff_bfd_copy_private_bfd_data
249*86d7f5d3SJohn Marino   (bfd *, bfd *);
250*86d7f5d3SJohn Marino #define _bfd_ecoff_bfd_copy_private_section_data \
251*86d7f5d3SJohn Marino   _bfd_generic_bfd_copy_private_section_data
252*86d7f5d3SJohn Marino 
253*86d7f5d3SJohn Marino #define _bfd_ecoff_bfd_copy_private_symbol_data \
254*86d7f5d3SJohn Marino   _bfd_generic_bfd_copy_private_symbol_data
255*86d7f5d3SJohn Marino 
256*86d7f5d3SJohn Marino #define _bfd_ecoff_bfd_copy_private_header_data \
257*86d7f5d3SJohn Marino   _bfd_generic_bfd_copy_private_header_data
258*86d7f5d3SJohn Marino 
259*86d7f5d3SJohn Marino #define _bfd_ecoff_bfd_print_private_bfd_data \
260*86d7f5d3SJohn Marino   _bfd_generic_bfd_print_private_bfd_data
261*86d7f5d3SJohn Marino 
262*86d7f5d3SJohn Marino #define _bfd_ecoff_bfd_merge_private_bfd_data \
263*86d7f5d3SJohn Marino   _bfd_generic_bfd_merge_private_bfd_data
264*86d7f5d3SJohn Marino 
265*86d7f5d3SJohn Marino #define _bfd_ecoff_bfd_set_private_flags _bfd_generic_bfd_set_private_flags
266*86d7f5d3SJohn Marino extern bfd_boolean _bfd_ecoff_slurp_armap (bfd *);
267*86d7f5d3SJohn Marino #define _bfd_ecoff_slurp_extended_name_table _bfd_slurp_extended_name_table
268*86d7f5d3SJohn Marino #define _bfd_ecoff_construct_extended_name_table \
269*86d7f5d3SJohn Marino   _bfd_archive_bsd_construct_extended_name_table
270*86d7f5d3SJohn Marino #define _bfd_ecoff_truncate_arname bfd_dont_truncate_arname
271*86d7f5d3SJohn Marino extern bfd_boolean _bfd_ecoff_write_armap
272*86d7f5d3SJohn Marino   (bfd *, unsigned int, struct orl *, unsigned int, int);
273*86d7f5d3SJohn Marino #define _bfd_ecoff_read_ar_hdr _bfd_generic_read_ar_hdr
274*86d7f5d3SJohn Marino #define _bfd_ecoff_write_ar_hdr _bfd_generic_write_ar_hdr
275*86d7f5d3SJohn Marino #define _bfd_ecoff_openr_next_archived_file \
276*86d7f5d3SJohn Marino   bfd_generic_openr_next_archived_file
277*86d7f5d3SJohn Marino #define _bfd_ecoff_get_elt_at_index _bfd_generic_get_elt_at_index
278*86d7f5d3SJohn Marino #define _bfd_ecoff_generic_stat_arch_elt bfd_generic_stat_arch_elt
279*86d7f5d3SJohn Marino #define _bfd_ecoff_update_armap_timestamp bfd_true
280*86d7f5d3SJohn Marino #define _bfd_ecoff_bfd_is_target_special_symbol  \
281*86d7f5d3SJohn Marino   ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
282*86d7f5d3SJohn Marino 
283*86d7f5d3SJohn Marino extern long _bfd_ecoff_get_symtab_upper_bound (bfd *);
284*86d7f5d3SJohn Marino extern long _bfd_ecoff_canonicalize_symtab (bfd *, asymbol **);
285*86d7f5d3SJohn Marino extern asymbol *_bfd_ecoff_make_empty_symbol (bfd *);
286*86d7f5d3SJohn Marino extern void _bfd_ecoff_print_symbol
287*86d7f5d3SJohn Marino   (bfd *, void *, asymbol *, bfd_print_symbol_type);
288*86d7f5d3SJohn Marino extern void _bfd_ecoff_get_symbol_info
289*86d7f5d3SJohn Marino   (bfd *, asymbol *, symbol_info *);
290*86d7f5d3SJohn Marino extern bfd_boolean _bfd_ecoff_bfd_is_local_label_name
291*86d7f5d3SJohn Marino   (bfd *, const char *);
292*86d7f5d3SJohn Marino #define _bfd_ecoff_get_lineno _bfd_nosymbols_get_lineno
293*86d7f5d3SJohn Marino extern bfd_boolean _bfd_ecoff_find_nearest_line
294*86d7f5d3SJohn Marino   (bfd *, asection *, asymbol **, bfd_vma, const char **, const char **,
295*86d7f5d3SJohn Marino    unsigned int *);
296*86d7f5d3SJohn Marino #define _bfd_ecoff_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
297*86d7f5d3SJohn Marino #define _bfd_ecoff_read_minisymbols _bfd_generic_read_minisymbols
298*86d7f5d3SJohn Marino #define _bfd_ecoff_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
299*86d7f5d3SJohn Marino #define _bfd_ecoff_find_inliner_info _bfd_nosymbols_find_inliner_info
300*86d7f5d3SJohn Marino 
301*86d7f5d3SJohn Marino #define _bfd_ecoff_get_reloc_upper_bound coff_get_reloc_upper_bound
302*86d7f5d3SJohn Marino extern long _bfd_ecoff_canonicalize_reloc
303*86d7f5d3SJohn Marino   (bfd *, asection *, arelent **, asymbol **symbols);
304*86d7f5d3SJohn Marino /* ecoff_bfd_reloc_type_lookup defined by backend. */
305*86d7f5d3SJohn Marino 
306*86d7f5d3SJohn Marino extern bfd_boolean _bfd_ecoff_set_arch_mach
307*86d7f5d3SJohn Marino   (bfd *, enum bfd_architecture, unsigned long);
308*86d7f5d3SJohn Marino extern bfd_boolean _bfd_ecoff_set_section_contents
309*86d7f5d3SJohn Marino   (bfd *, asection *, const void * location, file_ptr, bfd_size_type);
310*86d7f5d3SJohn Marino 
311*86d7f5d3SJohn Marino extern int _bfd_ecoff_sizeof_headers (bfd *, struct bfd_link_info *);
312*86d7f5d3SJohn Marino /* ecoff_bfd_get_relocated_section_contents defined by backend.  */
313*86d7f5d3SJohn Marino /* ecoff_bfd_relax_section defined by backend.  */
314*86d7f5d3SJohn Marino extern struct bfd_link_hash_table *_bfd_ecoff_bfd_link_hash_table_create
315*86d7f5d3SJohn Marino   (bfd *);
316*86d7f5d3SJohn Marino #define _bfd_ecoff_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
317*86d7f5d3SJohn Marino extern bfd_boolean _bfd_ecoff_bfd_link_add_symbols
318*86d7f5d3SJohn Marino   (bfd *, struct bfd_link_info *);
319*86d7f5d3SJohn Marino #define _bfd_ecoff_bfd_link_just_syms _bfd_generic_link_just_syms
320*86d7f5d3SJohn Marino #define _bfd_ecoff_bfd_copy_link_hash_symbol_type \
321*86d7f5d3SJohn Marino   _bfd_generic_copy_link_hash_symbol_type
322*86d7f5d3SJohn Marino extern bfd_boolean _bfd_ecoff_bfd_final_link
323*86d7f5d3SJohn Marino   (bfd *, struct bfd_link_info *);
324*86d7f5d3SJohn Marino 
325*86d7f5d3SJohn Marino /* Hook functions for the generic COFF section reading code.  */
326*86d7f5d3SJohn Marino 
327*86d7f5d3SJohn Marino extern void * _bfd_ecoff_mkobject_hook (bfd *, void *, void *);
328*86d7f5d3SJohn Marino #define _bfd_ecoff_set_alignment_hook \
329*86d7f5d3SJohn Marino   ((void (*) (bfd *, asection *, void *)) bfd_void)
330*86d7f5d3SJohn Marino extern bfd_boolean _bfd_ecoff_set_arch_mach_hook
331*86d7f5d3SJohn Marino   (bfd *, void *);
332*86d7f5d3SJohn Marino extern bfd_boolean _bfd_ecoff_no_long_sections
333*86d7f5d3SJohn Marino   (bfd *abfd, int enable);
334*86d7f5d3SJohn Marino extern bfd_boolean _bfd_ecoff_styp_to_sec_flags
335*86d7f5d3SJohn Marino   (bfd *, void *, const char *, asection *, flagword *);
336*86d7f5d3SJohn Marino extern bfd_boolean _bfd_ecoff_slurp_symbol_table (bfd *);
337*86d7f5d3SJohn Marino 
338*86d7f5d3SJohn Marino /* ECOFF auxiliary information swapping routines.  These are the same
339*86d7f5d3SJohn Marino    for all ECOFF targets, so they are defined in ecofflink.c.  */
340*86d7f5d3SJohn Marino 
341*86d7f5d3SJohn Marino extern void _bfd_ecoff_swap_tir_in
342*86d7f5d3SJohn Marino   (int, const struct tir_ext *, TIR *);
343*86d7f5d3SJohn Marino extern void _bfd_ecoff_swap_tir_out
344*86d7f5d3SJohn Marino   (int, const TIR *, struct tir_ext *);
345*86d7f5d3SJohn Marino extern void _bfd_ecoff_swap_rndx_in
346*86d7f5d3SJohn Marino   (int, const struct rndx_ext *, RNDXR *);
347*86d7f5d3SJohn Marino extern void _bfd_ecoff_swap_rndx_out
348*86d7f5d3SJohn Marino   (int, const RNDXR *, struct rndx_ext *);
349