OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [binutils-2.18.50/] [gas/] [config/] [tc-fr30.c] - Diff between revs 156 and 816

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 156 Rev 816
/* tc-fr30.c -- Assembler for the Fujitsu FR30.
/* tc-fr30.c -- Assembler for the Fujitsu FR30.
   Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007
   Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007
   Free Software Foundation, Inc.
   Free Software Foundation, Inc.
 
 
   This file is part of GAS, the GNU Assembler.
   This file is part of GAS, the GNU Assembler.
 
 
   GAS is free software; you can redistribute it and/or modify
   GAS is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 3, or (at your option)
   the Free Software Foundation; either version 3, or (at your option)
   any later version.
   any later version.
 
 
   GAS is distributed in the hope that it will be useful,
   GAS is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
   GNU General Public License for more details.
 
 
   You should have received a copy of the GNU General Public License
   You should have received a copy of the GNU General Public License
   along with GAS; see the file COPYING.  If not, write to
   along with GAS; see the file COPYING.  If not, write to
   the Free Software Foundation, 51 Franklin Street - Fifth Floor,
   the Free Software Foundation, 51 Franklin Street - Fifth Floor,
   Boston, MA 02110-1301, USA.  */
   Boston, MA 02110-1301, USA.  */
 
 
#include "as.h"
#include "as.h"
#include "safe-ctype.h"
#include "safe-ctype.h"
#include "subsegs.h"
#include "subsegs.h"
#include "symcat.h"
#include "symcat.h"
#include "opcodes/fr30-desc.h"
#include "opcodes/fr30-desc.h"
#include "opcodes/fr30-opc.h"
#include "opcodes/fr30-opc.h"
#include "cgen.h"
#include "cgen.h"
 
 
/* Structure to hold all of the different components describing
/* Structure to hold all of the different components describing
   an individual instruction.  */
   an individual instruction.  */
typedef struct
typedef struct
{
{
  const CGEN_INSN *     insn;
  const CGEN_INSN *     insn;
  const CGEN_INSN *     orig_insn;
  const CGEN_INSN *     orig_insn;
  CGEN_FIELDS           fields;
  CGEN_FIELDS           fields;
#if CGEN_INT_INSN_P
#if CGEN_INT_INSN_P
  CGEN_INSN_INT         buffer [1];
  CGEN_INSN_INT         buffer [1];
#define INSN_VALUE(buf) (*(buf))
#define INSN_VALUE(buf) (*(buf))
#else
#else
  unsigned char         buffer [CGEN_MAX_INSN_SIZE];
  unsigned char         buffer [CGEN_MAX_INSN_SIZE];
#define INSN_VALUE(buf) (buf)
#define INSN_VALUE(buf) (buf)
#endif
#endif
  char *                addr;
  char *                addr;
  fragS *               frag;
  fragS *               frag;
  int                   num_fixups;
  int                   num_fixups;
  fixS *                fixups [GAS_CGEN_MAX_FIXUPS];
  fixS *                fixups [GAS_CGEN_MAX_FIXUPS];
  int                   indices [MAX_OPERAND_INSTANCES];
  int                   indices [MAX_OPERAND_INSTANCES];
}
}
fr30_insn;
fr30_insn;
 
 
const char comment_chars[]        = ";";
const char comment_chars[]        = ";";
const char line_comment_chars[]   = "#";
const char line_comment_chars[]   = "#";
const char line_separator_chars[] = "|";
const char line_separator_chars[] = "|";
const char EXP_CHARS[]            = "eE";
const char EXP_CHARS[]            = "eE";
const char FLT_CHARS[]            = "dD";
const char FLT_CHARS[]            = "dD";


#define FR30_SHORTOPTS ""
#define FR30_SHORTOPTS ""
const char * md_shortopts = FR30_SHORTOPTS;
const char * md_shortopts = FR30_SHORTOPTS;
 
 
struct option md_longopts[] =
struct option md_longopts[] =
{
{
  {NULL, no_argument, NULL, 0}
  {NULL, no_argument, NULL, 0}
};
};
size_t md_longopts_size = sizeof (md_longopts);
size_t md_longopts_size = sizeof (md_longopts);
 
 
int
int
md_parse_option (int c ATTRIBUTE_UNUSED,
md_parse_option (int c ATTRIBUTE_UNUSED,
                 char *arg ATTRIBUTE_UNUSED)
                 char *arg ATTRIBUTE_UNUSED)
{
{
  switch (c)
  switch (c)
    {
    {
    default:
    default:
      return 0;
      return 0;
    }
    }
  return 1;
  return 1;
}
}
 
 
void
void
md_show_usage (FILE * stream)
md_show_usage (FILE * stream)
{
{
  fprintf (stream, _(" FR30 specific command line options:\n"));
  fprintf (stream, _(" FR30 specific command line options:\n"));
}
}
 
 
/* The target specific pseudo-ops which we support.  */
/* The target specific pseudo-ops which we support.  */
const pseudo_typeS md_pseudo_table[] =
const pseudo_typeS md_pseudo_table[] =
{
{
  { "word",     cons,           4 },
  { "word",     cons,           4 },
  { NULL,       NULL,           0 }
  { NULL,       NULL,           0 }
};
};
 
 


void
void
md_begin (void)
md_begin (void)
{
{
  /* Initialize the `cgen' interface.  */
  /* Initialize the `cgen' interface.  */
 
 
  /* Set the machine number and endian.  */
  /* Set the machine number and endian.  */
  gas_cgen_cpu_desc = fr30_cgen_cpu_open (CGEN_CPU_OPEN_MACHS, 0,
  gas_cgen_cpu_desc = fr30_cgen_cpu_open (CGEN_CPU_OPEN_MACHS, 0,
                                          CGEN_CPU_OPEN_ENDIAN,
                                          CGEN_CPU_OPEN_ENDIAN,
                                          CGEN_ENDIAN_BIG,
                                          CGEN_ENDIAN_BIG,
                                          CGEN_CPU_OPEN_END);
                                          CGEN_CPU_OPEN_END);
  fr30_cgen_init_asm (gas_cgen_cpu_desc);
  fr30_cgen_init_asm (gas_cgen_cpu_desc);
 
 
  /* This is a callback from cgen to gas to parse operands.  */
  /* This is a callback from cgen to gas to parse operands.  */
  cgen_set_parse_operand_fn (gas_cgen_cpu_desc, gas_cgen_parse_operand);
  cgen_set_parse_operand_fn (gas_cgen_cpu_desc, gas_cgen_parse_operand);
}
}
 
 
void
void
md_assemble (char *str)
md_assemble (char *str)
{
{
  static int last_insn_had_delay_slot = 0;
  static int last_insn_had_delay_slot = 0;
  fr30_insn insn;
  fr30_insn insn;
  char *errmsg;
  char *errmsg;
 
 
  /* Initialize GAS's cgen interface for a new instruction.  */
  /* Initialize GAS's cgen interface for a new instruction.  */
  gas_cgen_init_parse ();
  gas_cgen_init_parse ();
 
 
  insn.insn = fr30_cgen_assemble_insn
  insn.insn = fr30_cgen_assemble_insn
    (gas_cgen_cpu_desc, str, & insn.fields, insn.buffer, & errmsg);
    (gas_cgen_cpu_desc, str, & insn.fields, insn.buffer, & errmsg);
 
 
  if (!insn.insn)
  if (!insn.insn)
    {
    {
      as_bad (errmsg);
      as_bad (errmsg);
      return;
      return;
    }
    }
 
 
  /* Doesn't really matter what we pass for RELAX_P here.  */
  /* Doesn't really matter what we pass for RELAX_P here.  */
  gas_cgen_finish_insn (insn.insn, insn.buffer,
  gas_cgen_finish_insn (insn.insn, insn.buffer,
                        CGEN_FIELDS_BITSIZE (& insn.fields), 1, NULL);
                        CGEN_FIELDS_BITSIZE (& insn.fields), 1, NULL);
 
 
  /* Warn about invalid insns in delay slots.  */
  /* Warn about invalid insns in delay slots.  */
  if (last_insn_had_delay_slot
  if (last_insn_had_delay_slot
      && CGEN_INSN_ATTR_VALUE (insn.insn, CGEN_INSN_NOT_IN_DELAY_SLOT))
      && CGEN_INSN_ATTR_VALUE (insn.insn, CGEN_INSN_NOT_IN_DELAY_SLOT))
    as_warn (_("Instruction %s not allowed in a delay slot."),
    as_warn (_("Instruction %s not allowed in a delay slot."),
             CGEN_INSN_NAME (insn.insn));
             CGEN_INSN_NAME (insn.insn));
 
 
  last_insn_had_delay_slot
  last_insn_had_delay_slot
    = CGEN_INSN_ATTR_VALUE (insn.insn, CGEN_INSN_DELAY_SLOT);
    = CGEN_INSN_ATTR_VALUE (insn.insn, CGEN_INSN_DELAY_SLOT);
}
}
 
 
/* The syntax in the manual says constants begin with '#'.
/* The syntax in the manual says constants begin with '#'.
   We just ignore it.  */
   We just ignore it.  */
 
 
void
void
md_operand (expressionS * expressionP)
md_operand (expressionS * expressionP)
{
{
  if (* input_line_pointer == '#')
  if (* input_line_pointer == '#')
    {
    {
      input_line_pointer ++;
      input_line_pointer ++;
      expression (expressionP);
      expression (expressionP);
    }
    }
}
}
 
 
valueT
valueT
md_section_align (segT segment, valueT size)
md_section_align (segT segment, valueT size)
{
{
  int align = bfd_get_section_alignment (stdoutput, segment);
  int align = bfd_get_section_alignment (stdoutput, segment);
 
 
  return ((size + (1 << align) - 1) & (-1 << align));
  return ((size + (1 << align) - 1) & (-1 << align));
}
}
 
 
symbolS *
symbolS *
md_undefined_symbol (char *name ATTRIBUTE_UNUSED)
md_undefined_symbol (char *name ATTRIBUTE_UNUSED)
{
{
  return NULL;
  return NULL;
}
}


/* Interface to relax_segment.  */
/* Interface to relax_segment.  */
 
 
/* FIXME: Build table by hand, get it working, then machine generate.  */
/* FIXME: Build table by hand, get it working, then machine generate.  */
 
 
const relax_typeS md_relax_table[] =
const relax_typeS md_relax_table[] =
{
{
/* The fields are:
/* The fields are:
   1) most positive reach of this state,
   1) most positive reach of this state,
   2) most negative reach of this state,
   2) most negative reach of this state,
   3) how many bytes this mode will add to the size of the current frag
   3) how many bytes this mode will add to the size of the current frag
   4) which index into the table to try if we can't fit into this one.  */
   4) which index into the table to try if we can't fit into this one.  */
 
 
  /* The first entry must be unused because an `rlx_more' value of zero ends
  /* The first entry must be unused because an `rlx_more' value of zero ends
     each list.  */
     each list.  */
  {1, 1, 0, 0},
  {1, 1, 0, 0},
 
 
  /* The displacement used by GAS is from the end of the 2 byte insn,
  /* The displacement used by GAS is from the end of the 2 byte insn,
     so we subtract 2 from the following.  */
     so we subtract 2 from the following.  */
  /* 16 bit insn, 8 bit disp -> 10 bit range.
  /* 16 bit insn, 8 bit disp -> 10 bit range.
     This doesn't handle a branch in the right slot at the border:
     This doesn't handle a branch in the right slot at the border:
     the "& -4" isn't taken into account.  It's not important enough to
     the "& -4" isn't taken into account.  It's not important enough to
     complicate things over it, so we subtract an extra 2 (or + 2 in -ve
     complicate things over it, so we subtract an extra 2 (or + 2 in -ve
     case).  */
     case).  */
  {511 - 2 - 2, -512 - 2 + 2, 0, 2 },
  {511 - 2 - 2, -512 - 2 + 2, 0, 2 },
  /* 32 bit insn, 24 bit disp -> 26 bit range.  */
  /* 32 bit insn, 24 bit disp -> 26 bit range.  */
  {0x2000000 - 1 - 2, -0x2000000 - 2, 2, 0 },
  {0x2000000 - 1 - 2, -0x2000000 - 2, 2, 0 },
  /* Same thing, but with leading nop for alignment.  */
  /* Same thing, but with leading nop for alignment.  */
  {0x2000000 - 1 - 2, -0x2000000 - 2, 4, 0 }
  {0x2000000 - 1 - 2, -0x2000000 - 2, 4, 0 }
};
};
 
 
/* Return an initial guess of the length by which a fragment must grow to
/* Return an initial guess of the length by which a fragment must grow to
   hold a branch to reach its destination.
   hold a branch to reach its destination.
   Also updates fr_type/fr_subtype as necessary.
   Also updates fr_type/fr_subtype as necessary.
 
 
   Called just before doing relaxation.
   Called just before doing relaxation.
   Any symbol that is now undefined will not become defined.
   Any symbol that is now undefined will not become defined.
   The guess for fr_var is ACTUALLY the growth beyond fr_fix.
   The guess for fr_var is ACTUALLY the growth beyond fr_fix.
   Whatever we do to grow fr_fix or fr_var contributes to our returned value.
   Whatever we do to grow fr_fix or fr_var contributes to our returned value.
   Although it may not be explicit in the frag, pretend fr_var starts with a
   Although it may not be explicit in the frag, pretend fr_var starts with a
   0 value.  */
   0 value.  */
 
 
int
int
md_estimate_size_before_relax (fragS * fragP, segT segment)
md_estimate_size_before_relax (fragS * fragP, segT segment)
{
{
  /* The only thing we have to handle here are symbols outside of the
  /* The only thing we have to handle here are symbols outside of the
     current segment.  They may be undefined or in a different segment in
     current segment.  They may be undefined or in a different segment in
     which case linker scripts may place them anywhere.
     which case linker scripts may place them anywhere.
     However, we can't finish the fragment here and emit the reloc as insn
     However, we can't finish the fragment here and emit the reloc as insn
     alignment requirements may move the insn about.  */
     alignment requirements may move the insn about.  */
 
 
  if (S_GET_SEGMENT (fragP->fr_symbol) != segment)
  if (S_GET_SEGMENT (fragP->fr_symbol) != segment)
    {
    {
      /* The symbol is undefined in this segment.
      /* The symbol is undefined in this segment.
         Change the relaxation subtype to the max allowable and leave
         Change the relaxation subtype to the max allowable and leave
         all further handling to md_convert_frag.  */
         all further handling to md_convert_frag.  */
      fragP->fr_subtype = 2;
      fragP->fr_subtype = 2;
 
 
      {
      {
        const CGEN_INSN * insn;
        const CGEN_INSN * insn;
        int               i;
        int               i;
 
 
        /* Update the recorded insn.
        /* Update the recorded insn.
           Fortunately we don't have to look very far.
           Fortunately we don't have to look very far.
           FIXME: Change this to record in the instruction the next higher
           FIXME: Change this to record in the instruction the next higher
           relaxable insn to use.  */
           relaxable insn to use.  */
        for (i = 0, insn = fragP->fr_cgen.insn; i < 4; i++, insn++)
        for (i = 0, insn = fragP->fr_cgen.insn; i < 4; i++, insn++)
          {
          {
            if ((strcmp (CGEN_INSN_MNEMONIC (insn),
            if ((strcmp (CGEN_INSN_MNEMONIC (insn),
                         CGEN_INSN_MNEMONIC (fragP->fr_cgen.insn))
                         CGEN_INSN_MNEMONIC (fragP->fr_cgen.insn))
                 == 0)
                 == 0)
                && CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_RELAXED))
                && CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_RELAXED))
              break;
              break;
          }
          }
        if (i == 4)
        if (i == 4)
          abort ();
          abort ();
 
 
        fragP->fr_cgen.insn = insn;
        fragP->fr_cgen.insn = insn;
        return 2;
        return 2;
      }
      }
    }
    }
 
 
  /* Return the size of the variable part of the frag.  */
  /* Return the size of the variable part of the frag.  */
  return md_relax_table[fragP->fr_subtype].rlx_length;
  return md_relax_table[fragP->fr_subtype].rlx_length;
}
}
 
 
/* *fragP has been relaxed to its final size, and now needs to have
/* *fragP has been relaxed to its final size, and now needs to have
   the bytes inside it modified to conform to the new size.
   the bytes inside it modified to conform to the new size.
 
 
   Called after relaxation is finished.
   Called after relaxation is finished.
   fragP->fr_type == rs_machine_dependent.
   fragP->fr_type == rs_machine_dependent.
   fragP->fr_subtype is the subtype of what the address relaxed to.  */
   fragP->fr_subtype is the subtype of what the address relaxed to.  */
 
 
void
void
md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED,
md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED,
                 segT sec ATTRIBUTE_UNUSED,
                 segT sec ATTRIBUTE_UNUSED,
                 fragS *fragP ATTRIBUTE_UNUSED)
                 fragS *fragP ATTRIBUTE_UNUSED)
{
{
}
}


/* Functions concerning relocs.  */
/* Functions concerning relocs.  */
 
 
/* The location from which a PC relative jump should be calculated,
/* The location from which a PC relative jump should be calculated,
   given a PC relative reloc.  */
   given a PC relative reloc.  */
 
 
long
long
md_pcrel_from_section (fixS * fixP, segT sec)
md_pcrel_from_section (fixS * fixP, segT sec)
{
{
  if (fixP->fx_addsy != (symbolS *) NULL
  if (fixP->fx_addsy != (symbolS *) NULL
      && (! S_IS_DEFINED (fixP->fx_addsy)
      && (! S_IS_DEFINED (fixP->fx_addsy)
          || S_GET_SEGMENT (fixP->fx_addsy) != sec))
          || S_GET_SEGMENT (fixP->fx_addsy) != sec))
    /* The symbol is undefined (or is defined but not in this section).
    /* The symbol is undefined (or is defined but not in this section).
       Let the linker figure it out.  */
       Let the linker figure it out.  */
    return 0;
    return 0;
 
 
  return (fixP->fx_frag->fr_address + fixP->fx_where) & ~1;
  return (fixP->fx_frag->fr_address + fixP->fx_where) & ~1;
}
}
 
 
/* Return the bfd reloc type for OPERAND of INSN at fixup FIXP.
/* Return the bfd reloc type for OPERAND of INSN at fixup FIXP.
   Returns BFD_RELOC_NONE if no reloc type can be found.
   Returns BFD_RELOC_NONE if no reloc type can be found.
   *FIXP may be modified if desired.  */
   *FIXP may be modified if desired.  */
 
 
bfd_reloc_code_real_type
bfd_reloc_code_real_type
md_cgen_lookup_reloc (const CGEN_INSN *insn ATTRIBUTE_UNUSED,
md_cgen_lookup_reloc (const CGEN_INSN *insn ATTRIBUTE_UNUSED,
                      const CGEN_OPERAND *operand,
                      const CGEN_OPERAND *operand,
                      fixS *fixP)
                      fixS *fixP)
{
{
  switch (operand->type)
  switch (operand->type)
    {
    {
    case FR30_OPERAND_LABEL9:  fixP->fx_pcrel = 1; return BFD_RELOC_FR30_9_PCREL;
    case FR30_OPERAND_LABEL9:  fixP->fx_pcrel = 1; return BFD_RELOC_FR30_9_PCREL;
    case FR30_OPERAND_LABEL12: fixP->fx_pcrel = 1; return BFD_RELOC_FR30_12_PCREL;
    case FR30_OPERAND_LABEL12: fixP->fx_pcrel = 1; return BFD_RELOC_FR30_12_PCREL;
    case FR30_OPERAND_DISP10:  return BFD_RELOC_FR30_10_IN_8;
    case FR30_OPERAND_DISP10:  return BFD_RELOC_FR30_10_IN_8;
    case FR30_OPERAND_DISP9:   return BFD_RELOC_FR30_9_IN_8;
    case FR30_OPERAND_DISP9:   return BFD_RELOC_FR30_9_IN_8;
    case FR30_OPERAND_DISP8:   return BFD_RELOC_FR30_8_IN_8;
    case FR30_OPERAND_DISP8:   return BFD_RELOC_FR30_8_IN_8;
    case FR30_OPERAND_UDISP6:  return BFD_RELOC_FR30_6_IN_4;
    case FR30_OPERAND_UDISP6:  return BFD_RELOC_FR30_6_IN_4;
    case FR30_OPERAND_I8:      return BFD_RELOC_8;
    case FR30_OPERAND_I8:      return BFD_RELOC_8;
    case FR30_OPERAND_I32:     return BFD_RELOC_FR30_48;
    case FR30_OPERAND_I32:     return BFD_RELOC_FR30_48;
    case FR30_OPERAND_I20:     return BFD_RELOC_FR30_20;
    case FR30_OPERAND_I20:     return BFD_RELOC_FR30_20;
    default : /* Avoid -Wall warning.  */
    default : /* Avoid -Wall warning.  */
      break;
      break;
    }
    }
 
 
  return BFD_RELOC_NONE;
  return BFD_RELOC_NONE;
}
}


/* Write a value out to the object file, using the appropriate endianness.  */
/* Write a value out to the object file, using the appropriate endianness.  */
 
 
void
void
md_number_to_chars (char * buf, valueT val, int n)
md_number_to_chars (char * buf, valueT val, int n)
{
{
  number_to_chars_bigendian (buf, val, n);
  number_to_chars_bigendian (buf, val, n);
}
}
 
 
char *
char *
md_atof (int type, char * litP, int * sizeP)
md_atof (int type, char * litP, int * sizeP)
{
{
  return ieee_md_atof (type, litP, sizeP, TRUE);
  return ieee_md_atof (type, litP, sizeP, TRUE);
}
}
 
 
/* Worker function for fr30_is_colon_insn().  */
/* Worker function for fr30_is_colon_insn().  */
static char
static char
restore_colon (int advance_i_l_p_by)
restore_colon (int advance_i_l_p_by)
{
{
  char c;
  char c;
 
 
  /* Restore the colon, and advance input_line_pointer to
  /* Restore the colon, and advance input_line_pointer to
     the end of the new symbol.  */
     the end of the new symbol.  */
  * input_line_pointer = ':';
  * input_line_pointer = ':';
  input_line_pointer += advance_i_l_p_by;
  input_line_pointer += advance_i_l_p_by;
  c = * input_line_pointer;
  c = * input_line_pointer;
  * input_line_pointer = 0;
  * input_line_pointer = 0;
 
 
  return c;
  return c;
}
}
 
 
/* Determines if the symbol starting at START and ending in
/* Determines if the symbol starting at START and ending in
   a colon that was at the location pointed to by INPUT_LINE_POINTER
   a colon that was at the location pointed to by INPUT_LINE_POINTER
   (but which has now been replaced bu a NUL) is in fact an
   (but which has now been replaced bu a NUL) is in fact an
   LDI:8, LDI:20, LDI:32, CALL:D. JMP:D, RET:D or Bcc:D instruction.
   LDI:8, LDI:20, LDI:32, CALL:D. JMP:D, RET:D or Bcc:D instruction.
   If it is, then it restores the colon, advances INPUT_LINE_POINTER
   If it is, then it restores the colon, advances INPUT_LINE_POINTER
   to the real end of the instruction/symbol, and returns the character
   to the real end of the instruction/symbol, and returns the character
   that really terminated the symbol.  Otherwise it returns 0.  */
   that really terminated the symbol.  Otherwise it returns 0.  */
char
char
fr30_is_colon_insn (char *  start)
fr30_is_colon_insn (char *  start)
{
{
  char * i_l_p = input_line_pointer;
  char * i_l_p = input_line_pointer;
 
 
  /* Check to see if the symbol parsed so far is 'ldi'.  */
  /* Check to see if the symbol parsed so far is 'ldi'.  */
  if (   (start[0] != 'l' && start[0] != 'L')
  if (   (start[0] != 'l' && start[0] != 'L')
      || (start[1] != 'd' && start[1] != 'D')
      || (start[1] != 'd' && start[1] != 'D')
      || (start[2] != 'i' && start[2] != 'I')
      || (start[2] != 'i' && start[2] != 'I')
      || start[3] != 0)
      || start[3] != 0)
    {
    {
      /* Nope - check to see a 'd' follows the colon.  */
      /* Nope - check to see a 'd' follows the colon.  */
      if (   (i_l_p[1] == 'd' || i_l_p[1] == 'D')
      if (   (i_l_p[1] == 'd' || i_l_p[1] == 'D')
          && (i_l_p[2] == ' ' || i_l_p[2] == '\t' || i_l_p[2] == '\n'))
          && (i_l_p[2] == ' ' || i_l_p[2] == '\t' || i_l_p[2] == '\n'))
        {
        {
          /* Yup - it might be delay slot instruction.  */
          /* Yup - it might be delay slot instruction.  */
          int           i;
          int           i;
          static char * delay_insns [] =
          static char * delay_insns [] =
          {
          {
            "call", "jmp", "ret", "bra", "bno",
            "call", "jmp", "ret", "bra", "bno",
            "beq",  "bne", "bc",  "bnc", "bn",
            "beq",  "bne", "bc",  "bnc", "bn",
            "bp",   "bv",  "bnv", "blt", "bge",
            "bp",   "bv",  "bnv", "blt", "bge",
            "ble",  "bgt", "bls", "bhi"
            "ble",  "bgt", "bls", "bhi"
          };
          };
 
 
          for (i = sizeof (delay_insns) / sizeof (delay_insns[0]); i--;)
          for (i = sizeof (delay_insns) / sizeof (delay_insns[0]); i--;)
            {
            {
              char * insn = delay_insns[i];
              char * insn = delay_insns[i];
              int    len  = strlen (insn);
              int    len  = strlen (insn);
 
 
              if (start [len] != 0)
              if (start [len] != 0)
                continue;
                continue;
 
 
              while (len --)
              while (len --)
                if (TOLOWER (start [len]) != insn [len])
                if (TOLOWER (start [len]) != insn [len])
                  break;
                  break;
 
 
              if (len == -1)
              if (len == -1)
                return restore_colon (1);
                return restore_colon (1);
            }
            }
        }
        }
 
 
      /* Nope - it is a normal label.  */
      /* Nope - it is a normal label.  */
      return 0;
      return 0;
    }
    }
 
 
  /* Check to see if the text following the colon is '8'.  */
  /* Check to see if the text following the colon is '8'.  */
  if (i_l_p[1] == '8' && (i_l_p[2] == ' ' || i_l_p[2] == '\t'))
  if (i_l_p[1] == '8' && (i_l_p[2] == ' ' || i_l_p[2] == '\t'))
    return restore_colon (2);
    return restore_colon (2);
 
 
  /* Check to see if the text following the colon is '20'.  */
  /* Check to see if the text following the colon is '20'.  */
  else if (i_l_p[1] == '2' && i_l_p[2] =='0' && (i_l_p[3] == ' ' || i_l_p[3] == '\t'))
  else if (i_l_p[1] == '2' && i_l_p[2] =='0' && (i_l_p[3] == ' ' || i_l_p[3] == '\t'))
    return restore_colon (3);
    return restore_colon (3);
 
 
  /* Check to see if the text following the colon is '32'.  */
  /* Check to see if the text following the colon is '32'.  */
  else if (i_l_p[1] == '3' && i_l_p[2] =='2' && (i_l_p[3] == ' ' || i_l_p[3] == '\t'))
  else if (i_l_p[1] == '3' && i_l_p[2] =='2' && (i_l_p[3] == ' ' || i_l_p[3] == '\t'))
    return restore_colon (3);
    return restore_colon (3);
 
 
  return 0;
  return 0;
}
}
 
 
bfd_boolean
bfd_boolean
fr30_fix_adjustable (fixS * fixP)
fr30_fix_adjustable (fixS * fixP)
{
{
  /* We need the symbol name for the VTABLE entries.  */
  /* We need the symbol name for the VTABLE entries.  */
  if (fixP->fx_r_type == BFD_RELOC_VTABLE_INHERIT
  if (fixP->fx_r_type == BFD_RELOC_VTABLE_INHERIT
      || fixP->fx_r_type == BFD_RELOC_VTABLE_ENTRY)
      || fixP->fx_r_type == BFD_RELOC_VTABLE_ENTRY)
    return 0;
    return 0;
 
 
  return 1;
  return 1;
}
}
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.