00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #include "bfdlink.h"
00027
00028 #ifndef ECOFF_H
00029 #include "coff/ecoff.h"
00030 #endif
00031
00032
00033
00034
00035
00036
00037 #define ecoff_backend(abfd) \
00038 ((struct ecoff_backend_data *) (abfd)->xvec->backend_data)
00039
00040 struct ecoff_backend_data
00041 {
00042
00043 bfd_coff_backend_data coff;
00044
00045 enum bfd_architecture arch;
00046
00047 const char *armap_start;
00048
00049
00050 bfd_vma round;
00051
00052
00053
00054 bfd_boolean rdata_in_text;
00055
00056 unsigned int constructor_bitsize;
00057
00058 reloc_howto_type *constructor_reloc;
00059
00060 struct ecoff_debug_swap debug_swap;
00061
00062 bfd_size_type external_reloc_size;
00063
00064 void (*swap_reloc_in) PARAMS ((bfd *, PTR, struct internal_reloc *));
00065 void (*swap_reloc_out) PARAMS ((bfd *, const struct internal_reloc *, PTR));
00066
00067 void (*adjust_reloc_in)
00068 PARAMS ((bfd *, const struct internal_reloc *, arelent *));
00069 void (*adjust_reloc_out)
00070 PARAMS ((bfd *, const arelent *, struct internal_reloc *));
00071
00072 bfd_boolean (*relocate_section)
00073 PARAMS ((bfd *output_bfd, struct bfd_link_info *, bfd *input_bfd,
00074 asection *input_section, bfd_byte *contents,
00075 PTR external_relocs));
00076
00077 bfd_boolean (*adjust_headers)
00078 PARAMS ((bfd *, struct internal_filehdr *, struct internal_aouthdr *));
00079
00080
00081 bfd *(*get_elt_at_filepos) PARAMS ((bfd *, file_ptr));
00082 };
00083
00084
00085
00086 #define ecoff_data(abfd) ((abfd)->tdata.ecoff_obj_data)
00087
00088 typedef struct ecoff_tdata
00089 {
00090
00091
00092 file_ptr reloc_filepos;
00093
00094
00095 file_ptr sym_filepos;
00096
00097
00098
00099 unsigned long text_start;
00100 unsigned long text_end;
00101
00102
00103 bfd_vma gp;
00104
00105
00106
00107
00108 unsigned int gp_size;
00109
00110
00111
00112
00113
00114 unsigned long gprmask;
00115 unsigned long fprmask;
00116 unsigned long cprmask[4];
00117
00118
00119 struct ecoff_debug_info debug_info;
00120
00121
00122 PTR raw_syments;
00123
00124
00125 struct ecoff_symbol_struct *canonical_symbols;
00126
00127
00128
00129 struct ecoff_link_hash_entry **sym_hashes;
00130
00131
00132
00133 asection **symndx_to_section;
00134
00135
00136 bfd_boolean linker;
00137
00138
00139
00140 bfd_boolean issued_multiple_gp_warning;
00141
00142
00143
00144
00145 struct ecoff_find_line *find_line_info;
00146
00147
00148
00149
00150 bfd_boolean rdata_in_text;
00151
00152 } ecoff_data_type;
00153
00154
00155
00156 typedef struct ecoff_symbol_struct
00157 {
00158
00159 asymbol symbol;
00160
00161
00162 FDR *fdr;
00163
00164
00165 bfd_boolean local;
00166
00167
00168
00169
00170 PTR native;
00171 } ecoff_symbol_type;
00172
00173
00174
00175 #define ecoffsymbol(asymbol) ((ecoff_symbol_type *) (&((asymbol)->the_bfd)))
00176
00177
00178
00179
00180 #define ecoff_get_sym_index(symbol) ((symbol)->udata.i)
00181 #define ecoff_set_sym_index(symbol, idx) ((symbol)->udata.i = (idx))
00182
00183
00184
00185
00186
00187
00188 struct ecoff_section_tdata
00189 {
00190
00191
00192
00193
00194
00195
00196 bfd_vma gp;
00197 };
00198
00199
00200 #define ecoff_section_data(abfd, sec) \
00201 ((struct ecoff_section_tdata *) (sec)->used_by_bfd)
00202
00203
00204
00205 struct ecoff_link_hash_entry
00206 {
00207 struct bfd_link_hash_entry root;
00208
00209 long indx;
00210
00211 bfd *abfd;
00212
00213 EXTR esym;
00214
00215 char written;
00216
00217 char small;
00218 };
00219
00220
00221
00222 struct ecoff_link_hash_table
00223 {
00224 struct bfd_link_hash_table root;
00225 };
00226
00227
00228 extern bfd_boolean _bfd_ecoff_mkobject PARAMS ((bfd *));
00229
00230
00231 extern bfd_boolean _bfd_ecoff_slurp_symbolic_info
00232 PARAMS ((bfd *, asection *, struct ecoff_debug_info *));
00233
00234
00235
00236 extern bfd_boolean _bfd_ecoff_write_object_contents PARAMS ((bfd *abfd));
00237 extern const bfd_target *_bfd_ecoff_archive_p PARAMS ((bfd *abfd));
00238
00239 #define _bfd_ecoff_close_and_cleanup _bfd_generic_close_and_cleanup
00240 #define _bfd_ecoff_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
00241 extern bfd_boolean _bfd_ecoff_new_section_hook
00242 PARAMS ((bfd *, asection *));
00243 extern bfd_boolean _bfd_ecoff_get_section_contents
00244 PARAMS ((bfd *, asection *, PTR location, file_ptr, bfd_size_type));
00245
00246 #define _bfd_ecoff_bfd_link_split_section _bfd_generic_link_split_section
00247
00248 extern bfd_boolean _bfd_ecoff_bfd_copy_private_bfd_data
00249 PARAMS ((bfd *, bfd *));
00250 #define _bfd_ecoff_bfd_copy_private_section_data \
00251 _bfd_generic_bfd_copy_private_section_data
00252
00253 #define _bfd_ecoff_bfd_copy_private_symbol_data \
00254 _bfd_generic_bfd_copy_private_symbol_data
00255
00256 #define _bfd_ecoff_bfd_copy_private_header_data \
00257 _bfd_generic_bfd_copy_private_header_data
00258
00259 #define _bfd_ecoff_bfd_print_private_bfd_data \
00260 _bfd_generic_bfd_print_private_bfd_data
00261
00262 #define _bfd_ecoff_bfd_merge_private_bfd_data \
00263 _bfd_generic_bfd_merge_private_bfd_data
00264
00265 #define _bfd_ecoff_bfd_set_private_flags _bfd_generic_bfd_set_private_flags
00266 extern bfd_boolean _bfd_ecoff_slurp_armap PARAMS ((bfd *abfd));
00267 #define _bfd_ecoff_slurp_extended_name_table _bfd_slurp_extended_name_table
00268 #define _bfd_ecoff_construct_extended_name_table \
00269 _bfd_archive_bsd_construct_extended_name_table
00270 #define _bfd_ecoff_truncate_arname bfd_dont_truncate_arname
00271 extern bfd_boolean _bfd_ecoff_write_armap
00272 PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int));
00273 #define _bfd_ecoff_read_ar_hdr _bfd_generic_read_ar_hdr
00274 #define _bfd_ecoff_openr_next_archived_file \
00275 bfd_generic_openr_next_archived_file
00276 #define _bfd_ecoff_get_elt_at_index _bfd_generic_get_elt_at_index
00277 #define _bfd_ecoff_generic_stat_arch_elt bfd_generic_stat_arch_elt
00278 #define _bfd_ecoff_update_armap_timestamp bfd_true
00279 #define _bfd_ecoff_bfd_is_target_special_symbol \
00280 ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
00281
00282 extern long _bfd_ecoff_get_symtab_upper_bound PARAMS ((bfd *abfd));
00283 extern long _bfd_ecoff_canonicalize_symtab PARAMS ((bfd *abfd, asymbol **alocation));
00284 extern asymbol *_bfd_ecoff_make_empty_symbol PARAMS ((bfd *abfd));
00285 extern void _bfd_ecoff_print_symbol
00286 PARAMS ((bfd *, PTR filep, asymbol *, bfd_print_symbol_type));
00287 extern void _bfd_ecoff_get_symbol_info
00288 PARAMS ((bfd *, asymbol *, symbol_info *));
00289 extern bfd_boolean _bfd_ecoff_bfd_is_local_label_name
00290 PARAMS ((bfd *, const char *));
00291 #define _bfd_ecoff_get_lineno _bfd_nosymbols_get_lineno
00292 extern bfd_boolean _bfd_ecoff_find_nearest_line
00293 PARAMS ((bfd *, asection *, asymbol **, bfd_vma offset,
00294 const char **filename_ptr, const char **fnname_ptr,
00295 unsigned int *retline_ptr));
00296 #define _bfd_ecoff_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
00297 #define _bfd_ecoff_read_minisymbols _bfd_generic_read_minisymbols
00298 #define _bfd_ecoff_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
00299
00300 #define _bfd_ecoff_get_reloc_upper_bound coff_get_reloc_upper_bound
00301 extern long _bfd_ecoff_canonicalize_reloc
00302 PARAMS ((bfd *, asection *, arelent **, asymbol **symbols));
00303
00304
00305 extern bfd_boolean _bfd_ecoff_set_arch_mach
00306 PARAMS ((bfd *, enum bfd_architecture, unsigned long));
00307 extern bfd_boolean _bfd_ecoff_set_section_contents
00308 PARAMS ((bfd *, asection *, const PTR location, file_ptr, bfd_size_type));
00309
00310 extern int _bfd_ecoff_sizeof_headers PARAMS ((bfd *abfd, bfd_boolean reloc));
00311
00312
00313 extern struct bfd_link_hash_table *_bfd_ecoff_bfd_link_hash_table_create
00314 PARAMS ((bfd *));
00315 #define _bfd_ecoff_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
00316 extern bfd_boolean _bfd_ecoff_bfd_link_add_symbols
00317 PARAMS ((bfd *, struct bfd_link_info *));
00318 #define _bfd_ecoff_bfd_link_just_syms _bfd_generic_link_just_syms
00319 extern bfd_boolean _bfd_ecoff_bfd_final_link
00320 PARAMS ((bfd *, struct bfd_link_info *));
00321
00322
00323
00324 extern PTR _bfd_ecoff_mkobject_hook PARAMS ((bfd *, PTR filehdr, PTR aouthdr));
00325 #define _bfd_ecoff_set_alignment_hook \
00326 ((void (*) PARAMS ((bfd *, asection *, PTR))) bfd_void)
00327 extern bfd_boolean _bfd_ecoff_set_arch_mach_hook
00328 PARAMS ((bfd *abfd, PTR filehdr));
00329 extern bfd_boolean _bfd_ecoff_styp_to_sec_flags
00330 PARAMS ((bfd *, PTR, const char *, asection *, flagword *));
00331 extern bfd_boolean _bfd_ecoff_slurp_symbol_table PARAMS ((bfd *abfd));
00332
00333
00334
00335
00336 extern void _bfd_ecoff_swap_tir_in
00337 PARAMS ((int, const struct tir_ext *, TIR *));
00338 extern void _bfd_ecoff_swap_tir_out
00339 PARAMS ((int, const TIR *, struct tir_ext *));
00340 extern void _bfd_ecoff_swap_rndx_in
00341 PARAMS ((int, const struct rndx_ext *, RNDXR *));
00342 extern void _bfd_ecoff_swap_rndx_out
00343 PARAMS ((int, const RNDXR *, struct rndx_ext *));