Changeset 609 for branches/GNU/src/binutils/bfd/coff-i960.c
- Timestamp:
- Aug 16, 2003, 6:59:22 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GNU/src/binutils/bfd/coff-i960.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 1 /* BFD back-end for Intel 960 COFF files. 2 Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1997, 1999, 2000 3 Free Software Foundation, Inc.2 Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1997, 1999, 2000, 2001, 3 2002 Free Software Foundation, Inc. 4 4 Written by Cygnus Support. 5 5 … … 30 30 #include "libcoff.h" /* to allow easier abstraction-breaking */ 31 31 32 static boolean coff_i960_is_local_label_name PARAMS ((bfd *, const char *)); 32 static bfd_boolean coff_i960_is_local_label_name 33 PARAMS ((bfd *, const char *)); 33 34 static bfd_reloc_status_type optcall_callback 34 35 PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); … … 37 38 static reloc_howto_type *coff_i960_reloc_type_lookup 38 39 PARAMS ((bfd *, bfd_reloc_code_real_type)); 39 static b oolean coff_i960_start_final_link40 static bfd_boolean coff_i960_start_final_link 40 41 PARAMS ((bfd *, struct bfd_link_info *)); 41 static b oolean coff_i960_relocate_section42 static bfd_boolean coff_i960_relocate_section 42 43 PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, 43 44 struct internal_reloc *, struct internal_syment *, asection **)); 44 static b oolean coff_i960_adjust_symndx45 static bfd_boolean coff_i960_adjust_symndx 45 46 PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, 46 struct internal_reloc *, b oolean *));47 struct internal_reloc *, bfd_boolean *)); 47 48 48 49 #define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (3) 49 50 #define COFF_ALIGN_IN_SECTION_HEADER 1 50 51 51 #define GET_SCNHDR_ALIGN bfd_h_get_3252 #define PUT_SCNHDR_ALIGN bfd_h_put_3252 #define GET_SCNHDR_ALIGN H_GET_32 53 #define PUT_SCNHDR_ALIGN H_PUT_32 53 54 54 55 /* The i960 does not support an MMU, so COFF_PAGE_SIZE can be … … 60 61 /* This set of local label names is taken from gas. */ 61 62 62 static b oolean63 static bfd_boolean 63 64 coff_i960_is_local_label_name (abfd, name) 64 65 bfd *abfd ATTRIBUTE_UNUSED; … … 157 158 is the offset of the bal entry point. */ 158 159 word = ((word + olf) & BAL_MASK) | BAL; 159 bfd_put_32 (abfd, word, (bfd_byte *) data + reloc_entry->address); 160 bfd_put_32 (abfd, (bfd_vma) word, 161 (bfd_byte *) data + reloc_entry->address); 160 162 } 161 163 result = bfd_reloc_ok; … … 252 254 if (coff_section_data (output_bfd, osec) == NULL) 253 255 { 254 osec->used_by_bfd = 255 ((PTR) bfd_zalloc (abfd, 256 sizeof (struct coff_section_tdata))); 256 bfd_size_type amt = sizeof (struct coff_section_tdata); 257 osec->used_by_bfd = (PTR) bfd_zalloc (abfd, amt); 257 258 if (osec->used_by_bfd == NULL) 258 259 return bfd_reloc_overflow; … … 267 268 268 269 static reloc_howto_type howto_rellong = 269 HOWTO ((unsigned int) R_RELLONG, 0, 2, 32, false, 0,270 complain_overflow_bitfield, coff_i960_relocate,"rellong", true,270 HOWTO ((unsigned int) R_RELLONG, 0, 2, 32,FALSE, 0, 271 complain_overflow_bitfield, coff_i960_relocate,"rellong", TRUE, 271 272 0xffffffff, 0xffffffff, 0); 272 273 static reloc_howto_type howto_iprmed = 273 HOWTO (R_IPRMED, 0, 2, 24, true,0, complain_overflow_signed,274 coff_i960_relocate, "iprmed ", true, 0x00ffffff, 0x00ffffff, 0);274 HOWTO (R_IPRMED, 0, 2, 24,TRUE,0, complain_overflow_signed, 275 coff_i960_relocate, "iprmed ", TRUE, 0x00ffffff, 0x00ffffff, 0); 275 276 static reloc_howto_type howto_optcall = 276 HOWTO (R_OPTCALL, 0,2,24, true,0, complain_overflow_signed,277 optcall_callback, "optcall", true, 0x00ffffff, 0x00ffffff, 0);277 HOWTO (R_OPTCALL, 0,2,24,TRUE,0, complain_overflow_signed, 278 optcall_callback, "optcall", TRUE, 0x00ffffff, 0x00ffffff, 0); 278 279 279 280 static reloc_howto_type * … … 319 320 necessary symbols. */ 320 321 321 static b oolean322 static bfd_boolean 322 323 coff_i960_start_final_link (abfd, info) 323 324 bfd *abfd; … … 329 330 330 331 if (! info->relocateable) 331 return true;332 return TRUE; 332 333 333 334 esym = (bfd_byte *) bfd_malloc (symesz); 334 335 if (esym == NULL) 335 return false;336 return FALSE; 336 337 337 338 if (bfd_seek (abfd, obj_sym_filepos (abfd), SEEK_SET) != 0) 338 return false;339 return FALSE; 339 340 340 341 for (o = abfd->sections; o != NULL; o = o->next) … … 351 352 bfd_coff_swap_sym_out (abfd, (PTR) &isym, (PTR) esym); 352 353 353 if (bfd_ write (esym, symesz, 1, abfd) != symesz)354 if (bfd_bwrite (esym, symesz, abfd) != symesz) 354 355 { 355 356 free (esym); 356 return false;357 return FALSE; 357 358 } 358 359 … … 362 363 free (esym); 363 364 364 return true;365 return TRUE; 365 366 } 366 367 367 368 /* The reloc processing routine for the optimized COFF linker. */ 368 369 369 static b oolean370 static bfd_boolean 370 371 coff_i960_relocate_section (output_bfd, info, input_bfd, input_section, 371 372 contents, relocs, syms, sections) … … 393 394 reloc_howto_type *howto; 394 395 bfd_reloc_status_type rstat = bfd_reloc_ok; 395 b oolean done;396 bfd_boolean done; 396 397 397 398 symndx = rel->r_symndx; … … 420 421 default: 421 422 bfd_set_error (bfd_error_bad_value); 422 return false;423 return FALSE; 423 424 } 424 425 … … 459 460 if (! ((*info->callbacks->undefined_symbol) 460 461 (info, h->root.root.string, input_bfd, input_section, 461 rel->r_vaddr - input_section->vma, true)))462 return false;462 rel->r_vaddr - input_section->vma, TRUE))) 463 return FALSE; 463 464 } 464 465 } 465 466 466 done = false;467 done = FALSE; 467 468 468 469 if (howto->type == R_OPTCALL && ! info->relocateable && symndx != -1) … … 486 487 input_bfd, input_section, 487 488 rel->r_vaddr - input_section->vma))) 488 return false;489 return FALSE; 489 490 break; 490 491 case C_LEAFSTAT: … … 520 521 word = ((word + olf - val) & BAL_MASK) | BAL; 521 522 bfd_put_32 (input_bfd, 522 word, 523 (contents 524 + (rel->r_vaddr - input_section->vma))); 525 done = true; 523 (bfd_vma) word, 524 contents + (rel->r_vaddr - input_section->vma)); 525 done = TRUE; 526 526 } 527 527 break; … … 561 561 name = _bfd_coff_internal_syment_name (input_bfd, sym, buf); 562 562 if (name == NULL) 563 return false;563 return FALSE; 564 564 } 565 565 … … 567 567 (info, name, howto->name, (bfd_vma) 0, input_bfd, 568 568 input_section, rel->r_vaddr - input_section->vma))) 569 return false;569 return FALSE; 570 570 } 571 571 } 572 572 } 573 573 574 return true;574 return TRUE; 575 575 } 576 576 … … 579 579 for the section. */ 580 580 581 static b oolean581 static bfd_boolean 582 582 coff_i960_adjust_symndx (obfd, info, ibfd, sec, irel, adjustedp) 583 583 bfd *obfd ATTRIBUTE_UNUSED; … … 586 586 asection *sec ATTRIBUTE_UNUSED; 587 587 struct internal_reloc *irel; 588 b oolean *adjustedp;588 bfd_boolean *adjustedp; 589 589 { 590 590 struct coff_link_hash_entry *h; 591 591 592 *adjustedp = false;592 *adjustedp = FALSE; 593 593 594 594 h = obj_coff_sym_hashes (ibfd)[irel->r_symndx]; … … 596 596 || (h->root.type != bfd_link_hash_defined 597 597 && h->root.type != bfd_link_hash_defweak)) 598 return true;598 return TRUE; 599 599 600 600 irel->r_symndx = h->root.u.def.section->output_section->target_index - 1; 601 *adjustedp = true;602 603 return true;601 *adjustedp = TRUE; 602 603 return TRUE; 604 604 } 605 605 -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.