189857Sobrien/* DO NOT EDIT!  -*- buffer-read-only: t -*-  This file is automatically
289857Sobrien   generated from "libcoff-in.h" and "coffcode.h".
389857Sobrien   Run "make headers" in your build bfd/ to regenerate.  */
489857Sobrien
533965Sjdp/* BFD COFF object file private structure.
678828Sobrien   Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
7218822Sdim   2000, 2001, 2002, 2003, 2004, 2005, 2006
833965Sjdp   Free Software Foundation, Inc.
933965Sjdp   Written by Cygnus Support.
1033965Sjdp
11218822Sdim   This file is part of BFD, the Binary File Descriptor library.
1233965Sjdp
13218822Sdim   This program is free software; you can redistribute it and/or modify
14218822Sdim   it under the terms of the GNU General Public License as published by
15218822Sdim   the Free Software Foundation; either version 2 of the License, or
16218822Sdim   (at your option) any later version.
1733965Sjdp
18218822Sdim   This program is distributed in the hope that it will be useful,
19218822Sdim   but WITHOUT ANY WARRANTY; without even the implied warranty of
20218822Sdim   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21218822Sdim   GNU General Public License for more details.
2233965Sjdp
23218822Sdim   You should have received a copy of the GNU General Public License
24218822Sdim   along with this program; if not, write to the Free Software
25218822Sdim   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
2633965Sjdp
2733965Sjdp#include "bfdlink.h"
2833965Sjdp
29218822Sdim/* Object file tdata; access macros.  */
3033965Sjdp
31218822Sdim#define coff_data(bfd)		      ((bfd)->tdata.coff_obj_data)
32218822Sdim#define exec_hdr(bfd)		      (coff_data (bfd)->hdr)
33218822Sdim#define obj_pe(bfd)                   (coff_data (bfd)->pe)
34218822Sdim#define obj_symbols(bfd)	      (coff_data (bfd)->symbols)
35218822Sdim#define	obj_sym_filepos(bfd)	      (coff_data (bfd)->sym_filepos)
36218822Sdim#define obj_relocbase(bfd)	      (coff_data (bfd)->relocbase)
37218822Sdim#define obj_raw_syments(bfd)	      (coff_data (bfd)->raw_syments)
38218822Sdim#define obj_raw_syment_count(bfd)     (coff_data (bfd)->raw_syment_count)
39218822Sdim#define obj_convert(bfd)	      (coff_data (bfd)->conversion_table)
40218822Sdim#define obj_conv_table_size(bfd)      (coff_data (bfd)->conv_table_size)
41218822Sdim#define obj_coff_external_syms(bfd)   (coff_data (bfd)->external_syms)
42218822Sdim#define obj_coff_keep_syms(bfd)	      (coff_data (bfd)->keep_syms)
43218822Sdim#define obj_coff_strings(bfd)	      (coff_data (bfd)->strings)
44218822Sdim#define obj_coff_keep_strings(bfd)    (coff_data (bfd)->keep_strings)
45218822Sdim#define obj_coff_sym_hashes(bfd)      (coff_data (bfd)->sym_hashes)
4677298Sobrien#define obj_coff_strings_written(bfd) (coff_data (bfd)->strings_written)
47218822Sdim#define obj_coff_local_toc_table(bfd) (coff_data (bfd)->local_toc_sym_map)
4833965Sjdp
4933965Sjdp/* `Tdata' information kept for COFF files.  */
5033965Sjdp
5133965Sjdptypedef struct coff_tdata
5233965Sjdp{
53218822Sdim  struct coff_symbol_struct *symbols;	/* Symtab for input bfd.  */
5433965Sjdp  unsigned int *conversion_table;
5533965Sjdp  int conv_table_size;
5633965Sjdp  file_ptr sym_filepos;
5733965Sjdp
5833965Sjdp  struct coff_ptr_struct *raw_syments;
5960484Sobrien  unsigned long raw_syment_count;
6033965Sjdp
61218822Sdim  /* These are only valid once writing has begun.  */
6233965Sjdp  long int relocbase;
6333965Sjdp
6433965Sjdp  /* These members communicate important constants about the symbol table
6533965Sjdp     to GDB's symbol-reading code.  These `constants' unfortunately vary
6633965Sjdp     from coff implementation to implementation...  */
6733965Sjdp  unsigned local_n_btmask;
6833965Sjdp  unsigned local_n_btshft;
6933965Sjdp  unsigned local_n_tmask;
7033965Sjdp  unsigned local_n_tshift;
7133965Sjdp  unsigned local_symesz;
7233965Sjdp  unsigned local_auxesz;
7333965Sjdp  unsigned local_linesz;
7433965Sjdp
7533965Sjdp  /* The unswapped external symbols.  May be NULL.  Read by
7633965Sjdp     _bfd_coff_get_external_symbols.  */
77218822Sdim  void * external_syms;
78130561Sobrien  /* If this is TRUE, the external_syms may not be freed.  */
79130561Sobrien  bfd_boolean keep_syms;
8033965Sjdp
8133965Sjdp  /* The string table.  May be NULL.  Read by
8233965Sjdp     _bfd_coff_read_string_table.  */
8333965Sjdp  char *strings;
84130561Sobrien  /* If this is TRUE, the strings may not be freed.  */
85130561Sobrien  bfd_boolean keep_strings;
86130561Sobrien  /* If this is TRUE, the strings have been written out already.  */
87130561Sobrien  bfd_boolean strings_written;
8833965Sjdp
89218822Sdim  /* Is this a PE format coff file?  */
9033965Sjdp  int pe;
9133965Sjdp  /* Used by the COFF backend linker.  */
9233965Sjdp  struct coff_link_hash_entry **sym_hashes;
9333965Sjdp
94218822Sdim  /* Used by the pe linker for PowerPC.  */
9533965Sjdp  int *local_toc_sym_map;
9633965Sjdp
9733965Sjdp  struct bfd_link_info *link_info;
9833965Sjdp
9933965Sjdp  /* Used by coff_find_nearest_line.  */
100218822Sdim  void * line_info;
10138889Sjdp
102218822Sdim  /* A place to stash dwarf2 info for this bfd.  */
103218822Sdim  void * dwarf2_find_line_info;
10477298Sobrien
10560484Sobrien  /* The timestamp from the COFF file header.  */
10660484Sobrien  long timestamp;
10760484Sobrien
10838889Sjdp  /* Copy of some of the f_flags bits in the COFF filehdr structure,
10938889Sjdp     used by ARM code.  */
11038889Sjdp  flagword flags;
11138889Sjdp
11233965Sjdp} coff_data_type;
11333965Sjdp
114218822Sdim/* Tdata for pe image files.  */
11533965Sjdptypedef struct pe_tdata
11633965Sjdp{
11733965Sjdp  coff_data_type coff;
11833965Sjdp  struct internal_extra_pe_aouthdr pe_opthdr;
11933965Sjdp  int dll;
12033965Sjdp  int has_reloc_section;
121218822Sdim  bfd_boolean (*in_reloc_p) (bfd *, reloc_howto_type *);
12233965Sjdp  flagword real_flags;
12378828Sobrien  int target_subsystem;
124130561Sobrien  bfd_boolean force_minimum_alignment;
12533965Sjdp} pe_data_type;
12633965Sjdp
12733965Sjdp#define pe_data(bfd)		((bfd)->tdata.pe_obj_data)
12833965Sjdp
12933965Sjdp/* Tdata for XCOFF files.  */
13033965Sjdp
13133965Sjdpstruct xcoff_tdata
13233965Sjdp{
13333965Sjdp  /* Basic COFF information.  */
13433965Sjdp  coff_data_type coff;
13533965Sjdp
136130561Sobrien  /* TRUE if this is an XCOFF64 file. */
137130561Sobrien  bfd_boolean xcoff64;
13877298Sobrien
139130561Sobrien  /* TRUE if a large a.out header should be generated.  */
140130561Sobrien  bfd_boolean full_aouthdr;
14133965Sjdp
14233965Sjdp  /* TOC value.  */
14333965Sjdp  bfd_vma toc;
14433965Sjdp
14533965Sjdp  /* Index of section holding TOC.  */
14633965Sjdp  int sntoc;
14733965Sjdp
14833965Sjdp  /* Index of section holding entry point.  */
14933965Sjdp  int snentry;
15033965Sjdp
15133965Sjdp  /* .text alignment from optional header.  */
15233965Sjdp  int text_align_power;
15333965Sjdp
15433965Sjdp  /* .data alignment from optional header.  */
15533965Sjdp  int data_align_power;
15633965Sjdp
15733965Sjdp  /* modtype from optional header.  */
15833965Sjdp  short modtype;
15933965Sjdp
16033965Sjdp  /* cputype from optional header.  */
16133965Sjdp  short cputype;
16233965Sjdp
16333965Sjdp  /* maxdata from optional header.  */
16478828Sobrien  bfd_vma maxdata;
16533965Sjdp
16633965Sjdp  /* maxstack from optional header.  */
16778828Sobrien  bfd_vma maxstack;
16833965Sjdp
16933965Sjdp  /* Used by the XCOFF backend linker.  */
17033965Sjdp  asection **csects;
17133965Sjdp  unsigned long *debug_indices;
17233965Sjdp  unsigned int import_file_id;
17333965Sjdp};
17433965Sjdp
17533965Sjdp#define xcoff_data(abfd) ((abfd)->tdata.xcoff_obj_data)
17633965Sjdp
17789857Sobrien/* We take the address of the first element of an asymbol to ensure that the
178218822Sdim   macro is only ever applied to an asymbol.  */
17933965Sjdp#define coffsymbol(asymbol) ((coff_symbol_type *)(&((asymbol)->the_bfd)))
18033965Sjdp
18133965Sjdp/* The used_by_bfd field of a section may be set to a pointer to this
18233965Sjdp   structure.  */
18333965Sjdp
18433965Sjdpstruct coff_section_tdata
18533965Sjdp{
18633965Sjdp  /* The relocs, swapped into COFF internal form.  This may be NULL.  */
18733965Sjdp  struct internal_reloc *relocs;
188130561Sobrien  /* If this is TRUE, the relocs entry may not be freed.  */
189130561Sobrien  bfd_boolean keep_relocs;
19033965Sjdp  /* The section contents.  This may be NULL.  */
19133965Sjdp  bfd_byte *contents;
192130561Sobrien  /* If this is TRUE, the contents entry may not be freed.  */
193130561Sobrien  bfd_boolean keep_contents;
19433965Sjdp  /* Information cached by coff_find_nearest_line.  */
19533965Sjdp  bfd_vma offset;
19633965Sjdp  unsigned int i;
19733965Sjdp  const char *function;
198218822Sdim  /* Optional information about a COMDAT entry; NULL if not COMDAT. */
199218822Sdim  struct coff_comdat_info *comdat;
20033965Sjdp  int line_base;
20133965Sjdp  /* A pointer used for .stab linking optimizations.  */
202218822Sdim  void * stab_info;
20333965Sjdp  /* Available for individual backends.  */
204218822Sdim  void * tdata;
20533965Sjdp};
20633965Sjdp
20733965Sjdp/* An accessor macro for the coff_section_tdata structure.  */
20833965Sjdp#define coff_section_data(abfd, sec) \
20933965Sjdp  ((struct coff_section_tdata *) (sec)->used_by_bfd)
21033965Sjdp
21133965Sjdp/* Tdata for sections in XCOFF files.  This is used by the linker.  */
21233965Sjdp
21333965Sjdpstruct xcoff_section_tdata
21433965Sjdp{
21533965Sjdp  /* Used for XCOFF csects created by the linker; points to the real
21633965Sjdp     XCOFF section which contains this csect.  */
21733965Sjdp  asection *enclosing;
21833965Sjdp  /* The lineno_count field for the enclosing section, because we are
21933965Sjdp     going to clobber it there.  */
22033965Sjdp  unsigned int lineno_count;
22133965Sjdp  /* The first and one past the last symbol indices for symbols used
22233965Sjdp     by this csect.  */
22333965Sjdp  unsigned long first_symndx;
22433965Sjdp  unsigned long last_symndx;
22533965Sjdp};
22633965Sjdp
22733965Sjdp/* An accessor macro the xcoff_section_tdata structure.  */
22833965Sjdp#define xcoff_section_data(abfd, sec) \
22933965Sjdp  ((struct xcoff_section_tdata *) coff_section_data ((abfd), (sec))->tdata)
23033965Sjdp
23160484Sobrien/* Tdata for sections in PE files.  */
23233965Sjdp
23333965Sjdpstruct pei_section_tdata
23433965Sjdp{
23533965Sjdp  /* The virtual size of the section.  */
23633965Sjdp  bfd_size_type virt_size;
23760484Sobrien  /* The PE section flags.  */
23860484Sobrien  long pe_flags;
23933965Sjdp};
24033965Sjdp
24133965Sjdp/* An accessor macro for the pei_section_tdata structure.  */
24233965Sjdp#define pei_section_data(abfd, sec) \
24333965Sjdp  ((struct pei_section_tdata *) coff_section_data ((abfd), (sec))->tdata)
24433965Sjdp
24533965Sjdp/* COFF linker hash table entries.  */
24633965Sjdp
24733965Sjdpstruct coff_link_hash_entry
24833965Sjdp{
24933965Sjdp  struct bfd_link_hash_entry root;
25033965Sjdp
25133965Sjdp  /* Symbol index in output file.  Set to -1 initially.  Set to -2 if
25233965Sjdp     there is a reloc against this symbol.  */
25333965Sjdp  long indx;
25433965Sjdp
25533965Sjdp  /* Symbol type.  */
25633965Sjdp  unsigned short type;
25733965Sjdp
25833965Sjdp  /* Symbol class.  */
25933965Sjdp  unsigned char class;
26033965Sjdp
26133965Sjdp  /* Number of auxiliary entries.  */
26233965Sjdp  char numaux;
26333965Sjdp
26433965Sjdp  /* BFD to take auxiliary entries from.  */
26533965Sjdp  bfd *auxbfd;
26633965Sjdp
26733965Sjdp  /* Pointer to array of auxiliary entries, if any.  */
26833965Sjdp  union internal_auxent *aux;
26960484Sobrien
27060484Sobrien  /* Flag word; legal values follow.  */
27160484Sobrien  unsigned short coff_link_hash_flags;
27260484Sobrien  /* Symbol is a PE section symbol.  */
27360484Sobrien#define COFF_LINK_HASH_PE_SECTION_SYMBOL (01)
27433965Sjdp};
27533965Sjdp
27633965Sjdp/* COFF linker hash table.  */
27733965Sjdp
27833965Sjdpstruct coff_link_hash_table
27933965Sjdp{
28033965Sjdp  struct bfd_link_hash_table root;
28133965Sjdp  /* A pointer to information used to link stabs in sections.  */
282218822Sdim  struct stab_info stab_info;
28333965Sjdp};
28433965Sjdp
28533965Sjdp/* Look up an entry in a COFF linker hash table.  */
28633965Sjdp
28733965Sjdp#define coff_link_hash_lookup(table, string, create, copy, follow)	\
28833965Sjdp  ((struct coff_link_hash_entry *)					\
28933965Sjdp   bfd_link_hash_lookup (&(table)->root, (string), (create),		\
29033965Sjdp			 (copy), (follow)))
29133965Sjdp
29233965Sjdp/* Traverse a COFF linker hash table.  */
29333965Sjdp
29433965Sjdp#define coff_link_hash_traverse(table, func, info)			\
29533965Sjdp  (bfd_link_hash_traverse						\
29633965Sjdp   (&(table)->root,							\
297218822Sdim    (bfd_boolean (*) (struct bfd_link_hash_entry *, void *)) (func), \
29833965Sjdp    (info)))
29933965Sjdp
30033965Sjdp/* Get the COFF linker hash table from a link_info structure.  */
30133965Sjdp
30233965Sjdp#define coff_hash_table(p) ((struct coff_link_hash_table *) ((p)->hash))
30333965Sjdp
30433965Sjdp/* Functions in coffgen.c.  */
30589857Sobrienextern const bfd_target *coff_object_p
306218822Sdim  (bfd *);
307130561Sobrienextern struct bfd_section *coff_section_from_bfd_index
308218822Sdim  (bfd *, int);
30989857Sobrienextern long coff_get_symtab_upper_bound
310218822Sdim  (bfd *);
311130561Sobrienextern long coff_canonicalize_symtab
312218822Sdim  (bfd *, asymbol **);
31389857Sobrienextern int coff_count_linenumbers
314218822Sdim  (bfd *);
31589857Sobrienextern struct coff_symbol_struct *coff_symbol_from
316218822Sdim  (bfd *, asymbol *);
317130561Sobrienextern bfd_boolean coff_renumber_symbols
318218822Sdim  (bfd *, int *);
31989857Sobrienextern void coff_mangle_symbols
320218822Sdim  (bfd *);
321130561Sobrienextern bfd_boolean coff_write_symbols
322218822Sdim  (bfd *);
323130561Sobrienextern bfd_boolean coff_write_linenumbers
324218822Sdim  (bfd *);
32589857Sobrienextern alent *coff_get_lineno
326218822Sdim  (bfd *, asymbol *);
32789857Sobrienextern asymbol *coff_section_symbol
328218822Sdim  (bfd *, char *);
329130561Sobrienextern bfd_boolean _bfd_coff_get_external_symbols
330218822Sdim  (bfd *);
33189857Sobrienextern const char *_bfd_coff_read_string_table
332218822Sdim  (bfd *);
333130561Sobrienextern bfd_boolean _bfd_coff_free_symbols
334218822Sdim  (bfd *);
33589857Sobrienextern struct coff_ptr_struct *coff_get_normalized_symtab
336218822Sdim  (bfd *);
33789857Sobrienextern long coff_get_reloc_upper_bound
338218822Sdim  (bfd *, sec_ptr);
33989857Sobrienextern asymbol *coff_make_empty_symbol
340218822Sdim  (bfd *);
34189857Sobrienextern void coff_print_symbol
342218822Sdim  (bfd *, void * filep, asymbol *, bfd_print_symbol_type);
34389857Sobrienextern void coff_get_symbol_info
344218822Sdim  (bfd *, asymbol *, symbol_info *ret);
345130561Sobrienextern bfd_boolean _bfd_coff_is_local_label_name
346218822Sdim  (bfd *, const char *);
34789857Sobrienextern asymbol *coff_bfd_make_debug_symbol
348218822Sdim  (bfd *, void *, unsigned long);
349130561Sobrienextern bfd_boolean coff_find_nearest_line
350218822Sdim  (bfd *, asection *, asymbol **, bfd_vma, const char **,
351218822Sdim   const char **, unsigned int *);
352218822Sdimextern bfd_boolean coff_find_inliner_info
353218822Sdim  (bfd *, const char **, const char **, unsigned int *);
35489857Sobrienextern int coff_sizeof_headers
355218822Sdim  (bfd *, struct bfd_link_info *);
356130561Sobrienextern bfd_boolean bfd_coff_reloc16_relax_section
357218822Sdim  (bfd *, asection *, struct bfd_link_info *, bfd_boolean *);
35833965Sjdpextern bfd_byte *bfd_coff_reloc16_get_relocated_section_contents
359218822Sdim  (bfd *, struct bfd_link_info *, struct bfd_link_order *,
360218822Sdim   bfd_byte *, bfd_boolean, asymbol **);
36189857Sobrienextern bfd_vma bfd_coff_reloc16_get_value
362218822Sdim  (arelent *, struct bfd_link_info *, asection *);
36389857Sobrienextern void bfd_perform_slip
364218822Sdim  (bfd *, unsigned int, asection *, bfd_vma);
36533965Sjdp
36633965Sjdp/* Functions and types in cofflink.c.  */
36733965Sjdp
368218822Sdim#define STRING_SIZE_SIZE 4
36933965Sjdp
37033965Sjdp/* We use a hash table to merge identical enum, struct, and union
37133965Sjdp   definitions in the linker.  */
37233965Sjdp
37333965Sjdp/* Information we keep for a single element (an enum value, a
37433965Sjdp   structure or union field) in the debug merge hash table.  */
37533965Sjdp
37633965Sjdpstruct coff_debug_merge_element
37733965Sjdp{
37833965Sjdp  /* Next element.  */
37933965Sjdp  struct coff_debug_merge_element *next;
38033965Sjdp
38133965Sjdp  /* Name.  */
38233965Sjdp  const char *name;
38333965Sjdp
38433965Sjdp  /* Type.  */
38533965Sjdp  unsigned int type;
38633965Sjdp
38733965Sjdp  /* Symbol index for complex type.  */
38833965Sjdp  long tagndx;
38933965Sjdp};
39033965Sjdp
39133965Sjdp/* A linked list of debug merge entries for a given name.  */
39233965Sjdp
39333965Sjdpstruct coff_debug_merge_type
39433965Sjdp{
39533965Sjdp  /* Next type with the same name.  */
39633965Sjdp  struct coff_debug_merge_type *next;
39733965Sjdp
39833965Sjdp  /* Class of type.  */
39933965Sjdp  int class;
40033965Sjdp
40133965Sjdp  /* Symbol index where this type is defined.  */
40233965Sjdp  long indx;
40333965Sjdp
40433965Sjdp  /* List of elements.  */
40533965Sjdp  struct coff_debug_merge_element *elements;
40633965Sjdp};
40733965Sjdp
40833965Sjdp/* Information we store in the debug merge hash table.  */
40933965Sjdp
41033965Sjdpstruct coff_debug_merge_hash_entry
41133965Sjdp{
41233965Sjdp  struct bfd_hash_entry root;
41333965Sjdp
41433965Sjdp  /* A list of types with this name.  */
41533965Sjdp  struct coff_debug_merge_type *types;
41633965Sjdp};
41733965Sjdp
41833965Sjdp/* The debug merge hash table.  */
41933965Sjdp
42033965Sjdpstruct coff_debug_merge_hash_table
42133965Sjdp{
42233965Sjdp  struct bfd_hash_table root;
42333965Sjdp};
42433965Sjdp
42533965Sjdp/* Initialize a COFF debug merge hash table.  */
42633965Sjdp
42733965Sjdp#define coff_debug_merge_hash_table_init(table) \
428218822Sdim  (bfd_hash_table_init (&(table)->root, _bfd_coff_debug_merge_hash_newfunc, \
429218822Sdim			sizeof (struct coff_debug_merge_hash_entry)))
43033965Sjdp
43133965Sjdp/* Free a COFF debug merge hash table.  */
43233965Sjdp
43333965Sjdp#define coff_debug_merge_hash_table_free(table) \
43433965Sjdp  (bfd_hash_table_free (&(table)->root))
43533965Sjdp
43633965Sjdp/* Look up an entry in a COFF debug merge hash table.  */
43733965Sjdp
43833965Sjdp#define coff_debug_merge_hash_lookup(table, string, create, copy) \
43933965Sjdp  ((struct coff_debug_merge_hash_entry *) \
44033965Sjdp   bfd_hash_lookup (&(table)->root, (string), (create), (copy)))
44133965Sjdp
44233965Sjdp/* Information we keep for each section in the output file when doing
443130561Sobrien   a relocatable link.  */
44433965Sjdp
44533965Sjdpstruct coff_link_section_info
44633965Sjdp{
44733965Sjdp  /* The relocs to be output.  */
44833965Sjdp  struct internal_reloc *relocs;
44933965Sjdp  /* For each reloc against a global symbol whose index was not known
45033965Sjdp     when the reloc was handled, the global hash table entry.  */
45133965Sjdp  struct coff_link_hash_entry **rel_hashes;
45233965Sjdp};
45333965Sjdp
45433965Sjdp/* Information that we pass around while doing the final link step.  */
45533965Sjdp
45633965Sjdpstruct coff_final_link_info
45733965Sjdp{
45833965Sjdp  /* General link information.  */
45933965Sjdp  struct bfd_link_info *info;
46033965Sjdp  /* Output BFD.  */
46133965Sjdp  bfd *output_bfd;
46233965Sjdp  /* Used to indicate failure in traversal routine.  */
463130561Sobrien  bfd_boolean failed;
46438889Sjdp  /* If doing "task linking" set only during the time when we want the
46538889Sjdp     global symbol writer to convert the storage class of defined global
46638889Sjdp     symbols from global to static. */
467130561Sobrien  bfd_boolean global_to_static;
46833965Sjdp  /* Hash table for long symbol names.  */
46933965Sjdp  struct bfd_strtab_hash *strtab;
470130561Sobrien  /* When doing a relocatable link, an array of information kept for
47133965Sjdp     each output section, indexed by the target_index field.  */
47233965Sjdp  struct coff_link_section_info *section_info;
47333965Sjdp  /* Symbol index of last C_FILE symbol (-1 if none).  */
47433965Sjdp  long last_file_index;
47533965Sjdp  /* Contents of last C_FILE symbol.  */
47633965Sjdp  struct internal_syment last_file;
47733965Sjdp  /* Symbol index of first aux entry of last .bf symbol with an empty
47833965Sjdp     endndx field (-1 if none).  */
47933965Sjdp  long last_bf_index;
48033965Sjdp  /* Contents of last_bf_index aux entry.  */
48133965Sjdp  union internal_auxent last_bf;
48233965Sjdp  /* Hash table used to merge debug information.  */
48333965Sjdp  struct coff_debug_merge_hash_table debug_merge;
48433965Sjdp  /* Buffer large enough to hold swapped symbols of any input file.  */
48533965Sjdp  struct internal_syment *internal_syms;
48633965Sjdp  /* Buffer large enough to hold sections of symbols of any input file.  */
48733965Sjdp  asection **sec_ptrs;
48833965Sjdp  /* Buffer large enough to hold output indices of symbols of any
48933965Sjdp     input file.  */
49033965Sjdp  long *sym_indices;
49133965Sjdp  /* Buffer large enough to hold output symbols for any input file.  */
49233965Sjdp  bfd_byte *outsyms;
49333965Sjdp  /* Buffer large enough to hold external line numbers for any input
49433965Sjdp     section.  */
49533965Sjdp  bfd_byte *linenos;
49633965Sjdp  /* Buffer large enough to hold any input section.  */
49733965Sjdp  bfd_byte *contents;
49833965Sjdp  /* Buffer large enough to hold external relocs of any input section.  */
49933965Sjdp  bfd_byte *external_relocs;
50033965Sjdp  /* Buffer large enough to hold swapped relocs of any input section.  */
50133965Sjdp  struct internal_reloc *internal_relocs;
50233965Sjdp};
50333965Sjdp
50460484Sobrien/* Most COFF variants have no way to record the alignment of a
50560484Sobrien   section.  This struct is used to set a specific alignment based on
50660484Sobrien   the name of the section.  */
50760484Sobrien
50860484Sobrienstruct coff_section_alignment_entry
50960484Sobrien{
51060484Sobrien  /* The section name.  */
51160484Sobrien  const char *name;
51260484Sobrien
51360484Sobrien  /* This is either (unsigned int) -1, indicating that the section
51460484Sobrien     name must match exactly, or it is the number of letters which
51560484Sobrien     must match at the start of the name.  */
51660484Sobrien  unsigned int comparison_length;
51760484Sobrien
51860484Sobrien  /* These macros may be used to fill in the first two fields in a
51960484Sobrien     structure initialization.  */
52060484Sobrien#define COFF_SECTION_NAME_EXACT_MATCH(name) (name), ((unsigned int) -1)
52160484Sobrien#define COFF_SECTION_NAME_PARTIAL_MATCH(name) (name), (sizeof (name) - 1)
52260484Sobrien
52360484Sobrien  /* Only use this entry if the default section alignment for this
52460484Sobrien     target is at least that much (as a power of two).  If this field
52560484Sobrien     is COFF_ALIGNMENT_FIELD_EMPTY, it should be ignored.  */
52660484Sobrien  unsigned int default_alignment_min;
52760484Sobrien
52860484Sobrien  /* Only use this entry if the default section alignment for this
52960484Sobrien     target is no greater than this (as a power of two).  If this
53060484Sobrien     field is COFF_ALIGNMENT_FIELD_EMPTY, it should be ignored.  */
53160484Sobrien  unsigned int default_alignment_max;
53260484Sobrien
53360484Sobrien#define COFF_ALIGNMENT_FIELD_EMPTY ((unsigned int) -1)
53460484Sobrien
53560484Sobrien  /* The desired alignment for this section (as a power of two).  */
53660484Sobrien  unsigned int alignment_power;
53760484Sobrien};
53860484Sobrien
53933965Sjdpextern struct bfd_hash_entry *_bfd_coff_link_hash_newfunc
540218822Sdim  (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
541130561Sobrienextern bfd_boolean _bfd_coff_link_hash_table_init
542218822Sdim  (struct coff_link_hash_table *, bfd *,
543218822Sdim   struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
544218822Sdim			       struct bfd_hash_table *,
545218822Sdim			       const char *),
546218822Sdim   unsigned int);
54733965Sjdpextern struct bfd_link_hash_table *_bfd_coff_link_hash_table_create
548218822Sdim  (bfd *);
54933965Sjdpextern const char *_bfd_coff_internal_syment_name
550218822Sdim  (bfd *, const struct internal_syment *, char *);
551130561Sobrienextern bfd_boolean _bfd_coff_link_add_symbols
552218822Sdim  (bfd *, struct bfd_link_info *);
553130561Sobrienextern bfd_boolean _bfd_coff_final_link
554218822Sdim  (bfd *, struct bfd_link_info *);
55533965Sjdpextern struct internal_reloc *_bfd_coff_read_internal_relocs
556218822Sdim  (bfd *, asection *, bfd_boolean, bfd_byte *, bfd_boolean,
557218822Sdim   struct internal_reloc *);
558130561Sobrienextern bfd_boolean _bfd_coff_generic_relocate_section
559218822Sdim  (bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
560218822Sdim   struct internal_reloc *, struct internal_syment *, asection **);
56133965Sjdpextern struct bfd_hash_entry *_bfd_coff_debug_merge_hash_newfunc
562218822Sdim  (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
563130561Sobrienextern bfd_boolean _bfd_coff_write_global_sym
564218822Sdim  (struct coff_link_hash_entry *, void *);
565130561Sobrienextern bfd_boolean _bfd_coff_write_task_globals
566218822Sdim  (struct coff_link_hash_entry *, void *);
567130561Sobrienextern bfd_boolean _bfd_coff_link_input_bfd
568218822Sdim  (struct coff_final_link_info *, bfd *);
569130561Sobrienextern bfd_boolean _bfd_coff_reloc_link_order
570218822Sdim  (bfd *, struct coff_final_link_info *, asection *,
571218822Sdim   struct bfd_link_order *);
57233965Sjdp
57333965Sjdp
57433965Sjdp#define coff_get_section_contents_in_window \
57533965Sjdp  _bfd_generic_get_section_contents_in_window
57633965Sjdp
57733965Sjdp/* Functions in xcofflink.c.  */
57833965Sjdp
57989857Sobrienextern long _bfd_xcoff_get_dynamic_symtab_upper_bound
580218822Sdim  (bfd *);
58133965Sjdpextern long _bfd_xcoff_canonicalize_dynamic_symtab
582218822Sdim  (bfd *, asymbol **);
58389857Sobrienextern long _bfd_xcoff_get_dynamic_reloc_upper_bound
584218822Sdim  (bfd *);
58533965Sjdpextern long _bfd_xcoff_canonicalize_dynamic_reloc
586218822Sdim  (bfd *, arelent **, asymbol **);
58733965Sjdpextern struct bfd_link_hash_table *_bfd_xcoff_bfd_link_hash_table_create
588218822Sdim  (bfd *);
589104834Sobrienextern void _bfd_xcoff_bfd_link_hash_table_free
590218822Sdim  (struct bfd_link_hash_table *);
591130561Sobrienextern bfd_boolean _bfd_xcoff_bfd_link_add_symbols
592218822Sdim  (bfd *, struct bfd_link_info *);
593130561Sobrienextern bfd_boolean _bfd_xcoff_bfd_final_link
594218822Sdim  (bfd *, struct bfd_link_info *);
595130561Sobrienextern bfd_boolean _bfd_ppc_xcoff_relocate_section
596218822Sdim  (bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
597218822Sdim   struct internal_reloc *, struct internal_syment *, asection **);
59833965Sjdp
59933965Sjdp/* Functions in coff-ppc.c.  FIXME: These are called be pe.em in the
60033965Sjdp   linker, and so should start with bfd and be declared in bfd.h.  */
60133965Sjdp
602130561Sobrienextern bfd_boolean ppc_allocate_toc_section
603218822Sdim  (struct bfd_link_info *);
604130561Sobrienextern bfd_boolean ppc_process_before_allocation
605218822Sdim  (bfd *, struct bfd_link_info *);
60633965Sjdp
607104834Sobrien/* Extracted from coffcode.h.  */
60833965Sjdptypedef struct coff_ptr_struct
60933965Sjdp{
61089857Sobrien  /* Remembers the offset from the first symbol in the file for
61189857Sobrien     this symbol. Generated by coff_renumber_symbols. */
61289857Sobrien  unsigned int offset;
61333965Sjdp
61489857Sobrien  /* Should the value of this symbol be renumbered.  Used for
61589857Sobrien     XCOFF C_BSTAT symbols.  Set by coff_slurp_symbol_table.  */
61689857Sobrien  unsigned int fix_value : 1;
61733965Sjdp
61889857Sobrien  /* Should the tag field of this symbol be renumbered.
61989857Sobrien     Created by coff_pointerize_aux. */
62089857Sobrien  unsigned int fix_tag : 1;
62133965Sjdp
62289857Sobrien  /* Should the endidx field of this symbol be renumbered.
62389857Sobrien     Created by coff_pointerize_aux. */
62489857Sobrien  unsigned int fix_end : 1;
62533965Sjdp
62689857Sobrien  /* Should the x_csect.x_scnlen field be renumbered.
62789857Sobrien     Created by coff_pointerize_aux. */
62889857Sobrien  unsigned int fix_scnlen : 1;
62933965Sjdp
63089857Sobrien  /* Fix up an XCOFF C_BINCL/C_EINCL symbol.  The value is the
63189857Sobrien     index into the line number entries.  Set by coff_slurp_symbol_table.  */
63289857Sobrien  unsigned int fix_line : 1;
63333965Sjdp
63489857Sobrien  /* The container for the symbol structure as read and translated
63589857Sobrien     from the file. */
63689857Sobrien  union
63789857Sobrien  {
63889857Sobrien    union internal_auxent auxent;
63989857Sobrien    struct internal_syment syment;
64089857Sobrien  } u;
64133965Sjdp} combined_entry_type;
64233965Sjdp
64333965Sjdp
64477298Sobrien/* Each canonical asymbol really looks like this: */
64533965Sjdp
64633965Sjdptypedef struct coff_symbol_struct
64733965Sjdp{
64889857Sobrien  /* The actual symbol which the rest of BFD works with */
64989857Sobrien  asymbol symbol;
65033965Sjdp
65189857Sobrien  /* A pointer to the hidden information for this symbol */
65289857Sobrien  combined_entry_type *native;
65333965Sjdp
65489857Sobrien  /* A pointer to the linenumber information for this symbol */
65589857Sobrien  struct lineno_cache_entry *lineno;
65633965Sjdp
65789857Sobrien  /* Have the line numbers been relocated yet ? */
658130561Sobrien  bfd_boolean done_lineno;
65933965Sjdp} coff_symbol_type;
66077298Sobrien/* COFF symbol classifications.  */
66160484Sobrien
66260484Sobrienenum coff_symbol_classification
66360484Sobrien{
66477298Sobrien  /* Global symbol.  */
66560484Sobrien  COFF_SYMBOL_GLOBAL,
66677298Sobrien  /* Common symbol.  */
66760484Sobrien  COFF_SYMBOL_COMMON,
66877298Sobrien  /* Undefined symbol.  */
66960484Sobrien  COFF_SYMBOL_UNDEFINED,
67077298Sobrien  /* Local symbol.  */
67160484Sobrien  COFF_SYMBOL_LOCAL,
67277298Sobrien  /* PE section symbol.  */
67360484Sobrien  COFF_SYMBOL_PE_SECTION
67460484Sobrien};
67560484Sobrien
67633965Sjdptypedef struct
67733965Sjdp{
67889857Sobrien  void (*_bfd_coff_swap_aux_in)
679218822Sdim    (bfd *, void *, int, int, int, int, void *);
68033965Sjdp
68189857Sobrien  void (*_bfd_coff_swap_sym_in)
682218822Sdim    (bfd *, void *, void *);
68333965Sjdp
68489857Sobrien  void (*_bfd_coff_swap_lineno_in)
685218822Sdim    (bfd *, void *, void *);
68633965Sjdp
68789857Sobrien  unsigned int (*_bfd_coff_swap_aux_out)
688218822Sdim    (bfd *, void *, int, int, int, int, void *);
68933965Sjdp
69089857Sobrien  unsigned int (*_bfd_coff_swap_sym_out)
691218822Sdim    (bfd *, void *, void *);
69233965Sjdp
69389857Sobrien  unsigned int (*_bfd_coff_swap_lineno_out)
694218822Sdim    (bfd *, void *, void *);
69533965Sjdp
69689857Sobrien  unsigned int (*_bfd_coff_swap_reloc_out)
697218822Sdim    (bfd *, void *, void *);
69833965Sjdp
69989857Sobrien  unsigned int (*_bfd_coff_swap_filehdr_out)
700218822Sdim    (bfd *, void *, void *);
70133965Sjdp
70289857Sobrien  unsigned int (*_bfd_coff_swap_aouthdr_out)
703218822Sdim    (bfd *, void *, void *);
70433965Sjdp
70589857Sobrien  unsigned int (*_bfd_coff_swap_scnhdr_out)
706218822Sdim    (bfd *, void *, void *);
70733965Sjdp
70889857Sobrien  unsigned int _bfd_filhsz;
70989857Sobrien  unsigned int _bfd_aoutsz;
71089857Sobrien  unsigned int _bfd_scnhsz;
71189857Sobrien  unsigned int _bfd_symesz;
71289857Sobrien  unsigned int _bfd_auxesz;
71389857Sobrien  unsigned int _bfd_relsz;
71489857Sobrien  unsigned int _bfd_linesz;
71589857Sobrien  unsigned int _bfd_filnmlen;
716130561Sobrien  bfd_boolean _bfd_coff_long_filenames;
717130561Sobrien  bfd_boolean _bfd_coff_long_section_names;
71889857Sobrien  unsigned int _bfd_coff_default_section_alignment_power;
719130561Sobrien  bfd_boolean _bfd_coff_force_symnames_in_strings;
72089857Sobrien  unsigned int _bfd_coff_debug_string_prefix_length;
72133965Sjdp
72289857Sobrien  void (*_bfd_coff_swap_filehdr_in)
723218822Sdim    (bfd *, void *, void *);
72438889Sjdp
72589857Sobrien  void (*_bfd_coff_swap_aouthdr_in)
726218822Sdim    (bfd *, void *, void *);
72789857Sobrien
72889857Sobrien  void (*_bfd_coff_swap_scnhdr_in)
729218822Sdim    (bfd *, void *, void *);
73089857Sobrien
73189857Sobrien  void (*_bfd_coff_swap_reloc_in)
732218822Sdim    (bfd *abfd, void *, void *);
73389857Sobrien
734130561Sobrien  bfd_boolean (*_bfd_coff_bad_format_hook)
735218822Sdim    (bfd *, void *);
73689857Sobrien
737130561Sobrien  bfd_boolean (*_bfd_coff_set_arch_mach_hook)
738218822Sdim    (bfd *, void *);
73989857Sobrien
740218822Sdim  void * (*_bfd_coff_mkobject_hook)
741218822Sdim    (bfd *, void *, void *);
74289857Sobrien
743130561Sobrien  bfd_boolean (*_bfd_styp_to_sec_flags_hook)
744218822Sdim    (bfd *, void *, const char *, asection *, flagword *);
74589857Sobrien
74689857Sobrien  void (*_bfd_set_alignment_hook)
747218822Sdim    (bfd *, asection *, void *);
74889857Sobrien
749130561Sobrien  bfd_boolean (*_bfd_coff_slurp_symbol_table)
750218822Sdim    (bfd *);
75189857Sobrien
752130561Sobrien  bfd_boolean (*_bfd_coff_symname_in_debug)
753218822Sdim    (bfd *, struct internal_syment *);
75489857Sobrien
755130561Sobrien  bfd_boolean (*_bfd_coff_pointerize_aux_hook)
756218822Sdim    (bfd *, combined_entry_type *, combined_entry_type *,
757218822Sdim            unsigned int, combined_entry_type *);
75889857Sobrien
759130561Sobrien  bfd_boolean (*_bfd_coff_print_aux)
760218822Sdim    (bfd *, FILE *, combined_entry_type *, combined_entry_type *,
761218822Sdim            combined_entry_type *, unsigned int);
76289857Sobrien
76389857Sobrien  void (*_bfd_coff_reloc16_extra_cases)
764218822Sdim    (bfd *, struct bfd_link_info *, struct bfd_link_order *, arelent *,
765218822Sdim           bfd_byte *, unsigned int *, unsigned int *);
76689857Sobrien
76789857Sobrien  int (*_bfd_coff_reloc16_estimate)
768218822Sdim    (bfd *, asection *, arelent *, unsigned int,
769218822Sdim            struct bfd_link_info *);
77089857Sobrien
77189857Sobrien  enum coff_symbol_classification (*_bfd_coff_classify_symbol)
772218822Sdim    (bfd *, struct internal_syment *);
77389857Sobrien
774130561Sobrien  bfd_boolean (*_bfd_coff_compute_section_file_positions)
775218822Sdim    (bfd *);
77689857Sobrien
777130561Sobrien  bfd_boolean (*_bfd_coff_start_final_link)
778218822Sdim    (bfd *, struct bfd_link_info *);
77989857Sobrien
780130561Sobrien  bfd_boolean (*_bfd_coff_relocate_section)
781218822Sdim    (bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
782218822Sdim            struct internal_reloc *, struct internal_syment *, asection **);
78389857Sobrien
78489857Sobrien  reloc_howto_type *(*_bfd_coff_rtype_to_howto)
785218822Sdim    (bfd *, asection *, struct internal_reloc *,
78689857Sobrien            struct coff_link_hash_entry *, struct internal_syment *,
787218822Sdim            bfd_vma *);
78889857Sobrien
789130561Sobrien  bfd_boolean (*_bfd_coff_adjust_symndx)
790218822Sdim    (bfd *, struct bfd_link_info *, bfd *, asection *,
791218822Sdim            struct internal_reloc *, bfd_boolean *);
79289857Sobrien
793130561Sobrien  bfd_boolean (*_bfd_coff_link_add_one_symbol)
794218822Sdim    (struct bfd_link_info *, bfd *, const char *, flagword,
795130561Sobrien            asection *, bfd_vma, const char *, bfd_boolean, bfd_boolean,
796218822Sdim            struct bfd_link_hash_entry **);
79789857Sobrien
798130561Sobrien  bfd_boolean (*_bfd_coff_link_output_has_begun)
799218822Sdim    (bfd *, struct coff_final_link_info *);
80089857Sobrien
801130561Sobrien  bfd_boolean (*_bfd_coff_final_link_postscript)
802218822Sdim    (bfd *, struct coff_final_link_info *);
80389857Sobrien
80433965Sjdp} bfd_coff_backend_data;
80533965Sjdp
80689857Sobrien#define coff_backend_info(abfd) \
80789857Sobrien  ((bfd_coff_backend_data *) (abfd)->xvec->backend_data)
80833965Sjdp
80933965Sjdp#define bfd_coff_swap_aux_in(a,e,t,c,ind,num,i) \
81089857Sobrien  ((coff_backend_info (a)->_bfd_coff_swap_aux_in) (a,e,t,c,ind,num,i))
81133965Sjdp
81233965Sjdp#define bfd_coff_swap_sym_in(a,e,i) \
81389857Sobrien  ((coff_backend_info (a)->_bfd_coff_swap_sym_in) (a,e,i))
81433965Sjdp
81533965Sjdp#define bfd_coff_swap_lineno_in(a,e,i) \
81689857Sobrien  ((coff_backend_info ( a)->_bfd_coff_swap_lineno_in) (a,e,i))
81733965Sjdp
81833965Sjdp#define bfd_coff_swap_reloc_out(abfd, i, o) \
81989857Sobrien  ((coff_backend_info (abfd)->_bfd_coff_swap_reloc_out) (abfd, i, o))
82033965Sjdp
82133965Sjdp#define bfd_coff_swap_lineno_out(abfd, i, o) \
82289857Sobrien  ((coff_backend_info (abfd)->_bfd_coff_swap_lineno_out) (abfd, i, o))
82333965Sjdp
82433965Sjdp#define bfd_coff_swap_aux_out(a,i,t,c,ind,num,o) \
82589857Sobrien  ((coff_backend_info (a)->_bfd_coff_swap_aux_out) (a,i,t,c,ind,num,o))
82633965Sjdp
82733965Sjdp#define bfd_coff_swap_sym_out(abfd, i,o) \
82889857Sobrien  ((coff_backend_info (abfd)->_bfd_coff_swap_sym_out) (abfd, i, o))
82933965Sjdp
83033965Sjdp#define bfd_coff_swap_scnhdr_out(abfd, i,o) \
83189857Sobrien  ((coff_backend_info (abfd)->_bfd_coff_swap_scnhdr_out) (abfd, i, o))
83233965Sjdp
83333965Sjdp#define bfd_coff_swap_filehdr_out(abfd, i,o) \
83489857Sobrien  ((coff_backend_info (abfd)->_bfd_coff_swap_filehdr_out) (abfd, i, o))
83533965Sjdp
83633965Sjdp#define bfd_coff_swap_aouthdr_out(abfd, i,o) \
83789857Sobrien  ((coff_backend_info (abfd)->_bfd_coff_swap_aouthdr_out) (abfd, i, o))
83833965Sjdp
83933965Sjdp#define bfd_coff_filhsz(abfd) (coff_backend_info (abfd)->_bfd_filhsz)
84033965Sjdp#define bfd_coff_aoutsz(abfd) (coff_backend_info (abfd)->_bfd_aoutsz)
84133965Sjdp#define bfd_coff_scnhsz(abfd) (coff_backend_info (abfd)->_bfd_scnhsz)
84233965Sjdp#define bfd_coff_symesz(abfd) (coff_backend_info (abfd)->_bfd_symesz)
84333965Sjdp#define bfd_coff_auxesz(abfd) (coff_backend_info (abfd)->_bfd_auxesz)
84433965Sjdp#define bfd_coff_relsz(abfd)  (coff_backend_info (abfd)->_bfd_relsz)
84533965Sjdp#define bfd_coff_linesz(abfd) (coff_backend_info (abfd)->_bfd_linesz)
84660484Sobrien#define bfd_coff_filnmlen(abfd) (coff_backend_info (abfd)->_bfd_filnmlen)
84789857Sobrien#define bfd_coff_long_filenames(abfd) \
84889857Sobrien  (coff_backend_info (abfd)->_bfd_coff_long_filenames)
84933965Sjdp#define bfd_coff_long_section_names(abfd) \
85089857Sobrien  (coff_backend_info (abfd)->_bfd_coff_long_section_names)
85133965Sjdp#define bfd_coff_default_section_alignment_power(abfd) \
85289857Sobrien  (coff_backend_info (abfd)->_bfd_coff_default_section_alignment_power)
85333965Sjdp#define bfd_coff_swap_filehdr_in(abfd, i,o) \
85489857Sobrien  ((coff_backend_info (abfd)->_bfd_coff_swap_filehdr_in) (abfd, i, o))
85533965Sjdp
85633965Sjdp#define bfd_coff_swap_aouthdr_in(abfd, i,o) \
85789857Sobrien  ((coff_backend_info (abfd)->_bfd_coff_swap_aouthdr_in) (abfd, i, o))
85833965Sjdp
85933965Sjdp#define bfd_coff_swap_scnhdr_in(abfd, i,o) \
86089857Sobrien  ((coff_backend_info (abfd)->_bfd_coff_swap_scnhdr_in) (abfd, i, o))
86133965Sjdp
86233965Sjdp#define bfd_coff_swap_reloc_in(abfd, i, o) \
86389857Sobrien  ((coff_backend_info (abfd)->_bfd_coff_swap_reloc_in) (abfd, i, o))
86433965Sjdp
86533965Sjdp#define bfd_coff_bad_format_hook(abfd, filehdr) \
86689857Sobrien  ((coff_backend_info (abfd)->_bfd_coff_bad_format_hook) (abfd, filehdr))
86733965Sjdp
86833965Sjdp#define bfd_coff_set_arch_mach_hook(abfd, filehdr)\
86989857Sobrien  ((coff_backend_info (abfd)->_bfd_coff_set_arch_mach_hook) (abfd, filehdr))
87033965Sjdp#define bfd_coff_mkobject_hook(abfd, filehdr, aouthdr)\
871130561Sobrien  ((coff_backend_info (abfd)->_bfd_coff_mkobject_hook)\
872130561Sobrien   (abfd, filehdr, aouthdr))
87333965Sjdp
87489857Sobrien#define bfd_coff_styp_to_sec_flags_hook(abfd, scnhdr, name, section, flags_ptr)\
87589857Sobrien  ((coff_backend_info (abfd)->_bfd_styp_to_sec_flags_hook)\
87689857Sobrien   (abfd, scnhdr, name, section, flags_ptr))
87733965Sjdp
87833965Sjdp#define bfd_coff_set_alignment_hook(abfd, sec, scnhdr)\
87989857Sobrien  ((coff_backend_info (abfd)->_bfd_set_alignment_hook) (abfd, sec, scnhdr))
88033965Sjdp
88133965Sjdp#define bfd_coff_slurp_symbol_table(abfd)\
88289857Sobrien  ((coff_backend_info (abfd)->_bfd_coff_slurp_symbol_table) (abfd))
88333965Sjdp
88433965Sjdp#define bfd_coff_symname_in_debug(abfd, sym)\
88589857Sobrien  ((coff_backend_info (abfd)->_bfd_coff_symname_in_debug) (abfd, sym))
88633965Sjdp
88777298Sobrien#define bfd_coff_force_symnames_in_strings(abfd)\
88889857Sobrien  (coff_backend_info (abfd)->_bfd_coff_force_symnames_in_strings)
88977298Sobrien
89077298Sobrien#define bfd_coff_debug_string_prefix_length(abfd)\
89189857Sobrien  (coff_backend_info (abfd)->_bfd_coff_debug_string_prefix_length)
89277298Sobrien
89333965Sjdp#define bfd_coff_print_aux(abfd, file, base, symbol, aux, indaux)\
89489857Sobrien  ((coff_backend_info (abfd)->_bfd_coff_print_aux)\
89589857Sobrien   (abfd, file, base, symbol, aux, indaux))
89633965Sjdp
897130561Sobrien#define bfd_coff_reloc16_extra_cases(abfd, link_info, link_order,\
898130561Sobrien                                     reloc, data, src_ptr, dst_ptr)\
89989857Sobrien  ((coff_backend_info (abfd)->_bfd_coff_reloc16_extra_cases)\
90089857Sobrien   (abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr))
90133965Sjdp
90233965Sjdp#define bfd_coff_reloc16_estimate(abfd, section, reloc, shrink, link_info)\
90389857Sobrien  ((coff_backend_info (abfd)->_bfd_coff_reloc16_estimate)\
90489857Sobrien   (abfd, section, reloc, shrink, link_info))
90533965Sjdp
90660484Sobrien#define bfd_coff_classify_symbol(abfd, sym)\
90789857Sobrien  ((coff_backend_info (abfd)->_bfd_coff_classify_symbol)\
90889857Sobrien   (abfd, sym))
90933965Sjdp
91033965Sjdp#define bfd_coff_compute_section_file_positions(abfd)\
91189857Sobrien  ((coff_backend_info (abfd)->_bfd_coff_compute_section_file_positions)\
91289857Sobrien   (abfd))
91333965Sjdp
91433965Sjdp#define bfd_coff_start_final_link(obfd, info)\
91589857Sobrien  ((coff_backend_info (obfd)->_bfd_coff_start_final_link)\
91689857Sobrien   (obfd, info))
91733965Sjdp#define bfd_coff_relocate_section(obfd,info,ibfd,o,con,rel,isyms,secs)\
91889857Sobrien  ((coff_backend_info (ibfd)->_bfd_coff_relocate_section)\
91989857Sobrien   (obfd, info, ibfd, o, con, rel, isyms, secs))
92033965Sjdp#define bfd_coff_rtype_to_howto(abfd, sec, rel, h, sym, addendp)\
92189857Sobrien  ((coff_backend_info (abfd)->_bfd_coff_rtype_to_howto)\
92289857Sobrien   (abfd, sec, rel, h, sym, addendp))
92333965Sjdp#define bfd_coff_adjust_symndx(obfd, info, ibfd, sec, rel, adjustedp)\
92489857Sobrien  ((coff_backend_info (abfd)->_bfd_coff_adjust_symndx)\
92589857Sobrien   (obfd, info, ibfd, sec, rel, adjustedp))
926130561Sobrien#define bfd_coff_link_add_one_symbol(info, abfd, name, flags, section,\
927130561Sobrien                                     value, string, cp, coll, hashp)\
92889857Sobrien  ((coff_backend_info (abfd)->_bfd_coff_link_add_one_symbol)\
92989857Sobrien   (info, abfd, name, flags, section, value, string, cp, coll, hashp))
93033965Sjdp
93160484Sobrien#define bfd_coff_link_output_has_begun(a,p) \
932218822Sdim  ((coff_backend_info (a)->_bfd_coff_link_output_has_begun) (a, p))
93338889Sjdp#define bfd_coff_final_link_postscript(a,p) \
934218822Sdim  ((coff_backend_info (a)->_bfd_coff_final_link_postscript) (a, p))
93538889Sjdp
936