+ (bfd *, struct bfd_link_info *, struct bfd_link_order *,
+ bfd_byte *, bfd_boolean, asymbol **);
+extern bfd_vma bfd_coff_reloc16_get_value
+ (arelent *, struct bfd_link_info *, asection *);
+extern void bfd_perform_slip
+ (bfd *, unsigned int, asection *, bfd_vma);
+
+/* Functions and types in cofflink.c. */
+
+#define STRING_SIZE_SIZE 4
+
+/* We use a hash table to merge identical enum, struct, and union
+ definitions in the linker. */
+
+/* Information we keep for a single element (an enum value, a
+ structure or union field) in the debug merge hash table. */
+
+struct coff_debug_merge_element
+{
+ /* Next element. */
+ struct coff_debug_merge_element *next;
+
+ /* Name. */
+ const char *name;
+
+ /* Type. */
+ unsigned int type;
+
+ /* Symbol index for complex type. */
+ long tagndx;
+};
+
+/* A linked list of debug merge entries for a given name. */
+
+struct coff_debug_merge_type
+{
+ /* Next type with the same name. */
+ struct coff_debug_merge_type *next;
+
+ /* Class of type. */
+ int type_class;
+
+ /* Symbol index where this type is defined. */
+ long indx;
+
+ /* List of elements. */
+ struct coff_debug_merge_element *elements;
+};
+
+/* Information we store in the debug merge hash table. */
+
+struct coff_debug_merge_hash_entry
+{
+ struct bfd_hash_entry root;
+
+ /* A list of types with this name. */
+ struct coff_debug_merge_type *types;
+};
+
+/* The debug merge hash table. */
+
+struct coff_debug_merge_hash_table
+{
+ struct bfd_hash_table root;
+};
+
+/* Initialize a COFF debug merge hash table. */
+
+#define coff_debug_merge_hash_table_init(table) \
+ (bfd_hash_table_init (&(table)->root, _bfd_coff_debug_merge_hash_newfunc, \
+ sizeof (struct coff_debug_merge_hash_entry)))
+
+/* Free a COFF debug merge hash table. */
+
+#define coff_debug_merge_hash_table_free(table) \
+ (bfd_hash_table_free (&(table)->root))
+
+/* Look up an entry in a COFF debug merge hash table. */
+
+#define coff_debug_merge_hash_lookup(table, string, create, copy) \
+ ((struct coff_debug_merge_hash_entry *) \
+ bfd_hash_lookup (&(table)->root, (string), (create), (copy)))
+
+/* Information we keep for each section in the output file when doing
+ a relocatable link. */
+
+struct coff_link_section_info
+{
+ /* The relocs to be output. */
+ struct internal_reloc *relocs;
+ /* For each reloc against a global symbol whose index was not known
+ when the reloc was handled, the global hash table entry. */
+ struct coff_link_hash_entry **rel_hashes;
+};
+
+/* Information that we pass around while doing the final link step. */
+
+struct coff_final_link_info
+{
+ /* General link information. */
+ struct bfd_link_info *info;
+ /* Output BFD. */
+ bfd *output_bfd;
+ /* Used to indicate failure in traversal routine. */
+ bfd_boolean failed;
+ /* If doing "task linking" set only during the time when we want the
+ global symbol writer to convert the storage class of defined global
+ symbols from global to static. */
+ bfd_boolean global_to_static;
+ /* Hash table for long symbol names. */
+ struct bfd_strtab_hash *strtab;
+ /* When doing a relocatable link, an array of information kept for
+ each output section, indexed by the target_index field. */
+ struct coff_link_section_info *section_info;
+ /* Symbol index of last C_FILE symbol (-1 if none). */
+ long last_file_index;
+ /* Contents of last C_FILE symbol. */
+ struct internal_syment last_file;
+ /* Symbol index of first aux entry of last .bf symbol with an empty
+ endndx field (-1 if none). */
+ long last_bf_index;
+ /* Contents of last_bf_index aux entry. */
+ union internal_auxent last_bf;
+ /* Hash table used to merge debug information. */
+ struct coff_debug_merge_hash_table debug_merge;
+ /* Buffer large enough to hold swapped symbols of any input file. */
+ struct internal_syment *internal_syms;
+ /* Buffer large enough to hold sections of symbols of any input file. */
+ asection **sec_ptrs;
+ /* Buffer large enough to hold output indices of symbols of any
+ input file. */
+ long *sym_indices;
+ /* Buffer large enough to hold output symbols for any input file. */
+ bfd_byte *outsyms;
+ /* Buffer large enough to hold external line numbers for any input
+ section. */
+ bfd_byte *linenos;
+ /* Buffer large enough to hold any input section. */
+ bfd_byte *contents;
+ /* Buffer large enough to hold external relocs of any input section. */
+ bfd_byte *external_relocs;
+ /* Buffer large enough to hold swapped relocs of any input section. */
+ struct internal_reloc *internal_relocs;
+};
+
+/* Most COFF variants have no way to record the alignment of a
+ section. This struct is used to set a specific alignment based on
+ the name of the section. */
+
+struct coff_section_alignment_entry
+{
+ /* The section name. */
+ const char *name;
+
+ /* This is either (unsigned int) -1, indicating that the section
+ name must match exactly, or it is the number of letters which
+ must match at the start of the name. */
+ unsigned int comparison_length;
+
+ /* These macros may be used to fill in the first two fields in a
+ structure initialization. */
+#define COFF_SECTION_NAME_EXACT_MATCH(name) (name), ((unsigned int) -1)
+#define COFF_SECTION_NAME_PARTIAL_MATCH(name) (name), (sizeof (name) - 1)
+
+ /* Only use this entry if the default section alignment for this
+ target is at least that much (as a power of two). If this field
+ is COFF_ALIGNMENT_FIELD_EMPTY, it should be ignored. */
+ unsigned int default_alignment_min;
+
+ /* Only use this entry if the default section alignment for this
+ target is no greater than this (as a power of two). If this
+ field is COFF_ALIGNMENT_FIELD_EMPTY, it should be ignored. */
+ unsigned int default_alignment_max;
+
+#define COFF_ALIGNMENT_FIELD_EMPTY ((unsigned int) -1)
+
+ /* The desired alignment for this section (as a power of two). */
+ unsigned int alignment_power;
+};
+
+extern struct bfd_hash_entry *_bfd_coff_link_hash_newfunc
+ (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
+extern bfd_boolean _bfd_coff_link_hash_table_init
+ (struct coff_link_hash_table *, bfd *,
+ struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
+ struct bfd_hash_table *,
+ const char *),
+ unsigned int);
+extern struct bfd_link_hash_table *_bfd_coff_link_hash_table_create
+ (bfd *);
+extern const char *_bfd_coff_internal_syment_name
+ (bfd *, const struct internal_syment *, char *);
+extern bfd_boolean _bfd_coff_section_already_linked
+ (bfd *, asection *, struct bfd_link_info *);
+extern bfd_boolean _bfd_coff_link_add_symbols
+ (bfd *, struct bfd_link_info *);
+extern bfd_boolean _bfd_coff_final_link
+ (bfd *, struct bfd_link_info *);
+extern struct internal_reloc *_bfd_coff_read_internal_relocs
+ (bfd *, asection *, bfd_boolean, bfd_byte *, bfd_boolean,
+ struct internal_reloc *);
+extern bfd_boolean _bfd_coff_generic_relocate_section
+ (bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
+ struct internal_reloc *, struct internal_syment *, asection **);
+extern struct bfd_hash_entry *_bfd_coff_debug_merge_hash_newfunc
+ (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
+extern bfd_boolean _bfd_coff_write_global_sym
+ (struct bfd_hash_entry *, void *);
+extern bfd_boolean _bfd_coff_write_task_globals
+ (struct coff_link_hash_entry *, void *);
+extern bfd_boolean _bfd_coff_link_input_bfd
+ (struct coff_final_link_info *, bfd *);
+extern bfd_boolean _bfd_coff_reloc_link_order
+ (bfd *, struct coff_final_link_info *, asection *,
+ struct bfd_link_order *);
+extern bfd_boolean bfd_coff_gc_sections
+ (bfd *, struct bfd_link_info *);
+extern const char *bfd_coff_group_name
+ (bfd *, const asection *);
+
+#define coff_get_section_contents_in_window \
+ _bfd_generic_get_section_contents_in_window
+
+/* Functions in xcofflink.c. */
+
+extern long _bfd_xcoff_get_dynamic_symtab_upper_bound
+ (bfd *);
+extern long _bfd_xcoff_canonicalize_dynamic_symtab
+ (bfd *, asymbol **);
+extern long _bfd_xcoff_get_dynamic_reloc_upper_bound
+ (bfd *);
+extern long _bfd_xcoff_canonicalize_dynamic_reloc
+ (bfd *, arelent **, asymbol **);
+extern struct bfd_link_hash_table *_bfd_xcoff_bfd_link_hash_table_create
+ (bfd *);
+extern bfd_boolean _bfd_xcoff_bfd_link_add_symbols
+ (bfd *, struct bfd_link_info *);
+extern bfd_boolean _bfd_xcoff_bfd_final_link
+ (bfd *, struct bfd_link_info *);
+extern bfd_boolean _bfd_xcoff_define_common_symbol
+ (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *);
+extern bfd_boolean _bfd_ppc_xcoff_relocate_section
+ (bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
+ struct internal_reloc *, struct internal_syment *, asection **);