static void mips_elf_symbol_processing PARAMS ((bfd *, asymbol *));
static boolean mips_elf_read_ecoff_info
PARAMS ((bfd *, asection *, struct ecoff_debug_info *));
+static boolean mips_elf_is_local_label
+ PARAMS ((bfd *, asymbol *));
static boolean mips_elf_find_nearest_line
PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **,
const char **, unsigned int *));
}
}
- return gprel16_with_gp (symbol, reloc_entry, input_section, relocateable,
- data, elf_gp (output_bfd));
+ return gprel16_with_gp (abfd, symbol, reloc_entry, input_section,
+ relocateable, data, elf_gp (output_bfd));
}
static bfd_reloc_status_type
return false;
}
\f
+/* MIPS ELF local labels start with '$', not 'L'. */
+
+/*ARGSUSED*/
+static boolean
+mips_elf_is_local_label (abfd, symbol)
+ bfd *abfd;
+ asymbol *symbol;
+{
+ return symbol->name[0] == '$';
+}
+
/* MIPS ELF uses a special find_nearest_line routine in order the
handle the ECOFF debugging information. */
lh = 0;
else
{
- h = bfd_hash_lookup (link_info->hash, "_gp", false, false);
+ h = bfd_hash_lookup (&link_info->hash->table, "_gp", false, false);
lh = (struct bfd_link_hash_entry *) h;
}
lookup:
mips_elf_final_write_processing
#define elf_backend_ecoff_debug_swap &mips_elf_ecoff_debug_swap
+#define bfd_elf32_bfd_is_local_label mips_elf_is_local_label
#define bfd_elf32_find_nearest_line mips_elf_find_nearest_line
#define bfd_elf32_bfd_link_hash_table_create \
/* Bitsize of constructor entries. */
unsigned int constructor_bitsize;
/* Reloc to use for constructor entries. */
- CONST struct reloc_howto_struct *constructor_reloc;
+ reloc_howto_type *constructor_reloc;
/* How to swap debugging information. */
struct ecoff_debug_swap debug_swap;
/* External reloc size. */
/* True if this BFD was written by the backend linker. */
boolean linker;
+ /* Used by find_nearest_line entry point. The structure could be
+ included directly in this one, but there's no point to wasting
+ the memory just for the infrequently called find_nearest_line. */
+ struct ecoff_find_line *find_line_info;
+
} ecoff_data_type;
/* Each canonical asymbol really looks like this. */
macro is only ever applied to an asymbol. */
#define ecoffsymbol(asymbol) ((ecoff_symbol_type *) (&((asymbol)->the_bfd)))
-/* This is a hack borrowed from coffcode.h; we need to save the index
- of an external symbol when we write it out so that can set the
- symbol index correctly when we write out the relocs. */
-#define ecoff_get_sym_index(symbol) ((unsigned long) (symbol)->udata)
-#define ecoff_set_sym_index(symbol, idx) ((symbol)->udata = (PTR) (idx))
+/* We need to save the index of an external symbol when we write it
+ out so that can set the symbol index correctly when we write out
+ the relocs. */
+#define ecoff_get_sym_index(symbol) ((symbol)->udata.i)
+#define ecoff_set_sym_index(symbol, idx) ((symbol)->udata.i = (idx))
/* When generating MIPS embedded PIC code, the linker relaxes the code
to turn PC relative branches into longer code sequences when the PC
extern boolean _bfd_ecoff_get_section_contents
PARAMS ((bfd *, asection *, PTR location, file_ptr, bfd_size_type));
+#define _bfd_ecoff_bfd_link_split_section _bfd_generic_link_split_section
+
extern boolean _bfd_ecoff_bfd_copy_private_bfd_data PARAMS ((bfd *, bfd *));
#define _bfd_ecoff_bfd_copy_private_section_data \
_bfd_generic_bfd_copy_private_section_data
+#define _bfd_ecoff_bfd_copy_private_symbol_data \
+ _bfd_generic_bfd_copy_private_symbol_data
+
+#define _bfd_ecoff_bfd_merge_private_bfd_data \
+ _bfd_generic_bfd_merge_private_bfd_data
+
+#define _bfd_ecoff_bfd_set_private_flags _bfd_generic_bfd_set_private_flags
extern boolean _bfd_ecoff_slurp_armap PARAMS ((bfd *abfd));
#define _bfd_ecoff_slurp_extended_name_table _bfd_slurp_extended_name_table
+#define _bfd_ecoff_construct_extended_name_table \
+ _bfd_archive_bsd_construct_extended_name_table
#define _bfd_ecoff_truncate_arname bfd_dont_truncate_arname
extern boolean _bfd_ecoff_write_armap
PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int));
#define _bfd_ecoff_openr_next_archived_file \
bfd_generic_openr_next_archived_file
#define _bfd_ecoff_generic_stat_arch_elt bfd_generic_stat_arch_elt
+#define _bfd_ecoff_update_armap_timestamp bfd_true
extern long _bfd_ecoff_get_symtab_upper_bound PARAMS ((bfd *abfd));
extern long _bfd_ecoff_get_symtab PARAMS ((bfd *abfd, asymbol **alocation));
PARAMS ((bfd *, PTR filep, asymbol *, bfd_print_symbol_type));
extern void _bfd_ecoff_get_symbol_info
PARAMS ((bfd *, asymbol *, symbol_info *));
-#define _bfd_ecoff_bfd_is_local_label bfd_generic_is_local_label
+extern boolean _bfd_ecoff_bfd_is_local_label
+ PARAMS ((bfd *, asymbol *));
#define _bfd_ecoff_get_lineno _bfd_nosymbols_get_lineno
extern boolean _bfd_ecoff_find_nearest_line
PARAMS ((bfd *, asection *, asymbol **, bfd_vma offset,
extern flagword _bfd_ecoff_styp_to_sec_flags
PARAMS ((bfd *abfd, PTR hdr, const char *name));
extern boolean _bfd_ecoff_slurp_symbol_table PARAMS ((bfd *abfd));
+
+/* ECOFF auxiliary information swapping routines. These are the same
+ for all ECOFF targets, so they are defined in ecofflink.c. */
+
+extern void _bfd_ecoff_swap_tir_in
+ PARAMS ((int, const struct tir_ext *, TIR *));
+extern void _bfd_ecoff_swap_tir_out
+ PARAMS ((int, const TIR *, struct tir_ext *));
+extern void _bfd_ecoff_swap_rndx_in
+ PARAMS ((int, const struct rndx_ext *, RNDXR *));
+extern void _bfd_ecoff_swap_rndx_out
+ PARAMS ((int, const RNDXR *, struct rndx_ext *));