Ignore:
Timestamp:
Aug 16, 2003, 6:59:22 PM (22 years ago)
Author:
bird
Message:

binutils v2.14 - offical sources.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/GNU/src/binutils/bfd/coff-m68k.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r608 r609  
    11/* 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
    34   Free Software Foundation, Inc.
    45   Written by Cygnus Support.
     
    6768#endif
    6869
    69 static boolean m68k_coff_is_local_label_name PARAMS ((bfd *, const char *));
     70static bfd_boolean m68k_coff_is_local_label_name
     71  PARAMS ((bfd *, const char *));
    7072
    7173/* On the delta, a symbol starting with L% is local.  We won't see
     
    7375   consider it local here.  */
    7476
    75 static boolean
     77static bfd_boolean
    7678m68k_coff_is_local_label_name (abfd, name)
    7779     bfd *abfd;
     
    7981{
    8082  if (name[0] == 'L' && name[1] == '%')
    81     return true;
     83    return TRUE;
    8284
    8385  return _bfd_coff_is_local_label_name (abfd, name);
     
    99101#endif
    100102reloc_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  };
    110112#endif /* not ONLY_DECLARE_RELOCS */
    111113
     
    123125  PARAMS ((bfd *, bfd_reloc_code_real_type));
    124126#else
     127
    125128#ifdef STATIC_RELOCS
    126 static
    127 #endif
    128 void
     129#define STAT_REL static
     130#else
     131#define STAT_REL
     132#endif
     133
     134STAT_REL reloc_howto_type * m68k_reloc_type_lookup PARAMS ((bfd *, bfd_reloc_code_real_type));
     135STAT_REL int m68k_howto2rtype PARAMS ((reloc_howto_type *));
     136STAT_REL void m68k_rtype2howto PARAMS ((arelent *, int));
     137
     138
     139STAT_REL void
    129140m68k_rtype2howto(internal, relocentry)
    130141     arelent *internal;
     
    132143{
    133144  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
     156STAT_REL int
    149157m68k_howto2rtype (internal)
    150158     reloc_howto_type *internal;
    151159{
    152160  if (internal->pc_relative)
    153   {
    154     switch (internal->bitsize)
    155     {
    156      case 32: return R_PCRLONG;
    157      case 16: return R_PCRWORD;
    158      case 8: return R_PCRBYTE;
    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    }
    161169  else
    162   {
    163     switch (internal->bitsize)
    164      {
    165       case 32: return R_RELLONG;
    166       case 16: return R_RELWORD;
    167       case 8: return R_RELBYTE;
    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    }
    170178  return R_RELLONG;
    171179}
    172180
    173 #ifdef STATIC_RELOCS
    174 static
    175 #endif
    176 reloc_howto_type *
     181STAT_REL reloc_howto_type *
    177182m68k_reloc_type_lookup (abfd, code)
    178183     bfd *abfd ATTRIBUTE_UNUSED;
     
    314319            short x = bfd_get_16 (abfd, addr);
    315320            DOIT (x);
    316             bfd_put_16 (abfd, x, addr);
     321            bfd_put_16 (abfd, (bfd_vma) x, addr);
    317322          }
    318323          break;
     
    322327            long x = bfd_get_32 (abfd, addr);
    323328            DOIT (x);
    324             bfd_put_32 (abfd, x, addr);
     329            bfd_put_32 (abfd, (bfd_vma) x, addr);
    325330          }
    326331          break;
     
    428433   objects, and before the final_link entry point is called.  */
    429434
    430 boolean
     435bfd_boolean
    431436bfd_m68k_coff_create_embedded_relocs (abfd, info, datasec, relsec, errmsg)
    432437     bfd *abfd;
     
    440445  struct internal_reloc *irel, *irelend;
    441446  bfd_byte *p;
     447  bfd_size_type amt;
    442448
    443449  BFD_ASSERT (! info->relocateable);
     
    446452
    447453  if (datasec->reloc_count == 0)
    448     return true;
     454    return TRUE;
    449455
    450456  extsyms = obj_coff_external_syms (abfd);
    451457  symesz = bfd_coff_symesz (abfd);
    452458
    453   irel = _bfd_coff_read_internal_relocs (abfd, datasec, true, NULL, false,
     459  irel = _bfd_coff_read_internal_relocs (abfd, datasec, TRUE, NULL, FALSE,
    454460                                         NULL);
    455461  irelend = irel + datasec->reloc_count;
    456462
    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);
    458465  if (relsec->contents == NULL)
    459     return false;
     466    return FALSE;
    460467
    461468  p = relsec->contents;
     
    476483          *errmsg = _("unsupported reloc type");
    477484          bfd_set_error (bfd_error_bad_value);
    478           return false;
     485          return FALSE;
    479486        }
    480487
     
    508515    }
    509516
    510   return true;
     517  return TRUE;
    511518}
    512519#endif /* neither ONLY_DECLARE_RELOCS not STATIC_RELOCS  */
Note: See TracChangeset for help on using the changeset viewer.