Changeset 609 for branches/GNU/src/binutils/bfd/targets.c
- Timestamp:
- Aug 16, 2003, 6:59:22 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GNU/src/binutils/bfd/targets.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 1 /* Generic target-file-type support for the BFD library. 2 2 Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 3 2000, 2001 3 2000, 2001, 2002, 2003 4 4 Free Software Foundation, Inc. 5 5 Written by Cygnus Support. 6 6 7 This file is part of BFD, the Binary File Descriptor library.8 9 This program is free software; you can redistribute it and/or modify10 it under the terms of the GNU General Public License as published by11 the Free Software Foundation; either version 2 of the License, or12 (at your option) any later version.13 14 This program is distributed in the hope that it will be useful,15 but WITHOUT ANY WARRANTY; without even the implied warranty of16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the17 GNU General Public License for more details.18 19 You should have received a copy of the GNU General Public License20 along with this program; if not, write to the Free Software21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */7 This file is part of BFD, the Binary File Descriptor library. 8 9 This program is free software; you can redistribute it and/or modify 10 it under the terms of the GNU General Public License as published by 11 the Free Software Foundation; either version 2 of the License, or 12 (at your option) any later version. 13 14 This program is distributed in the hope that it will be useful, 15 but WITHOUT ANY WARRANTY; without even the implied warranty of 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 GNU General Public License for more details. 18 19 You should have received a copy of the GNU General Public License 20 along with this program; if not, write to the Free Software 21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 22 22 23 23 #include "bfd.h" … … 71 71 If <<target_defaulted>> has been set, each possible target 72 72 type is tried to see if it recognizes the specified format. 73 <<bfd_check_format>> returns << true>> when the caller guesses right.73 <<bfd_check_format>> returns <<TRUE>> when the caller guesses right. 74 74 @menu 75 75 @* bfd_target:: … … 126 126 . (bfd_assert (__FILE__,__LINE__), NULL)) 127 127 .#endif 128 128 . 129 129 This is the structure which defines the type of BFD this is. The 130 130 <<xvec>> member of the struct <<bfd>> itself points here. Each … … 136 136 macro to define them both! 137 137 138 .enum bfd_flavour { 138 .enum bfd_flavour 139 .{ 139 140 . bfd_target_unknown_flavour, 140 141 . bfd_target_aout_flavour, … … 154 155 . bfd_target_msdos_flavour, 155 156 . bfd_target_ovax_flavour, 156 . bfd_target_evax_flavour 157 . bfd_target_evax_flavour, 158 . bfd_target_mmo_flavour, 159 . bfd_target_mach_o_flavour, 160 . bfd_target_pef_flavour, 161 . bfd_target_pef_xlib_flavour, 162 . bfd_target_sym_flavour 157 163 .}; 158 164 . … … 164 170 .typedef struct bfd_target 165 171 .{ 166 167 Identifies the kind of target, e.g., SunOS4, Ultrix, etc. 168 172 . {* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. *} 169 173 . char *name; 170 171 The "flavour" of a back end is a general indication about the contents 172 of a file. 173 174 . 175 . {* The "flavour" of a back end is a general indication about 176 . the contents of a file. *} 174 177 . enum bfd_flavour flavour; 175 176 The order of bytes within the data area of a file. 177 178 . 179 . {* The order of bytes within the data area of a file. *} 178 180 . enum bfd_endian byteorder; 179 180 The order of bytes within the header parts of a file. 181 181 . 182 . {* The order of bytes within the header parts of a file. *} 182 183 . enum bfd_endian header_byteorder; 183 184 A mask of all the flags which an executable may have set - 185 from the set <<BFD_NO_FLAGS>>, <<HAS_RELOC>>, ...<<D_PAGED>>. 186 184 . 185 . {* A mask of all the flags which an executable may have set - 186 . from the set <<BFD_NO_FLAGS>>, <<HAS_RELOC>>, ...<<D_PAGED>>. *} 187 187 . flagword object_flags; 188 189 A mask of all the flags which a section may have set - from 190 the set <<SEC_NO_FLAGS>>, <<SEC_ALLOC>>, ...<<SET_NEVER_LOAD>>. 191 188 . 189 . {* A mask of all the flags which a section may have set - from 190 . the set <<SEC_NO_FLAGS>>, <<SEC_ALLOC>>, ...<<SET_NEVER_LOAD>>. *} 192 191 . flagword section_flags; 193 194 The character normally found at the front of a symbol 195 (if any), perhaps `_'. 196 192 . 193 . {* The character normally found at the front of a symbol. 194 . (if any), perhaps `_'. *} 197 195 . char symbol_leading_char; 198 199 The pad character for file names within an archive header. 200 196 . 197 . {* The pad character for file names within an archive header. *} 201 198 . char ar_pad_char; 202 203 The maximum number of characters in an archive header. 204 199 . 200 . {* The maximum number of characters in an archive header. *} 205 201 . unsigned short ar_max_namelen; 206 207 Entries for byte swapping for data. These are different from the other 208 entry points, since they don't take a BFD asthe first argument. 209 Certain other handlers could do the same. 210 211 . bfd_vma (*bfd_getx64) PARAMS ((const bfd_byte *)); 202 . 203 . {* Entries for byte swapping for data. These are different from the 204 . other entry points, since they don't take a BFD asthe first argument. 205 . Certain other handlers could do the same. *} 206 . bfd_vma (*bfd_getx64) PARAMS ((const bfd_byte *)); 212 207 . bfd_signed_vma (*bfd_getx_signed_64) PARAMS ((const bfd_byte *)); 213 . void (*bfd_putx64) PARAMS ((bfd_vma, bfd_byte *));214 . bfd_vma (*bfd_getx32) PARAMS ((const bfd_byte *));208 . void (*bfd_putx64) PARAMS ((bfd_vma, bfd_byte *)); 209 . bfd_vma (*bfd_getx32) PARAMS ((const bfd_byte *)); 215 210 . bfd_signed_vma (*bfd_getx_signed_32) PARAMS ((const bfd_byte *)); 216 . void (*bfd_putx32) PARAMS ((bfd_vma, bfd_byte *));217 . bfd_vma (*bfd_getx16) PARAMS ((const bfd_byte *));211 . void (*bfd_putx32) PARAMS ((bfd_vma, bfd_byte *)); 212 . bfd_vma (*bfd_getx16) PARAMS ((const bfd_byte *)); 218 213 . bfd_signed_vma (*bfd_getx_signed_16) PARAMS ((const bfd_byte *)); 219 . void (*bfd_putx16) PARAMS ((bfd_vma, bfd_byte *)); 220 221 Byte swapping for the headers 222 223 . bfd_vma (*bfd_h_getx64) PARAMS ((const bfd_byte *)); 214 . void (*bfd_putx16) PARAMS ((bfd_vma, bfd_byte *)); 215 . 216 . {* Byte swapping for the headers. *} 217 . bfd_vma (*bfd_h_getx64) PARAMS ((const bfd_byte *)); 224 218 . bfd_signed_vma (*bfd_h_getx_signed_64) PARAMS ((const bfd_byte *)); 225 . void (*bfd_h_putx64) PARAMS ((bfd_vma, bfd_byte *));226 . bfd_vma (*bfd_h_getx32) PARAMS ((const bfd_byte *));219 . void (*bfd_h_putx64) PARAMS ((bfd_vma, bfd_byte *)); 220 . bfd_vma (*bfd_h_getx32) PARAMS ((const bfd_byte *)); 227 221 . bfd_signed_vma (*bfd_h_getx_signed_32) PARAMS ((const bfd_byte *)); 228 . void (*bfd_h_putx32) PARAMS ((bfd_vma, bfd_byte *));229 . bfd_vma (*bfd_h_getx16) PARAMS ((const bfd_byte *));222 . void (*bfd_h_putx32) PARAMS ((bfd_vma, bfd_byte *)); 223 . bfd_vma (*bfd_h_getx16) PARAMS ((const bfd_byte *)); 230 224 . bfd_signed_vma (*bfd_h_getx_signed_16) PARAMS ((const bfd_byte *)); 231 . void (*bfd_h_putx16) PARAMS ((bfd_vma, bfd_byte *)); 232 233 Format dependent routines: these are vectors of entry points 234 within the target vector structure, one for each format to check. 235 236 Check the format of a file being read. Return a <<bfd_target *>> or zero. 237 225 . void (*bfd_h_putx16) PARAMS ((bfd_vma, bfd_byte *)); 226 . 227 . {* Format dependent routines: these are vectors of entry points 228 . within the target vector structure, one for each format to check. *} 229 . 230 . {* Check the format of a file being read. Return a <<bfd_target *>> or zero. *} 238 231 . const struct bfd_target *(*_bfd_check_format[bfd_type_end]) PARAMS ((bfd *)); 239 240 Set the format of a file being written. 241 242 . boolean (*_bfd_set_format[bfd_type_end]) PARAMS ((bfd *)); 243 244 Write cached information into a file being written, at <<bfd_close>>. 245 246 . boolean (*_bfd_write_contents[bfd_type_end]) PARAMS ((bfd *)); 247 232 . 233 . {* Set the format of a file being written. *} 234 . bfd_boolean (*_bfd_set_format[bfd_type_end]) PARAMS ((bfd *)); 235 . 236 . {* Write cached information into a file being written, at <<bfd_close>>. *} 237 . bfd_boolean (*_bfd_write_contents[bfd_type_end]) PARAMS ((bfd *)); 238 . 248 239 The general target vector. These vectors are initialized using the 249 240 BFD_JUMP_TABLE macros. 250 251 241 . 252 242 . {* Generic entry points. *} 253 .#define BFD_JUMP_TABLE_GENERIC(NAME)\ 254 .CAT(NAME,_close_and_cleanup),\ 255 .CAT(NAME,_bfd_free_cached_info),\ 256 .CAT(NAME,_new_section_hook),\ 257 .CAT(NAME,_get_section_contents),\ 258 .CAT(NAME,_get_section_contents_in_window) 243 Do not "beautify" the CONCAT* macro args. Traditional C will not 244 remove whitespace added here, and thus will fail to concatenate 245 the tokens. 246 .#define BFD_JUMP_TABLE_GENERIC(NAME) \ 247 .CONCAT2 (NAME,_close_and_cleanup), \ 248 .CONCAT2 (NAME,_bfd_free_cached_info), \ 249 .CONCAT2 (NAME,_new_section_hook), \ 250 .CONCAT2 (NAME,_get_section_contents), \ 251 .CONCAT2 (NAME,_get_section_contents_in_window) 259 252 . 260 253 . {* Called when the BFD is being closed to do any necessary cleanup. *} 261 . b oolean(*_close_and_cleanup) PARAMS ((bfd *));254 . bfd_boolean (*_close_and_cleanup) PARAMS ((bfd *)); 262 255 . {* Ask the BFD to free all cached information. *} 263 . b oolean (*_bfd_free_cached_info) PARAMS ((bfd *));256 . bfd_boolean (*_bfd_free_cached_info) PARAMS ((bfd *)); 264 257 . {* Called when a new section is created. *} 265 . b oolean(*_new_section_hook) PARAMS ((bfd *, sec_ptr));258 . bfd_boolean (*_new_section_hook) PARAMS ((bfd *, sec_ptr)); 266 259 . {* Read the contents of a section. *} 267 . boolean (*_bfd_get_section_contents) PARAMS ((bfd *, sec_ptr, PTR, 268 . file_ptr, bfd_size_type)); 269 . boolean (*_bfd_get_section_contents_in_window) 270 . PARAMS ((bfd *, sec_ptr, bfd_window *, 271 . file_ptr, bfd_size_type)); 260 . bfd_boolean (*_bfd_get_section_contents) 261 . PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type)); 262 . bfd_boolean (*_bfd_get_section_contents_in_window) 263 . PARAMS ((bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type)); 272 264 . 273 265 . {* Entry points to copy private data. *} 274 .#define BFD_JUMP_TABLE_COPY(NAME) \275 .C AT(NAME,_bfd_copy_private_bfd_data),\276 .C AT(NAME,_bfd_merge_private_bfd_data),\277 .C AT(NAME,_bfd_copy_private_section_data),\278 .C AT(NAME,_bfd_copy_private_symbol_data),\279 .C AT(NAME,_bfd_set_private_flags),\280 .C AT(NAME,_bfd_print_private_bfd_data)\266 .#define BFD_JUMP_TABLE_COPY(NAME) \ 267 .CONCAT2 (NAME,_bfd_copy_private_bfd_data), \ 268 .CONCAT2 (NAME,_bfd_merge_private_bfd_data), \ 269 .CONCAT2 (NAME,_bfd_copy_private_section_data), \ 270 .CONCAT2 (NAME,_bfd_copy_private_symbol_data), \ 271 .CONCAT2 (NAME,_bfd_set_private_flags), \ 272 .CONCAT2 (NAME,_bfd_print_private_bfd_data) \ 281 273 . {* Called to copy BFD general private data from one object file 282 274 . to another. *} 283 . b oolean(*_bfd_copy_private_bfd_data) PARAMS ((bfd *, bfd *));275 . bfd_boolean (*_bfd_copy_private_bfd_data) PARAMS ((bfd *, bfd *)); 284 276 . {* Called to merge BFD general private data from one object file 285 277 . to a common output file when linking. *} 286 . b oolean(*_bfd_merge_private_bfd_data) PARAMS ((bfd *, bfd *));278 . bfd_boolean (*_bfd_merge_private_bfd_data) PARAMS ((bfd *, bfd *)); 287 279 . {* Called to copy BFD private section data from one object file 288 280 . to another. *} 289 . b oolean (*_bfd_copy_private_section_data) PARAMS ((bfd *, sec_ptr,290 . 281 . bfd_boolean (*_bfd_copy_private_section_data) 282 . PARAMS ((bfd *, sec_ptr, bfd *, sec_ptr)); 291 283 . {* Called to copy BFD private symbol data from one symbol 292 284 . to another. *} 293 . b oolean (*_bfd_copy_private_symbol_data) PARAMS ((bfd *, asymbol *,294 . 295 . {* Called to set private backend flags *}296 . b oolean(*_bfd_set_private_flags) PARAMS ((bfd *, flagword));297 . 298 . {* Called to print private BFD data *}299 . b oolean(*_bfd_print_private_bfd_data) PARAMS ((bfd *, PTR));285 . bfd_boolean (*_bfd_copy_private_symbol_data) 286 . PARAMS ((bfd *, asymbol *, bfd *, asymbol *)); 287 . {* Called to set private backend flags. *} 288 . bfd_boolean (*_bfd_set_private_flags) PARAMS ((bfd *, flagword)); 289 . 290 . {* Called to print private BFD data. *} 291 . bfd_boolean (*_bfd_print_private_bfd_data) PARAMS ((bfd *, PTR)); 300 292 . 301 293 . {* Core file entry points. *} 302 .#define BFD_JUMP_TABLE_CORE(NAME) \303 .C AT(NAME,_core_file_failing_command),\304 .C AT(NAME,_core_file_failing_signal),\305 .C AT(NAME,_core_file_matches_executable_p)306 . char * (*_core_file_failing_command) PARAMS ((bfd *));307 . int (*_core_file_failing_signal) PARAMS ((bfd *));308 . b oolean(*_core_file_matches_executable_p) PARAMS ((bfd *, bfd *));294 .#define BFD_JUMP_TABLE_CORE(NAME) \ 295 .CONCAT2 (NAME,_core_file_failing_command), \ 296 .CONCAT2 (NAME,_core_file_failing_signal), \ 297 .CONCAT2 (NAME,_core_file_matches_executable_p) 298 . char * (*_core_file_failing_command) PARAMS ((bfd *)); 299 . int (*_core_file_failing_signal) PARAMS ((bfd *)); 300 . bfd_boolean (*_core_file_matches_executable_p) PARAMS ((bfd *, bfd *)); 309 301 . 310 302 . {* Archive entry points. *} 311 .#define BFD_JUMP_TABLE_ARCHIVE(NAME)\ 312 .CAT(NAME,_slurp_armap),\ 313 .CAT(NAME,_slurp_extended_name_table),\ 314 .CAT(NAME,_construct_extended_name_table),\ 315 .CAT(NAME,_truncate_arname),\ 316 .CAT(NAME,_write_armap),\ 317 .CAT(NAME,_read_ar_hdr),\ 318 .CAT(NAME,_openr_next_archived_file),\ 319 .CAT(NAME,_get_elt_at_index),\ 320 .CAT(NAME,_generic_stat_arch_elt),\ 321 .CAT(NAME,_update_armap_timestamp) 322 . boolean (*_bfd_slurp_armap) PARAMS ((bfd *)); 323 . boolean (*_bfd_slurp_extended_name_table) PARAMS ((bfd *)); 324 . boolean (*_bfd_construct_extended_name_table) 325 . PARAMS ((bfd *, char **, bfd_size_type *, const char **)); 326 . void (*_bfd_truncate_arname) PARAMS ((bfd *, CONST char *, char *)); 327 . boolean (*write_armap) PARAMS ((bfd *arch, 328 . unsigned int elength, 329 . struct orl *map, 330 . unsigned int orl_count, 331 . int stridx)); 332 . PTR (*_bfd_read_ar_hdr_fn) PARAMS ((bfd *)); 333 . bfd * (*openr_next_archived_file) PARAMS ((bfd *arch, bfd *prev)); 303 .#define BFD_JUMP_TABLE_ARCHIVE(NAME) \ 304 .CONCAT2 (NAME,_slurp_armap), \ 305 .CONCAT2 (NAME,_slurp_extended_name_table), \ 306 .CONCAT2 (NAME,_construct_extended_name_table), \ 307 .CONCAT2 (NAME,_truncate_arname), \ 308 .CONCAT2 (NAME,_write_armap), \ 309 .CONCAT2 (NAME,_read_ar_hdr), \ 310 .CONCAT2 (NAME,_openr_next_archived_file), \ 311 .CONCAT2 (NAME,_get_elt_at_index), \ 312 .CONCAT2 (NAME,_generic_stat_arch_elt), \ 313 .CONCAT2 (NAME,_update_armap_timestamp) 314 . bfd_boolean (*_bfd_slurp_armap) PARAMS ((bfd *)); 315 . bfd_boolean (*_bfd_slurp_extended_name_table) PARAMS ((bfd *)); 316 . bfd_boolean (*_bfd_construct_extended_name_table) 317 . PARAMS ((bfd *, char **, bfd_size_type *, const char **)); 318 . void (*_bfd_truncate_arname) PARAMS ((bfd *, const char *, char *)); 319 . bfd_boolean (*write_armap) 320 . PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int)); 321 . PTR (*_bfd_read_ar_hdr_fn) PARAMS ((bfd *)); 322 . bfd * (*openr_next_archived_file) PARAMS ((bfd *, bfd *)); 334 323 .#define bfd_get_elt_at_index(b,i) BFD_SEND(b, _bfd_get_elt_at_index, (b,i)) 335 . bfd * (*_bfd_get_elt_at_index) PARAMS ((bfd *, symindex));336 . int (*_bfd_stat_arch_elt) PARAMS ((bfd *, struct stat *));337 . b oolean(*_bfd_update_armap_timestamp) PARAMS ((bfd *));324 . bfd * (*_bfd_get_elt_at_index) PARAMS ((bfd *, symindex)); 325 . int (*_bfd_stat_arch_elt) PARAMS ((bfd *, struct stat *)); 326 . bfd_boolean (*_bfd_update_armap_timestamp) PARAMS ((bfd *)); 338 327 . 339 328 . {* Entry points used for symbols. *} 340 .#define BFD_JUMP_TABLE_SYMBOLS(NAME)\ 341 .CAT(NAME,_get_symtab_upper_bound),\ 342 .CAT(NAME,_get_symtab),\ 343 .CAT(NAME,_make_empty_symbol),\ 344 .CAT(NAME,_print_symbol),\ 345 .CAT(NAME,_get_symbol_info),\ 346 .CAT(NAME,_bfd_is_local_label_name),\ 347 .CAT(NAME,_get_lineno),\ 348 .CAT(NAME,_find_nearest_line),\ 349 .CAT(NAME,_bfd_make_debug_symbol),\ 350 .CAT(NAME,_read_minisymbols),\ 351 .CAT(NAME,_minisymbol_to_symbol) 352 . long (*_bfd_get_symtab_upper_bound) PARAMS ((bfd *)); 353 . long (*_bfd_canonicalize_symtab) PARAMS ((bfd *, 354 . struct symbol_cache_entry **)); 355 . struct symbol_cache_entry * 356 . (*_bfd_make_empty_symbol) PARAMS ((bfd *)); 357 . void (*_bfd_print_symbol) PARAMS ((bfd *, PTR, 358 . struct symbol_cache_entry *, 359 . bfd_print_symbol_type)); 329 .#define BFD_JUMP_TABLE_SYMBOLS(NAME) \ 330 .CONCAT2 (NAME,_get_symtab_upper_bound), \ 331 .CONCAT2 (NAME,_get_symtab), \ 332 .CONCAT2 (NAME,_make_empty_symbol), \ 333 .CONCAT2 (NAME,_print_symbol), \ 334 .CONCAT2 (NAME,_get_symbol_info), \ 335 .CONCAT2 (NAME,_bfd_is_local_label_name), \ 336 .CONCAT2 (NAME,_get_lineno), \ 337 .CONCAT2 (NAME,_find_nearest_line), \ 338 .CONCAT2 (NAME,_bfd_make_debug_symbol), \ 339 .CONCAT2 (NAME,_read_minisymbols), \ 340 .CONCAT2 (NAME,_minisymbol_to_symbol) 341 . long (*_bfd_get_symtab_upper_bound) PARAMS ((bfd *)); 342 . long (*_bfd_canonicalize_symtab) PARAMS ((bfd *, 343 . struct symbol_cache_entry **)); 344 . struct symbol_cache_entry * 345 . (*_bfd_make_empty_symbol) PARAMS ((bfd *)); 346 . void (*_bfd_print_symbol) 347 . PARAMS ((bfd *, PTR, struct symbol_cache_entry *, bfd_print_symbol_type)); 360 348 .#define bfd_print_symbol(b,p,s,e) BFD_SEND(b, _bfd_print_symbol, (b,p,s,e)) 361 . void (*_bfd_get_symbol_info) PARAMS ((bfd *, 362 . struct symbol_cache_entry *, 363 . symbol_info *)); 349 . void (*_bfd_get_symbol_info) 350 . PARAMS ((bfd *, struct symbol_cache_entry *, symbol_info *)); 364 351 .#define bfd_get_symbol_info(b,p,e) BFD_SEND(b, _bfd_get_symbol_info, (b,p,e)) 365 . boolean (*_bfd_is_local_label_name) PARAMS ((bfd *, const char *)); 366 . 367 . alent * (*_get_lineno) PARAMS ((bfd *, struct symbol_cache_entry *)); 368 . boolean (*_bfd_find_nearest_line) PARAMS ((bfd *abfd, 369 . struct sec *section, struct symbol_cache_entry **symbols, 370 . bfd_vma offset, CONST char **file, CONST char **func, 371 . unsigned int *line)); 352 . bfd_boolean (*_bfd_is_local_label_name) PARAMS ((bfd *, const char *)); 353 . 354 . alent * (*_get_lineno) PARAMS ((bfd *, struct symbol_cache_entry *)); 355 . bfd_boolean (*_bfd_find_nearest_line) 356 . PARAMS ((bfd *, struct sec *, struct symbol_cache_entry **, bfd_vma, 357 . const char **, const char **, unsigned int *)); 372 358 . {* Back-door to allow format-aware applications to create debug symbols 373 359 . while using BFD for everything else. Currently used by the assembler 374 360 . when creating COFF files. *} 375 . asymbol * (*_bfd_make_debug_symbol) PARAMS (( 376 . bfd *abfd, 377 . void *ptr, 378 . unsigned long size)); 361 . asymbol * (*_bfd_make_debug_symbol) 362 . PARAMS ((bfd *, void *, unsigned long size)); 379 363 .#define bfd_read_minisymbols(b, d, m, s) \ 380 364 . BFD_SEND (b, _read_minisymbols, (b, d, m, s)) 381 . long (*_read_minisymbols) PARAMS ((bfd *, boolean, PTR *,382 . 365 . long (*_read_minisymbols) 366 . PARAMS ((bfd *, bfd_boolean, PTR *, unsigned int *)); 383 367 .#define bfd_minisymbol_to_symbol(b, d, m, f) \ 384 368 . BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) 385 . asymbol * (*_minisymbol_to_symbol) PARAMS ((bfd *, boolean, const PTR,386 . 369 . asymbol * (*_minisymbol_to_symbol) 370 . PARAMS ((bfd *, bfd_boolean, const PTR, asymbol *)); 387 371 . 388 372 . {* Routines for relocs. *} 389 .#define BFD_JUMP_TABLE_RELOCS(NAME) \390 .C AT(NAME,_get_reloc_upper_bound),\391 .C AT(NAME,_canonicalize_reloc),\392 .C AT(NAME,_bfd_reloc_type_lookup)393 . long (*_get_reloc_upper_bound) PARAMS ((bfd *, sec_ptr));394 . long (*_bfd_canonicalize_reloc) PARAMS ((bfd *, sec_ptr, arelent **,395 . 373 .#define BFD_JUMP_TABLE_RELOCS(NAME) \ 374 .CONCAT2 (NAME,_get_reloc_upper_bound), \ 375 .CONCAT2 (NAME,_canonicalize_reloc), \ 376 .CONCAT2 (NAME,_bfd_reloc_type_lookup) 377 . long (*_get_reloc_upper_bound) PARAMS ((bfd *, sec_ptr)); 378 . long (*_bfd_canonicalize_reloc) 379 . PARAMS ((bfd *, sec_ptr, arelent **, struct symbol_cache_entry **)); 396 380 . {* See documentation on reloc types. *} 397 381 . reloc_howto_type * 398 . (*reloc_type_lookup) PARAMS ((bfd *abfd, 399 . bfd_reloc_code_real_type code)); 382 . (*reloc_type_lookup) PARAMS ((bfd *, bfd_reloc_code_real_type)); 400 383 . 401 384 . {* Routines used when writing an object file. *} 402 .#define BFD_JUMP_TABLE_WRITE(NAME) \403 .C AT(NAME,_set_arch_mach),\404 .C AT(NAME,_set_section_contents)405 . b oolean (*_bfd_set_arch_mach) PARAMS ((bfd *, enum bfd_architecture,406 . 407 . b oolean (*_bfd_set_section_contents) PARAMS ((bfd *, sec_ptr, PTR,408 . 385 .#define BFD_JUMP_TABLE_WRITE(NAME) \ 386 .CONCAT2 (NAME,_set_arch_mach), \ 387 .CONCAT2 (NAME,_set_section_contents) 388 . bfd_boolean (*_bfd_set_arch_mach) 389 . PARAMS ((bfd *, enum bfd_architecture, unsigned long)); 390 . bfd_boolean (*_bfd_set_section_contents) 391 . PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type)); 409 392 . 410 393 . {* Routines used by the linker. *} 411 .#define BFD_JUMP_TABLE_LINK(NAME)\ 412 .CAT(NAME,_sizeof_headers),\ 413 .CAT(NAME,_bfd_get_relocated_section_contents),\ 414 .CAT(NAME,_bfd_relax_section),\ 415 .CAT(NAME,_bfd_link_hash_table_create),\ 416 .CAT(NAME,_bfd_link_add_symbols),\ 417 .CAT(NAME,_bfd_final_link),\ 418 .CAT(NAME,_bfd_link_split_section),\ 419 .CAT(NAME,_bfd_gc_sections) 420 . int (*_bfd_sizeof_headers) PARAMS ((bfd *, boolean)); 421 . bfd_byte * (*_bfd_get_relocated_section_contents) PARAMS ((bfd *, 422 . struct bfd_link_info *, struct bfd_link_order *, 423 . bfd_byte *data, boolean relocateable, 424 . struct symbol_cache_entry **)); 425 . 426 . boolean (*_bfd_relax_section) PARAMS ((bfd *, struct sec *, 427 . struct bfd_link_info *, boolean *again)); 394 .#define BFD_JUMP_TABLE_LINK(NAME) \ 395 .CONCAT2 (NAME,_sizeof_headers), \ 396 .CONCAT2 (NAME,_bfd_get_relocated_section_contents), \ 397 .CONCAT2 (NAME,_bfd_relax_section), \ 398 .CONCAT2 (NAME,_bfd_link_hash_table_create), \ 399 .CONCAT2 (NAME,_bfd_link_hash_table_free), \ 400 .CONCAT2 (NAME,_bfd_link_add_symbols), \ 401 .CONCAT2 (NAME,_bfd_link_just_syms), \ 402 .CONCAT2 (NAME,_bfd_final_link), \ 403 .CONCAT2 (NAME,_bfd_link_split_section), \ 404 .CONCAT2 (NAME,_bfd_gc_sections), \ 405 .CONCAT2 (NAME,_bfd_merge_sections), \ 406 .CONCAT2 (NAME,_bfd_discard_group) 407 . int (*_bfd_sizeof_headers) PARAMS ((bfd *, bfd_boolean)); 408 . bfd_byte * (*_bfd_get_relocated_section_contents) 409 . PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, 410 . bfd_byte *, bfd_boolean, struct symbol_cache_entry **)); 411 . 412 . bfd_boolean (*_bfd_relax_section) 413 . PARAMS ((bfd *, struct sec *, struct bfd_link_info *, bfd_boolean *)); 428 414 . 429 415 . {* Create a hash table for the linker. Different backends store 430 416 . different information in this table. *} 431 . struct bfd_link_hash_table *(*_bfd_link_hash_table_create) PARAMS ((bfd *)); 417 . struct bfd_link_hash_table * 418 . (*_bfd_link_hash_table_create) PARAMS ((bfd *)); 419 . 420 . {* Release the memory associated with the linker hash table. *} 421 . void (*_bfd_link_hash_table_free) 422 . PARAMS ((struct bfd_link_hash_table *)); 432 423 . 433 424 . {* Add symbols from this object file into the hash table. *} 434 . boolean (*_bfd_link_add_symbols) PARAMS ((bfd *, struct bfd_link_info *)); 425 . bfd_boolean (*_bfd_link_add_symbols) 426 . PARAMS ((bfd *, struct bfd_link_info *)); 427 . 428 . {* Indicate that we are only retrieving symbol values from this section. *} 429 . void (*_bfd_link_just_syms) 430 . PARAMS ((asection *, struct bfd_link_info *)); 435 431 . 436 432 . {* Do a link based on the link_order structures attached to each 437 433 . section of the BFD. *} 438 . b oolean (*_bfd_final_link) PARAMS ((bfd *, struct bfd_link_info *));434 . bfd_boolean (*_bfd_final_link) PARAMS ((bfd *, struct bfd_link_info *)); 439 435 . 440 436 . {* Should this section be split up into smaller pieces during linking. *} 441 . b oolean (*_bfd_link_split_section) PARAMS ((bfd *, struct sec *));437 . bfd_boolean (*_bfd_link_split_section) PARAMS ((bfd *, struct sec *)); 442 438 . 443 439 . {* Remove sections that are not referenced from the output. *} 444 . boolean (*_bfd_gc_sections) PARAMS ((bfd *, struct bfd_link_info *)); 440 . bfd_boolean (*_bfd_gc_sections) PARAMS ((bfd *, struct bfd_link_info *)); 441 . 442 . {* Attempt to merge SEC_MERGE sections. *} 443 . bfd_boolean (*_bfd_merge_sections) PARAMS ((bfd *, struct bfd_link_info *)); 444 . 445 . {* Discard members of a group. *} 446 . bfd_boolean (*_bfd_discard_group) PARAMS ((bfd *, struct sec *)); 445 447 . 446 448 . {* Routines to handle dynamic symbols and relocs. *} 447 .#define BFD_JUMP_TABLE_DYNAMIC(NAME) \448 .C AT(NAME,_get_dynamic_symtab_upper_bound),\449 .C AT(NAME,_canonicalize_dynamic_symtab),\450 .C AT(NAME,_get_dynamic_reloc_upper_bound),\451 .C AT(NAME,_canonicalize_dynamic_reloc)452 . {* Get the amount of memory required to hold the dynamic symbols. *}453 . long (*_bfd_get_dynamic_symtab_upper_bound) PARAMS ((bfd *));449 .#define BFD_JUMP_TABLE_DYNAMIC(NAME) \ 450 .CONCAT2 (NAME,_get_dynamic_symtab_upper_bound), \ 451 .CONCAT2 (NAME,_canonicalize_dynamic_symtab), \ 452 .CONCAT2 (NAME,_get_dynamic_reloc_upper_bound), \ 453 .CONCAT2 (NAME,_canonicalize_dynamic_reloc) 454 . {* Get the amount of memory required to hold the dynamic symbols. *} 455 . long (*_bfd_get_dynamic_symtab_upper_bound) PARAMS ((bfd *)); 454 456 . {* Read in the dynamic symbols. *} 455 . long (*_bfd_canonicalize_dynamic_symtab)457 . long (*_bfd_canonicalize_dynamic_symtab) 456 458 . PARAMS ((bfd *, struct symbol_cache_entry **)); 457 459 . {* Get the amount of memory required to hold the dynamic relocs. *} 458 . long (*_bfd_get_dynamic_reloc_upper_bound) PARAMS ((bfd *));460 . long (*_bfd_get_dynamic_reloc_upper_bound) PARAMS ((bfd *)); 459 461 . {* Read in the dynamic relocs. *} 460 . long (*_bfd_canonicalize_dynamic_reloc)462 . long (*_bfd_canonicalize_dynamic_reloc) 461 463 . PARAMS ((bfd *, arelent **, struct symbol_cache_entry **)); 462 464 . … … 468 470 to find an alternative output format that is suitable. 469 471 470 . {* Opposite endian version of this target. *} 471 . const struct bfd_target * alternative_target; 472 . 473 474 Data for use by back-end routines, which isn't generic enough to belong 475 in this structure. 476 477 . PTR backend_data; 472 . {* Opposite endian version of this target. *} 473 . const struct bfd_target * alternative_target; 474 . 475 476 . {* Data for use by back-end routines, which isn't 477 . generic enough to belong in this structure. *} 478 . PTR backend_data; 478 479 . 479 480 .} bfd_target; 480 481 . 481 482 */ 482 483 … … 487 488 extern const bfd_target a29kcoff_big_vec; 488 489 extern const bfd_target a_out_adobe_vec; 490 extern const bfd_target aix5coff64_vec; 489 491 extern const bfd_target aout0_big_vec; 490 492 extern const bfd_target aout_arm_big_vec; … … 517 519 extern const bfd_target bfd_elf32_d10v_vec; 518 520 extern const bfd_target bfd_elf32_d30v_vec; 521 extern const bfd_target bfd_elf32_dlx_big_vec; 519 522 extern const bfd_target bfd_elf32_fr30_vec; 523 extern const bfd_target bfd_elf32_frv_vec; 524 extern const bfd_target bfd_elf32_h8300_vec; 520 525 extern const bfd_target bfd_elf32_hppa_linux_vec; 521 526 extern const bfd_target bfd_elf32_hppa_vec; 522 527 extern const bfd_target bfd_elf32_i370_vec; 528 extern const bfd_target bfd_elf32_i386_freebsd_vec; 523 529 extern const bfd_target bfd_elf32_i386_vec; 524 530 extern const bfd_target bfd_elf32_i860_little_vec; … … 526 532 extern const bfd_target bfd_elf32_i960_vec; 527 533 extern const bfd_target bfd_elf32_ia64_big_vec; 534 extern const bfd_target bfd_elf32_ia64_hpux_big_vec; 535 extern const bfd_target bfd_elf32_ip2k_vec; 536 extern const bfd_target bfd_elf32_iq2000_vec; 528 537 extern const bfd_target bfd_elf32_little_generic_vec; 529 538 extern const bfd_target bfd_elf32_littlearc_vec; … … 540 549 extern const bfd_target bfd_elf32_mn10200_vec; 541 550 extern const bfd_target bfd_elf32_mn10300_vec; 551 extern const bfd_target bfd_elf32_msp430_vec; 552 extern const bfd_target bfd_elf32_nbigmips_vec; 553 extern const bfd_target bfd_elf32_nlittlemips_vec; 554 extern const bfd_target bfd_elf32_ntradbigmips_vec; 555 extern const bfd_target bfd_elf32_ntradlittlemips_vec; 556 extern const bfd_target bfd_elf32_openrisc_vec; 557 extern const bfd_target bfd_elf32_or32_big_vec; 542 558 extern const bfd_target bfd_elf32_pj_vec; 543 559 extern const bfd_target bfd_elf32_pjl_vec; 544 560 extern const bfd_target bfd_elf32_powerpc_vec; 545 561 extern const bfd_target bfd_elf32_powerpcle_vec; 562 extern const bfd_target bfd_elf32_s390_vec; 563 extern const bfd_target bfd_elf32_sh64_vec; 564 extern const bfd_target bfd_elf32_sh64l_vec; 565 extern const bfd_target bfd_elf32_sh64lin_vec; 566 extern const bfd_target bfd_elf32_sh64blin_vec; 567 extern const bfd_target bfd_elf32_sh64lnbsd_vec; 568 extern const bfd_target bfd_elf32_sh64nbsd_vec; 546 569 extern const bfd_target bfd_elf32_sh_vec; 547 570 extern const bfd_target bfd_elf32_shblin_vec; 548 571 extern const bfd_target bfd_elf32_shl_vec; 549 572 extern const bfd_target bfd_elf32_shlin_vec; 573 extern const bfd_target bfd_elf32_shlnbsd_vec; 574 extern const bfd_target bfd_elf32_shnbsd_vec; 550 575 extern const bfd_target bfd_elf32_sparc_vec; 551 576 extern const bfd_target bfd_elf32_tradbigmips_vec; … … 553 578 extern const bfd_target bfd_elf32_us_cris_vec; 554 579 extern const bfd_target bfd_elf32_v850_vec; 580 extern const bfd_target bfd_elf32_vax_vec; 581 extern const bfd_target bfd_elf32_xstormy16_vec; 582 extern const bfd_target bfd_elf32_xtensa_be_vec; 583 extern const bfd_target bfd_elf32_xtensa_le_vec; 584 extern const bfd_target bfd_elf64_alpha_freebsd_vec; 555 585 extern const bfd_target bfd_elf64_alpha_vec; 556 586 extern const bfd_target bfd_elf64_big_generic_vec; … … 558 588 extern const bfd_target bfd_elf64_hppa_linux_vec; 559 589 extern const bfd_target bfd_elf64_hppa_vec; 590 extern const bfd_target bfd_elf64_ia64_aix_big_vec; 591 extern const bfd_target bfd_elf64_ia64_aix_little_vec; 560 592 extern const bfd_target bfd_elf64_ia64_big_vec; 593 extern const bfd_target bfd_elf64_ia64_hpux_big_vec; 561 594 extern const bfd_target bfd_elf64_ia64_little_vec; 562 595 extern const bfd_target bfd_elf64_little_generic_vec; 563 596 extern const bfd_target bfd_elf64_littlemips_vec; 597 extern const bfd_target bfd_elf64_mmix_vec; 598 extern const bfd_target bfd_elf64_powerpc_vec; 599 extern const bfd_target bfd_elf64_powerpcle_vec; 600 extern const bfd_target bfd_elf64_s390_vec; 601 extern const bfd_target bfd_elf64_sh64_vec; 602 extern const bfd_target bfd_elf64_sh64l_vec; 603 extern const bfd_target bfd_elf64_sh64lin_vec; 604 extern const bfd_target bfd_elf64_sh64blin_vec; 605 extern const bfd_target bfd_elf64_sh64lnbsd_vec; 606 extern const bfd_target bfd_elf64_sh64nbsd_vec; 607 extern const bfd_target bfd_elf64_sparc_vec; 564 608 extern const bfd_target bfd_elf64_tradbigmips_vec; 565 609 extern const bfd_target bfd_elf64_tradlittlemips_vec; 566 extern const bfd_target bfd_elf64_sparc_vec;567 610 extern const bfd_target bfd_elf64_x86_64_vec; 611 extern const bfd_target bfd_mmo_vec; 568 612 extern const bfd_target bfd_powerpc_pe_vec; 569 613 extern const bfd_target bfd_powerpc_pei_vec; … … 612 656 extern const bfd_target m88kbcs_vec; 613 657 extern const bfd_target m88kmach3_vec; 658 extern const bfd_target mach_o_be_vec; 659 extern const bfd_target mach_o_le_vec; 660 extern const bfd_target mach_o_fat_vec; 614 661 extern const bfd_target mcore_pe_big_vec; 615 662 extern const bfd_target mcore_pe_little_vec; … … 624 671 extern const bfd_target nlm32_sparc_vec; 625 672 extern const bfd_target oasys_vec; 673 extern const bfd_target or32coff_big_vec; 626 674 extern const bfd_target pc532machaout_vec; 627 675 extern const bfd_target pc532netbsd_vec; 676 extern const bfd_target pdp11_aout_vec; 677 extern const bfd_target pef_vec; 678 extern const bfd_target pef_xlib_vec; 628 679 extern const bfd_target pmac_xcoff_vec; 629 680 extern const bfd_target ppcboot_vec; … … 645 696 extern const bfd_target sparcnetbsd_vec; 646 697 extern const bfd_target sunos_big_vec; 647 extern const bfd_target tekhex_vec;698 extern const bfd_target sym_vec; 648 699 extern const bfd_target tic30_aout_vec; 649 700 extern const bfd_target tic30_coff_vec; 701 extern const bfd_target tic4x_coff0_beh_vec; 702 extern const bfd_target tic4x_coff0_vec; 703 extern const bfd_target tic4x_coff1_beh_vec; 704 extern const bfd_target tic4x_coff1_vec; 705 extern const bfd_target tic4x_coff2_beh_vec; 706 extern const bfd_target tic4x_coff2_vec; 650 707 extern const bfd_target tic54x_coff0_beh_vec; 651 708 extern const bfd_target tic54x_coff0_vec; … … 655 712 extern const bfd_target tic54x_coff2_vec; 656 713 extern const bfd_target tic80coff_vec; 714 extern const bfd_target vaxbsd_vec; 657 715 extern const bfd_target vaxnetbsd_vec; 716 extern const bfd_target vax1knetbsd_vec; 658 717 extern const bfd_target versados_vec; 659 718 extern const bfd_target vms_alpha_vec; … … 663 722 extern const bfd_target z8kcoff_vec; 664 723 665 /* srec isalways included. */724 /* These are always included. */ 666 725 extern const bfd_target srec_vec; 667 726 extern const bfd_target symbolsrec_vec; 668 669 /* binary is always included. */ 727 extern const bfd_target tekhex_vec; 670 728 extern const bfd_target binary_vec; 671 672 /* ihex is always included. */673 729 extern const bfd_target ihex_vec; 674 730 … … 677 733 extern const bfd_target cisco_core_big_vec; 678 734 extern const bfd_target cisco_core_little_vec; 735 extern const bfd_target hppabsd_core_vec; 679 736 extern const bfd_target hpux_core_vec; 680 extern const bfd_target hppabsd_core_vec;681 737 extern const bfd_target irix_core_vec; 682 738 extern const bfd_target netbsd_core_vec; 683 739 extern const bfd_target osf_core_vec; 740 extern const bfd_target ptrace_core_vec; 684 741 extern const bfd_target sco5_core_vec; 685 742 extern const bfd_target trad_core_vec; 686 extern const bfd_target ptrace_core_vec;687 743 688 744 static const bfd_target * const _bfd_target_vector[] = { … … 705 761 &a29kcoff_big_vec, 706 762 &a_out_adobe_vec, 707 #if 0 /* No one seems to use this. */ 763 #ifdef BFD64 764 &aix5coff64_vec, 765 #endif 766 &aout0_big_vec, 767 #if 0 768 /* We have no way of distinguishing these from other a.out variants. */ 769 &aout_arm_big_vec, 770 &aout_arm_little_vec, 771 /* No one seems to use this. */ 708 772 &aout_mips_big_vec, 709 773 #endif 710 774 &aout_mips_little_vec, 775 #if 0 776 &apollocoff_vec, 777 #endif 778 &arm_epoc_pe_big_vec, 779 &arm_epoc_pe_little_vec, 780 &arm_epoc_pei_big_vec, 781 &arm_epoc_pei_little_vec, 782 &armcoff_big_vec, 783 &armcoff_little_vec, 784 &armnetbsd_vec, 785 &armpe_big_vec, 786 &armpe_little_vec, 787 &armpei_big_vec, 788 &armpei_little_vec, 711 789 &b_out_vec_big_host, 712 790 &b_out_vec_little_host, 713 714 791 &bfd_efi_app_ia32_vec, 715 792 #ifdef BFD64 716 793 &bfd_efi_app_ia64_vec, 717 794 #endif 795 &bfd_elf32_avr_vec, 718 796 719 797 /* This, and other vectors, may not be used in any *.mt configuration. … … 722 800 the file even if we don't recognize the machine type. */ 723 801 &bfd_elf32_big_generic_vec, 724 #ifdef BFD64725 &bfd_elf64_alpha_vec,726 &bfd_elf64_hppa_vec,727 &bfd_elf64_hppa_linux_vec,728 &bfd_elf64_ia64_little_vec,729 &bfd_elf64_ia64_big_vec,730 #endif731 &bfd_elf32_avr_vec,732 802 &bfd_elf32_bigarc_vec, 733 &bfd_elf32_bigarm_vec,734 &bfd_elf32_bigarm_oabi_vec,803 &bfd_elf32_bigarm_oabi_vec, 804 &bfd_elf32_bigarm_vec, 735 805 &bfd_elf32_bigmips_vec, 736 #ifdef BFD64737 &bfd_elf64_bigmips_vec,738 #endif739 806 &bfd_elf32_cris_vec, 740 &bfd_elf32_us_cris_vec,741 807 &bfd_elf32_d10v_vec, 742 808 &bfd_elf32_d30v_vec, 809 &bfd_elf32_dlx_big_vec, 810 &bfd_elf32_fr30_vec, 811 &bfd_elf32_frv_vec, 812 &bfd_elf32_h8300_vec, 813 &bfd_elf32_hppa_linux_vec, 743 814 &bfd_elf32_hppa_vec, 744 &bfd_elf32_hppa_linux_vec,745 815 &bfd_elf32_i370_vec, 816 &bfd_elf32_i386_freebsd_vec, 746 817 &bfd_elf32_i386_vec, 747 #ifdef BFD64 748 &bfd_elf64_x86_64_vec, 749 #endif 818 &bfd_elf32_i860_little_vec, 750 819 &bfd_elf32_i860_vec, 751 &bfd_elf32_i860_little_vec,752 820 &bfd_elf32_i960_vec, 821 #if 0 822 &bfd_elf32_ia64_big_vec, 823 #endif 824 &bfd_elf32_ia64_hpux_big_vec, 825 &bfd_elf32_ip2k_vec, 826 &bfd_elf32_iq2000_vec, 753 827 &bfd_elf32_little_generic_vec, 754 828 &bfd_elf32_littlearc_vec, 755 &bfd_elf32_littlearm_vec,756 &bfd_elf32_littlearm_oabi_vec,829 &bfd_elf32_littlearm_oabi_vec, 830 &bfd_elf32_littlearm_vec, 757 831 &bfd_elf32_littlemips_vec, 758 #ifdef BFD64759 &bfd_elf64_littlemips_vec,760 #endif761 832 &bfd_elf32_m32r_vec, 762 &bfd_elf32_mn10200_vec,763 &bfd_elf32_mn10300_vec,764 833 &bfd_elf32_m68hc11_vec, 765 834 &bfd_elf32_m68hc12_vec, 766 835 &bfd_elf32_m68k_vec, 767 836 &bfd_elf32_m88k_vec, 837 &bfd_elf32_mcore_big_vec, 838 &bfd_elf32_mcore_little_vec, 839 &bfd_elf32_mn10200_vec, 840 &bfd_elf32_mn10300_vec, 841 &bfd_elf32_msp430_vec, 842 #ifdef BFD64 843 &bfd_elf32_nbigmips_vec, 844 &bfd_elf32_nlittlemips_vec, 845 &bfd_elf32_ntradbigmips_vec, 846 &bfd_elf32_ntradlittlemips_vec, 847 #endif 848 &bfd_elf32_openrisc_vec, 849 &bfd_elf32_or32_big_vec, 768 850 &bfd_elf32_pj_vec, 769 851 &bfd_elf32_pjl_vec, 770 852 &bfd_elf32_powerpc_vec, 771 853 &bfd_elf32_powerpcle_vec, 854 &bfd_elf32_s390_vec, 855 &bfd_elf32_sh_vec, 856 &bfd_elf32_shblin_vec, 857 &bfd_elf32_shl_vec, 858 &bfd_elf32_shlin_vec, 859 &bfd_elf32_shlnbsd_vec, 860 &bfd_elf32_shnbsd_vec, 861 #ifdef BFD64 862 &bfd_elf32_sh64_vec, 863 &bfd_elf32_sh64l_vec, 864 &bfd_elf32_sh64lnbsd_vec, 865 &bfd_elf32_sh64nbsd_vec, 866 &bfd_elf32_sh64lin_vec, 867 &bfd_elf32_sh64blin_vec, 868 #endif 772 869 &bfd_elf32_sparc_vec, 773 &bfd_elf32_v850_vec,774 &bfd_elf32_fr30_vec,775 &bfd_elf32_mcore_big_vec,776 &bfd_elf32_mcore_little_vec,777 870 &bfd_elf32_tradbigmips_vec, 778 871 &bfd_elf32_tradlittlemips_vec, 872 &bfd_elf32_us_cris_vec, 873 &bfd_elf32_v850_vec, 874 &bfd_elf32_vax_vec, 875 &bfd_elf32_xstormy16_vec, 876 &bfd_elf32_xtensa_be_vec, 877 &bfd_elf32_xtensa_le_vec, 779 878 #ifdef BFD64 879 &bfd_elf64_alpha_freebsd_vec, 880 &bfd_elf64_alpha_vec, 881 &bfd_elf64_big_generic_vec, 882 &bfd_elf64_bigmips_vec, 883 &bfd_elf64_hppa_linux_vec, 884 &bfd_elf64_hppa_vec, 885 &bfd_elf64_ia64_aix_big_vec, 886 &bfd_elf64_ia64_aix_little_vec, 887 &bfd_elf64_ia64_big_vec, 888 &bfd_elf64_ia64_hpux_big_vec, 889 &bfd_elf64_ia64_little_vec, 890 &bfd_elf64_little_generic_vec, 891 &bfd_elf64_littlemips_vec, 892 &bfd_elf64_mmix_vec, 893 &bfd_elf64_powerpc_vec, 894 &bfd_elf64_powerpcle_vec, 895 &bfd_elf64_s390_vec, 896 &bfd_elf64_sh64_vec, 897 &bfd_elf64_sh64l_vec, 898 &bfd_elf64_sh64lnbsd_vec, 899 &bfd_elf64_sh64nbsd_vec, 900 &bfd_elf64_sh64lin_vec, 901 &bfd_elf64_sh64blin_vec, 902 #if 0 903 &bfd_elf64_sparc_vec, 904 #endif 780 905 &bfd_elf64_tradbigmips_vec, 781 906 &bfd_elf64_tradlittlemips_vec, 782 /* No one seems to use this. */ 783 &bfd_elf64_big_generic_vec, 784 &bfd_elf64_little_generic_vec, 785 #endif 786 #if 0 787 &bfd_elf64_sparc_vec, 788 #endif 789 /* We don't include cisco_core_*_vec. Although it has a magic number, 790 the magic number isn't at the beginning of the file, and thus 791 might spuriously match other kinds of files. */ 792 793 &cris_aout_vec, 907 &bfd_elf64_x86_64_vec, 908 &bfd_mmo_vec, 909 #endif 910 &bfd_powerpc_pe_vec, 911 &bfd_powerpc_pei_vec, 912 &bfd_powerpcle_pe_vec, 913 &bfd_powerpcle_pei_vec, 914 &cris_aout_vec, 794 915 #ifdef BFD64 795 &demo_64_vec, /* Only compiled if host has long-long support */916 &demo_64_vec, /* Only compiled if host has long-long support. */ 796 917 #endif 797 918 &ecoff_big_vec, 919 &ecoff_biglittle_vec, 798 920 &ecoff_little_vec, 799 &ecoff_biglittle_vec,800 921 #ifdef BFD64 801 922 &ecoffalpha_little_vec, 802 923 #endif 924 &go32coff_vec, 925 &go32stubbedcoff_vec, 803 926 &h8300coff_vec, 804 927 &h8500coff_vec, … … 807 930 which kind of a.out file it is. */ 808 931 &host_aout_vec, 809 #endif 810 #if 0 /* Clashes with sunos_big_vec magic no. */ 932 /* Clashes with sunos_big_vec magic no. */ 811 933 &hp300bsd_vec, 812 934 #endif 813 935 &hp300hpux_vec, 814 #if defined (HOST_HPPAHPUX) || defined (HOST_HPPABSD) || defined (HOST_HPPAOSF)815 &som_vec,816 #endif817 936 &i386aout_vec, 818 937 &i386bsd_vec, 819 938 &i386coff_vec, 939 #if 0 940 &i386dynix_vec, 941 #endif 820 942 &i386freebsd_vec, 821 &i860coff_vec,822 &bfd_powerpc_pe_vec,823 &bfd_powerpcle_pe_vec,824 &bfd_powerpc_pei_vec,825 &bfd_powerpcle_pei_vec,826 &go32coff_vec,827 &go32stubbedcoff_vec,828 943 #if 0 829 944 /* Since a.out files lack decent magic numbers, no way to recognize … … 842 957 &i386pe_vec, 843 958 &i386pei_vec, 844 &armcoff_little_vec, 845 &armcoff_big_vec, 846 &armnetbsd_vec, 847 &armpe_little_vec, 848 &armpe_big_vec, 849 &armpei_little_vec, 850 &armpei_big_vec, 851 &arm_epoc_pe_little_vec, 852 &arm_epoc_pe_big_vec, 853 &arm_epoc_pei_little_vec, 854 &arm_epoc_pei_big_vec, 959 &i860coff_vec, 855 960 &icoff_big_vec, 856 961 &icoff_little_vec, 857 962 &ieee_vec, 963 #if 0 964 &m68k4knetbsd_vec, 965 &m68kaux_coff_vec, 966 #endif 858 967 &m68kcoff_vec, 859 968 &m68kcoffun_vec, … … 869 978 &m88kbcs_vec, 870 979 &m88kmach3_vec, 980 &mach_o_be_vec, 981 &mach_o_le_vec, 982 &mach_o_fat_vec, 871 983 &mcore_pe_big_vec, 872 984 &mcore_pe_little_vec, 873 985 &mcore_pei_big_vec, 874 986 &mcore_pei_little_vec, 987 &mipslpe_vec, 988 &mipslpei_vec, 875 989 &newsos3_vec, 876 &nlm32_i386_vec,877 &nlm32_sparc_vec,878 990 #ifdef BFD64 879 991 &nlm32_alpha_vec, 880 992 #endif 881 &pc532netbsd_vec, 993 &nlm32_i386_vec, 994 &nlm32_powerpc_vec, 995 &nlm32_sparc_vec, 882 996 #if 0 883 997 /* We have no oasys tools anymore, so we can't test any of this … … 888 1002 &oasys_vec, 889 1003 #endif 1004 /* Entry for the OpenRISC family. */ 1005 &or32coff_big_vec, 1006 890 1007 &pc532machaout_vec, 891 #if 0 892 /* We have no way of distinguishing these from other a.out variants */ 893 &aout_arm_big_vec, 894 &aout_arm_little_vec, 895 &riscix_vec, 896 #endif 1008 &pc532netbsd_vec, 1009 &pdp11_aout_vec, 1010 &pef_vec, 1011 &pef_xlib_vec, 897 1012 #if 0 898 1013 /* This has the same magic number as RS/6000. */ 899 1014 &pmac_xcoff_vec, 900 1015 #endif 901 &rs6000coff_vec, 1016 &ppcboot_vec, 1017 #if 0 1018 /* We have no way of distinguishing these from other a.out variants. */ 1019 &riscix_vec, 1020 #endif 902 1021 #ifdef BFD64 903 1022 &rs6000coff64_vec, 904 1023 #endif 905 &ppcboot_vec, 1024 &rs6000coff_vec, 1025 &shcoff_small_vec, 906 1026 &shcoff_vec, 1027 &shlcoff_small_vec, 907 1028 &shlcoff_vec, 908 &shcoff_small_vec, 909 &shlcoff_small_vec, 1029 &shlpe_vec, 1030 &shlpei_vec, 1031 #if defined (HOST_HPPAHPUX) || defined (HOST_HPPABSD) || defined (HOST_HPPAOSF) 1032 &som_vec, 1033 #endif 1034 &sparccoff_vec, 910 1035 &sparcle_aout_vec, 911 1036 &sparclinux_vec, … … 914 1039 &sparcnetbsd_vec, 915 1040 &sunos_big_vec, 916 & aout0_big_vec,1041 &sym_vec, 917 1042 &tic30_aout_vec, 918 1043 &tic30_coff_vec, 1044 &tic54x_coff0_beh_vec, 919 1045 &tic54x_coff0_vec, 920 &tic54x_coff 0_beh_vec,1046 &tic54x_coff1_beh_vec, 921 1047 &tic54x_coff1_vec, 922 &tic54x_coff 1_beh_vec,1048 &tic54x_coff2_beh_vec, 923 1049 &tic54x_coff2_vec, 924 &tic54x_coff2_beh_vec,925 1050 &tic80coff_vec, 1051 &vaxbsd_vec, 926 1052 &vaxnetbsd_vec, 1053 &vax1knetbsd_vec, 927 1054 &versados_vec, 928 1055 #ifdef BFD64 … … 930 1057 #endif 931 1058 &vms_vax_vec, 1059 &w65_vec, 932 1060 &we32kcoff_vec, 933 1061 &z8kcoff_vec, 934 935 1062 #endif /* not SELECT_VECS */ 936 1063 … … 950 1077 &aix386_core_vec, 951 1078 #endif 1079 #if 0 1080 /* We don't include cisco_core_*_vec. Although it has a magic number, 1081 the magic number isn't at the beginning of the file, and thus 1082 might spuriously match other kinds of files. */ 1083 &cisco_core_big_vec, 1084 &cisco_core_little_vec, 1085 #endif 1086 #ifdef HPPABSD_CORE 1087 &hppabsd_core_vec, 1088 #endif 952 1089 #ifdef HPUX_CORE 953 1090 &hpux_core_vec, 954 1091 #endif 955 #ifdef HPPABSD_CORE956 &hppabsd_core_vec,957 #endif958 1092 #ifdef IRIX_CORE 959 1093 &irix_core_vec, … … 965 1099 &osf_core_vec, 966 1100 #endif 1101 #ifdef PTRACE_CORE 1102 &ptrace_core_vec, 1103 #endif 967 1104 #ifdef SCO5_CORE 968 1105 &sco5_core_vec, 969 1106 #endif 970 #ifdef 1107 #ifdef TRAD_CORE 971 1108 &trad_core_vec, 972 #endif973 974 #ifdef PTRACE_CORE975 &ptrace_core_vec,976 1109 #endif 977 1110 … … 989 1122 NULL 990 1123 }; 1124 1125 /* bfd_associated_vector[] contains the associated target vectors used 1126 to reduce the ambiguity in bfd_check_format_matches. */ 1127 1128 static const bfd_target *_bfd_associated_vector[] = { 1129 #ifdef ASSOCIATED_VECS 1130 ASSOCIATED_VECS, 1131 #endif 1132 NULL 1133 }; 1134 const bfd_target * const *bfd_associated_vector = _bfd_associated_vector; 991 1135 992 1136 /* When there is an ambiguous match, bfd_check_format_matches puts the … … 1052 1196 1053 1197 SYNOPSIS 1054 b oolean bfd_set_default_target (const char *name);1198 bfd_boolean bfd_set_default_target (const char *name); 1055 1199 1056 1200 DESCRIPTION … … 1060 1204 */ 1061 1205 1062 b oolean1206 bfd_boolean 1063 1207 bfd_set_default_target (name) 1064 1208 const char *name; … … 1068 1212 if (bfd_default_vector[0] != NULL 1069 1213 && strcmp (name, bfd_default_vector[0]->name) == 0) 1070 return true;1214 return TRUE; 1071 1215 1072 1216 target = find_target (name); 1073 1217 if (target == NULL) 1074 return false;1218 return FALSE; 1075 1219 1076 1220 bfd_default_vector[0] = target; 1077 return true;1221 return TRUE; 1078 1222 } 1079 1223 … … 1083 1227 1084 1228 SYNOPSIS 1085 const bfd_target *bfd_find_target (CONSTchar *target_name, bfd *abfd);1229 const bfd_target *bfd_find_target (const char *target_name, bfd *abfd); 1086 1230 1087 1231 DESCRIPTION … … 1110 1254 targname = getenv ("GNUTARGET"); 1111 1255 1112 /* This is safe; the vector cannot be null */1256 /* This is safe; the vector cannot be null. */ 1113 1257 if (targname == NULL || strcmp (targname, "default") == 0) 1114 1258 { 1115 abfd->target_defaulted = true;1259 abfd->target_defaulted = TRUE; 1116 1260 if (bfd_default_vector[0] != NULL) 1117 1261 abfd->xvec = bfd_default_vector[0]; … … 1121 1265 } 1122 1266 1123 abfd->target_defaulted = false;1267 abfd->target_defaulted = FALSE; 1124 1268 1125 1269 target = find_target (targname); … … 1136 1280 1137 1281 SYNOPSIS 1138 const char ** bfd_target_list(void);1282 const char ** bfd_target_list (void); 1139 1283 1140 1284 DESCRIPTION … … 1149 1293 { 1150 1294 int vec_length= 0; 1295 bfd_size_type amt; 1151 1296 #if defined (HOST_HPPAHPUX) && ! defined (__STDC__) 1152 1297 /* The native compiler on the HP9000/700 has a bug which causes it … … 1154 1299 volatile 1155 1300 #endif 1156 1157 CONSTchar **name_list, **name_ptr;1301 const bfd_target * const *target; 1302 const char **name_list, **name_ptr; 1158 1303 1159 1304 for (target = &bfd_target_vector[0]; *target != NULL; target++) 1160 1305 vec_length++; 1161 1306 1162 name_ptr = name_list = (CONST char **)1163 bfd_zmalloc ((vec_length + 1) * sizeof (char **));1307 amt = (vec_length + 1) * sizeof (char **); 1308 name_ptr = name_list = (const char **) bfd_malloc (amt); 1164 1309 1165 1310 if (name_list == NULL) … … 1167 1312 1168 1313 for (target = &bfd_target_vector[0]; *target != NULL; target++) 1169 *(name_ptr++) = (*target)->name; 1170 1314 if (target == &bfd_target_vector[0] 1315 || *target != bfd_target_vector[0]) 1316 *name_ptr++ = (*target)->name; 1317 1318 *name_ptr = NULL; 1171 1319 return name_list; 1172 1320 } … … 1177 1325 1178 1326 SYNOPSIS 1179 const bfd_target * bfd_search_for_target (int (* search_func) (const bfd_target *, void *), void *); 1327 const bfd_target * bfd_search_for_target (int (* search_func) 1328 (const bfd_target *, void *), 1329 void *); 1180 1330 1181 1331 DESCRIPTION -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.