Changeset 609 for branches/GNU/src/binutils/bfd/coff-m68k.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-m68k.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 1 /* BFD back-end for Motorola 68000 COFF binaries. 2 Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1999, 2000 2 Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1999, 3 2000, 2001, 2002 3 4 Free Software Foundation, Inc. 4 5 Written by Cygnus Support. … … 67 68 #endif 68 69 69 static boolean m68k_coff_is_local_label_name PARAMS ((bfd *, const char *)); 70 static bfd_boolean m68k_coff_is_local_label_name 71 PARAMS ((bfd *, const char *)); 70 72 71 73 /* On the delta, a symbol starting with L% is local. We won't see … … 73 75 consider it local here. */ 74 76 75 static b oolean77 static bfd_boolean 76 78 m68k_coff_is_local_label_name (abfd, name) 77 79 bfd *abfd; … … 79 81 { 80 82 if (name[0] == 'L' && name[1] == '%') 81 return true;83 return TRUE; 82 84 83 85 return _bfd_coff_is_local_label_name (abfd, name); … … 99 101 #endif 100 102 reloc_howto_type m68kcoff_howto_table[] = 101 {102 HOWTO(R_RELBYTE, 0, 0, 8, false, 0, complain_overflow_bitfield, RELOC_SPECIAL_FN, "8", true, 0x000000ff,0x000000ff, false),103 HOWTO(R_RELWORD, 0, 1, 16, false, 0, complain_overflow_bitfield, RELOC_SPECIAL_FN, "16", true, 0x0000ffff,0x0000ffff, false),104 HOWTO(R_RELLONG, 0, 2, 32, false, 0, complain_overflow_bitfield, RELOC_SPECIAL_FN, "32", true, 0xffffffff,0xffffffff, false),105 HOWTO(R_PCRBYTE, 0, 0, 8, true, 0, complain_overflow_signed, RELOC_SPECIAL_FN, "DISP8", true, 0x000000ff,0x000000ff, false),106 HOWTO(R_PCRWORD, 0, 1, 16, true, 0, complain_overflow_signed, RELOC_SPECIAL_FN, "DISP16", true, 0x0000ffff,0x0000ffff, false),107 HOWTO(R_PCRLONG, 0, 2, 32, true, 0, complain_overflow_signed, RELOC_SPECIAL_FN, "DISP32", true, 0xffffffff,0xffffffff, false),108 HOWTO(R_RELLONG_NEG, 0, -2, 32, false, 0, complain_overflow_bitfield, RELOC_SPECIAL_FN, "-32", true, 0xffffffff,0xffffffff, false),109 };103 { 104 HOWTO (R_RELBYTE, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, RELOC_SPECIAL_FN, "8", TRUE, 0x000000ff,0x000000ff, FALSE), 105 HOWTO (R_RELWORD, 0, 1, 16, FALSE, 0, complain_overflow_bitfield, RELOC_SPECIAL_FN, "16", TRUE, 0x0000ffff,0x0000ffff, FALSE), 106 HOWTO (R_RELLONG, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, RELOC_SPECIAL_FN, "32", TRUE, 0xffffffff,0xffffffff, FALSE), 107 HOWTO (R_PCRBYTE, 0, 0, 8, TRUE, 0, complain_overflow_signed, RELOC_SPECIAL_FN, "DISP8", TRUE, 0x000000ff,0x000000ff, FALSE), 108 HOWTO (R_PCRWORD, 0, 1, 16, TRUE, 0, complain_overflow_signed, RELOC_SPECIAL_FN, "DISP16", TRUE, 0x0000ffff,0x0000ffff, FALSE), 109 HOWTO (R_PCRLONG, 0, 2, 32, TRUE, 0, complain_overflow_signed, RELOC_SPECIAL_FN, "DISP32", TRUE, 0xffffffff,0xffffffff, FALSE), 110 HOWTO (R_RELLONG_NEG, 0, -2, 32, FALSE, 0, complain_overflow_bitfield, RELOC_SPECIAL_FN, "-32", TRUE, 0xffffffff,0xffffffff, FALSE), 111 }; 110 112 #endif /* not ONLY_DECLARE_RELOCS */ 111 113 … … 123 125 PARAMS ((bfd *, bfd_reloc_code_real_type)); 124 126 #else 127 125 128 #ifdef STATIC_RELOCS 126 static 127 #endif 128 void 129 #define STAT_REL static 130 #else 131 #define STAT_REL 132 #endif 133 134 STAT_REL reloc_howto_type * m68k_reloc_type_lookup PARAMS ((bfd *, bfd_reloc_code_real_type)); 135 STAT_REL int m68k_howto2rtype PARAMS ((reloc_howto_type *)); 136 STAT_REL void m68k_rtype2howto PARAMS ((arelent *, int)); 137 138 139 STAT_REL void 129 140 m68k_rtype2howto(internal, relocentry) 130 141 arelent *internal; … … 132 143 { 133 144 switch (relocentry) 134 { 135 case R_RELBYTE: internal->howto = m68kcoff_howto_table + 0; break; 136 case R_RELWORD: internal->howto = m68kcoff_howto_table + 1; break; 137 case R_RELLONG: internal->howto = m68kcoff_howto_table + 2; break; 138 case R_PCRBYTE: internal->howto = m68kcoff_howto_table + 3; break; 139 case R_PCRWORD: internal->howto = m68kcoff_howto_table + 4; break; 140 case R_PCRLONG: internal->howto = m68kcoff_howto_table + 5; break; 141 case R_RELLONG_NEG: internal->howto = m68kcoff_howto_table + 6; break; 142 } 143 } 144 145 #ifdef STATIC_RELOCS 146 static 147 #endif 148 int 145 { 146 case R_RELBYTE: internal->howto = m68kcoff_howto_table + 0; break; 147 case R_RELWORD: internal->howto = m68kcoff_howto_table + 1; break; 148 case R_RELLONG: internal->howto = m68kcoff_howto_table + 2; break; 149 case R_PCRBYTE: internal->howto = m68kcoff_howto_table + 3; break; 150 case R_PCRWORD: internal->howto = m68kcoff_howto_table + 4; break; 151 case R_PCRLONG: internal->howto = m68kcoff_howto_table + 5; break; 152 case R_RELLONG_NEG: internal->howto = m68kcoff_howto_table + 6; break; 153 } 154 } 155 156 STAT_REL int 149 157 m68k_howto2rtype (internal) 150 158 reloc_howto_type *internal; 151 159 { 152 160 if (internal->pc_relative) 153 {154 switch (internal->bitsize)155 156 157 158 159 160 }161 { 162 switch (internal->bitsize) 163 { 164 case 32: return R_PCRLONG; 165 case 16: return R_PCRWORD; 166 case 8: return R_PCRBYTE; 167 } 168 } 161 169 else 162 {163 switch (internal->bitsize)164 165 166 167 168 169 }170 { 171 switch (internal->bitsize) 172 { 173 case 32: return R_RELLONG; 174 case 16: return R_RELWORD; 175 case 8: return R_RELBYTE; 176 } 177 } 170 178 return R_RELLONG; 171 179 } 172 180 173 #ifdef STATIC_RELOCS 174 static 175 #endif 176 reloc_howto_type * 181 STAT_REL reloc_howto_type * 177 182 m68k_reloc_type_lookup (abfd, code) 178 183 bfd *abfd ATTRIBUTE_UNUSED; … … 314 319 short x = bfd_get_16 (abfd, addr); 315 320 DOIT (x); 316 bfd_put_16 (abfd, x, addr);321 bfd_put_16 (abfd, (bfd_vma) x, addr); 317 322 } 318 323 break; … … 322 327 long x = bfd_get_32 (abfd, addr); 323 328 DOIT (x); 324 bfd_put_32 (abfd, x, addr);329 bfd_put_32 (abfd, (bfd_vma) x, addr); 325 330 } 326 331 break; … … 428 433 objects, and before the final_link entry point is called. */ 429 434 430 b oolean435 bfd_boolean 431 436 bfd_m68k_coff_create_embedded_relocs (abfd, info, datasec, relsec, errmsg) 432 437 bfd *abfd; … … 440 445 struct internal_reloc *irel, *irelend; 441 446 bfd_byte *p; 447 bfd_size_type amt; 442 448 443 449 BFD_ASSERT (! info->relocateable); … … 446 452 447 453 if (datasec->reloc_count == 0) 448 return true;454 return TRUE; 449 455 450 456 extsyms = obj_coff_external_syms (abfd); 451 457 symesz = bfd_coff_symesz (abfd); 452 458 453 irel = _bfd_coff_read_internal_relocs (abfd, datasec, true, NULL, false,459 irel = _bfd_coff_read_internal_relocs (abfd, datasec, TRUE, NULL, FALSE, 454 460 NULL); 455 461 irelend = irel + datasec->reloc_count; 456 462 457 relsec->contents = (bfd_byte *) bfd_alloc (abfd, datasec->reloc_count * 12); 463 amt = (bfd_size_type) datasec->reloc_count * 12; 464 relsec->contents = (bfd_byte *) bfd_alloc (abfd, amt); 458 465 if (relsec->contents == NULL) 459 return false;466 return FALSE; 460 467 461 468 p = relsec->contents; … … 476 483 *errmsg = _("unsupported reloc type"); 477 484 bfd_set_error (bfd_error_bad_value); 478 return false;485 return FALSE; 479 486 } 480 487 … … 508 515 } 509 516 510 return true;517 return TRUE; 511 518 } 512 519 #endif /* neither ONLY_DECLARE_RELOCS not STATIC_RELOCS */ -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.