Changeset 609 for branches/GNU/src/binutils/bfd/ppcboot.c
- Timestamp:
- Aug 16, 2003, 6:59:22 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GNU/src/binutils/bfd/ppcboot.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 1 /* BFD back-end for PPCbug boot records. 2 Copyright 1996, 1997, 1998, 1999, 2000, 2001 2 Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 3 3 Free Software Foundation, Inc. 4 4 Written by Michael Meissner, Cygnus Support, <meissner@cygnus.com> … … 33 33 address to zero by default. */ 34 34 35 #include <ctype.h> 36 35 #include "safe-ctype.h" 37 36 #include "bfd.h" 38 37 #include "sysdep.h" … … 89 88 #define PPCBOOT_SYMS 3 90 89 91 static b oolean ppcboot_mkobject PARAMS ((bfd *));90 static bfd_boolean ppcboot_mkobject PARAMS ((bfd *)); 92 91 static const bfd_target *ppcboot_object_p PARAMS ((bfd *)); 93 static b oolean ppcboot_set_arch_mach92 static bfd_boolean ppcboot_set_arch_mach 94 93 PARAMS ((bfd *, enum bfd_architecture, unsigned long)); 95 static b oolean ppcboot_get_section_contents94 static bfd_boolean ppcboot_get_section_contents 96 95 PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type)); 97 96 static long ppcboot_get_symtab_upper_bound PARAMS ((bfd *)); 98 97 static char *mangle_name PARAMS ((bfd *, char *)); 99 98 static long ppcboot_get_symtab PARAMS ((bfd *, asymbol **)); 100 static asymbol *ppcboot_make_empty_symbol PARAMS ((bfd *));101 99 static void ppcboot_get_symbol_info PARAMS ((bfd *, asymbol *, symbol_info *)); 102 static b oolean ppcboot_set_section_contents100 static bfd_boolean ppcboot_set_section_contents 103 101 PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type)); 104 static int ppcboot_sizeof_headers PARAMS ((bfd *, b oolean));105 static b oolean ppcboot_bfd_print_private_bfd_data PARAMS ((bfd *, PTR));102 static int ppcboot_sizeof_headers PARAMS ((bfd *, bfd_boolean)); 103 static bfd_boolean ppcboot_bfd_print_private_bfd_data PARAMS ((bfd *, PTR)); 106 104 107 105 #define ppcboot_set_tdata(abfd, ptr) ((abfd)->tdata.any = (PTR) (ptr)) … … 111 109 /* Create a ppcboot object. Invoked via bfd_set_format. */ 112 110 113 static b oolean111 static bfd_boolean 114 112 ppcboot_mkobject (abfd) 115 113 bfd *abfd; 116 114 { 117 115 if (!ppcboot_get_tdata (abfd)) 118 ppcboot_set_tdata (abfd, bfd_zalloc (abfd, sizeof (ppcboot_data_t))); 119 120 return true; 116 { 117 bfd_size_type amt = sizeof (ppcboot_data_t); 118 ppcboot_set_tdata (abfd, bfd_zalloc (abfd, amt)); 119 } 120 121 return TRUE; 121 122 } 122 123 … … 124 125 125 126 /* Set the architecture to PowerPC */ 126 static b oolean127 static bfd_boolean 127 128 ppcboot_set_arch_mach (abfd, arch, machine) 128 129 bfd *abfd; … … 134 135 135 136 else if (arch != bfd_arch_powerpc) 136 return false;137 return FALSE; 137 138 138 139 return bfd_default_set_arch_mach (abfd, arch, machine); … … 176 177 } 177 178 178 if (bfd_read ((PTR) &hdr, sizeof (hdr), 1, abfd) != sizeof (hdr)) 179 if (bfd_bread ((PTR) &hdr, (bfd_size_type) sizeof (hdr), abfd) 180 != sizeof (hdr)) 179 181 { 180 182 if (bfd_get_error () != bfd_error_system_call) … … 220 222 memcpy ((PTR) &tdata->header, (PTR) &hdr, sizeof (ppcboot_hdr_t)); 221 223 222 ppcboot_set_arch_mach (abfd, bfd_arch_powerpc, 0 );224 ppcboot_set_arch_mach (abfd, bfd_arch_powerpc, 0L); 223 225 return abfd->xvec; 224 226 } … … 232 234 /* Get contents of the only section. */ 233 235 234 static b oolean236 static bfd_boolean 235 237 ppcboot_get_section_contents (abfd, section, location, offset, count) 236 238 bfd *abfd; … … 240 242 bfd_size_type count; 241 243 { 242 if (bfd_seek (abfd, offset + sizeof (ppcboot_hdr_t), SEEK_SET) != 0243 || bfd_ read (location, 1, count, abfd) != count)244 return false;245 return true;244 if (bfd_seek (abfd, offset + (file_ptr) sizeof (ppcboot_hdr_t), SEEK_SET) != 0 245 || bfd_bread (location, count, abfd) != count) 246 return FALSE; 247 return TRUE; 246 248 } 247 249 … … 266 268 char *suffix; 267 269 { 268 intsize;270 bfd_size_type size; 269 271 char *buf; 270 272 char *p; … … 282 284 /* Change any non-alphanumeric characters to underscores. */ 283 285 for (p = buf; *p; p++) 284 if (! isalnum ((unsigned char)*p))286 if (! ISALNUM (*p)) 285 287 *p = '_'; 286 288 … … 300 302 asymbol *syms; 301 303 unsigned int i; 302 303 syms = (asymbol *) bfd_alloc (abfd, PPCBOOT_SYMS * sizeof (asymbol)); 304 bfd_size_type amt = PPCBOOT_SYMS * sizeof (asymbol); 305 306 syms = (asymbol *) bfd_alloc (abfd, amt); 304 307 if (syms == NULL) 305 return false;308 return FALSE; 306 309 307 310 /* Start symbol. */ … … 336 339 } 337 340 338 339 340 /* Make an empty symbol. */ 341 342 static asymbol * 343 ppcboot_make_empty_symbol (abfd) 344 bfd *abfd; 345 { 346 return (asymbol *) bfd_alloc (abfd, sizeof (asymbol)); 347 } 348 349 350 341 #define ppcboot_make_empty_symbol _bfd_generic_make_empty_symbol 351 342 #define ppcboot_print_symbol _bfd_nosymbols_print_symbol 352 343 … … 378 369 /* Write section contents of a ppcboot file. */ 379 370 380 static b oolean371 static bfd_boolean 381 372 ppcboot_set_section_contents (abfd, sec, data, offset, size) 382 373 bfd *abfd; … … 402 393 s->filepos = s->vma - low; 403 394 404 abfd->output_has_begun = true;395 abfd->output_has_begun = TRUE; 405 396 } 406 397 … … 413 404 ppcboot_sizeof_headers (abfd, exec) 414 405 bfd *abfd ATTRIBUTE_UNUSED; 415 b oolean exec ATTRIBUTE_UNUSED;406 bfd_boolean exec ATTRIBUTE_UNUSED; 416 407 { 417 408 return sizeof (ppcboot_hdr_t); … … 422 413 /* Print out the program headers. */ 423 414 424 static b oolean415 static bfd_boolean 425 416 ppcboot_bfd_print_private_bfd_data (abfd, farg) 426 417 bfd *abfd; … … 480 471 481 472 fprintf (f, "\n"); 482 return true;473 return TRUE; 483 474 } 484 475 … … 489 480 #define ppcboot_bfd_relax_section bfd_generic_relax_section 490 481 #define ppcboot_bfd_gc_sections bfd_generic_gc_sections 482 #define ppcboot_bfd_merge_sections bfd_generic_merge_sections 483 #define ppcboot_bfd_discard_group bfd_generic_discard_group 491 484 #define ppcboot_bfd_link_hash_table_create _bfd_generic_link_hash_table_create 485 #define ppcboot_bfd_link_hash_table_free _bfd_generic_link_hash_table_free 492 486 #define ppcboot_bfd_link_add_symbols _bfd_generic_link_add_symbols 487 #define ppcboot_bfd_link_just_syms _bfd_generic_link_just_syms 493 488 #define ppcboot_bfd_final_link _bfd_generic_final_link 494 489 #define ppcboot_bfd_link_split_section _bfd_generic_link_split_section -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.