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-apollo.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r608 r609  
    11/* BFD back-end for Apollo 68000 COFF binaries.
    2    Copyright 1990, 1991, 1992, 1993, 1994, 1999, 2000
     2   Copyright 1990, 1991, 1992, 1993, 1994, 1999, 2000, 2001, 2002
    33   Free Software Foundation, Inc.
    44   By Troy Rollo (troy@cbme.unsw.edu.au)
     
    3434#else
    3535reloc_howto_type apollocoff_howto_table[] =
    36 {
    37   HOWTO(R_RELBYTE,             0,  0,   8,  false, 0, complain_overflow_bitfield, 0, "8",       true, 0x000000ff,0x000000ff, false),
    38   HOWTO(R_RELWORD,             0,  1,   16, false, 0, complain_overflow_bitfield, 0, "16",      true, 0x0000ffff,0x0000ffff, false),
    39   HOWTO(R_RELLONG,             0,  2,   32, false, 0, complain_overflow_bitfield, 0, "32",      true, 0xffffffff,0xffffffff, false),
    40   HOWTO(R_PCRBYTE,             0,  0,   8,  true,  0, complain_overflow_signed, 0, "DISP8",    true, 0x000000ff,0x000000ff, false),
    41   HOWTO(R_PCRWORD,             0,  1,   16, true,  0, complain_overflow_signed, 0, "DISP16",   true, 0x0000ffff,0x0000ffff, false),
    42   HOWTO(R_PCRLONG,             0,  2,   32, true,  0, complain_overflow_signed, 0, "DISP32",   true, 0xffffffff,0xffffffff, false),
    43   HOWTO(R_RELLONG_NEG,         0,  -2,  32, false, 0, complain_overflow_bitfield, 0, "-32",     true, 0xffffffff,0xffffffff, false),
    44 };
     36  {
     37    HOWTO (R_RELBYTE,          0,  0,   8,  FALSE, 0, complain_overflow_bitfield, 0, "8",       TRUE, 0x000000ff,0x000000ff, FALSE),
     38    HOWTO (R_RELWORD,          0,  1,   16, FALSE, 0, complain_overflow_bitfield, 0, "16",      TRUE, 0x0000ffff,0x0000ffff, FALSE),
     39    HOWTO (R_RELLONG,          0,  2,   32, FALSE, 0, complain_overflow_bitfield, 0, "32",      TRUE, 0xffffffff,0xffffffff, FALSE),
     40    HOWTO (R_PCRBYTE,          0,  0,   8,  TRUE,  0, complain_overflow_signed,   0, "DISP8",   TRUE, 0x000000ff,0x000000ff, FALSE),
     41    HOWTO (R_PCRWORD,          0,  1,   16, TRUE,  0, complain_overflow_signed,   0, "DISP16",  TRUE, 0x0000ffff,0x0000ffff, FALSE),
     42    HOWTO (R_PCRLONG,          0,  2,   32, TRUE,  0, complain_overflow_signed,   0, "DISP32",  TRUE, 0xffffffff,0xffffffff, FALSE),
     43    HOWTO (R_RELLONG_NEG,      0,  -2,  32, FALSE, 0, complain_overflow_bitfield, 0, "-32",     TRUE, 0xffffffff,0xffffffff, FALSE),
     44  };
    4545#endif /* not ONLY_DECLARE_RELOCS */
    4646
     
    5050#define APOLLO_M68 1            /* Customize coffcode.h */
    5151
    52 /* Turn a howto into a reloc number */
     52/* Turn a howto into a reloc number. */
    5353
    54 #ifdef ONLY_DECLARE_RELOCS
    55 extern void apollo_rtype2howto PARAMS ((arelent *internal, int relocentry));
    56 extern int apollo_howto2rtype PARAMS ((reloc_howto_type *));
    57 #else
     54extern void apollo_rtype2howto PARAMS ((arelent *, int));
     55extern int  apollo_howto2rtype PARAMS ((reloc_howto_type *));
     56#ifndef ONLY_DECLARE_RELOCS
     57
    5858void
    59 apollo_rtype2howto(internal, relocentry)
     59apollo_rtype2howto (internal, relocentry)
    6060     arelent *internal;
    6161     int relocentry;
    6262{
    6363  switch (relocentry)
    64   {
    65    case R_RELBYTE:      internal->howto = apollocoff_howto_table + 0; break;
    66    case R_RELWORD:      internal->howto = apollocoff_howto_table + 1; break;
    67    case R_RELLONG:      internal->howto = apollocoff_howto_table + 2; break;
    68    case R_PCRBYTE:      internal->howto = apollocoff_howto_table + 3; break;
    69    case R_PCRWORD:      internal->howto = apollocoff_howto_table + 4; break;
    70    case R_PCRLONG:      internal->howto = apollocoff_howto_table + 5; break;
    71    case R_RELLONG_NEG:  internal->howto = apollocoff_howto_table + 6; break;
    72   }
     64    {
     65    case R_RELBYTE:     internal->howto = apollocoff_howto_table + 0; break;
     66    case R_RELWORD:     internal->howto = apollocoff_howto_table + 1; break;
     67    case R_RELLONG:     internal->howto = apollocoff_howto_table + 2; break;
     68    case R_PCRBYTE:     internal->howto = apollocoff_howto_table + 3; break;
     69    case R_PCRWORD:     internal->howto = apollocoff_howto_table + 4; break;
     70    case R_PCRLONG:     internal->howto = apollocoff_howto_table + 5; break;
     71    case R_RELLONG_NEG: internal->howto = apollocoff_howto_table + 6; break;
     72    }
    7373}
    7474
     
    7878{
    7979  if (internal->pc_relative)
    80   {
    81     switch (internal->bitsize)
    8280    {
    83      case 32: return R_PCRLONG;
    84      case 16: return R_PCRWORD;
    85      case 8: return R_PCRBYTE;
     81      switch (internal->bitsize)
     82        {
     83        case 32: return R_PCRLONG;
     84        case 16: return R_PCRWORD;
     85        case 8: return R_PCRBYTE;
     86        }
    8687    }
    87   }
    8888  else
    89   {
    90     switch (internal->bitsize)
    91      {
    92       case 32: return R_RELLONG;
    93       case 16: return R_RELWORD;
    94       case 8: return R_RELBYTE;
    95      }
    96   }
     89    {
     90      switch (internal->bitsize)
     91        {
     92        case 32: return R_RELLONG;
     93        case 16: return R_RELWORD;
     94        case 8: return R_RELBYTE;
     95        }
     96    }
    9797  return R_RELLONG;
    9898}
     
    100100
    101101#define RTYPE2HOWTO(internal, relocentry) \
    102   apollo_rtype2howto(internal, (relocentry)->r_type)
     102  apollo_rtype2howto (internal, (relocentry)->r_type)
    103103
    104104#define SELECT_RELOC(external, internal) \
    105   external.r_type = apollo_howto2rtype(internal);
     105  external.r_type = apollo_howto2rtype (internal);
    106106
    107107#include "coffcode.h"
Note: See TracChangeset for help on using the changeset viewer.