Back to index

cell-binutils  2.17cvs20070401
Defines | Typedefs | Enumerations | Functions
tc-mep.h File Reference

Go to the source code of this file.

Defines

#define TC_MEP
#define OBJ_COMPLEX_RELC
#define GAS_CGEN_MAX_FIXUPS   10
#define LISTING_HEADER   "MEP GAS "
#define TARGET_ARCH   bfd_arch_mep
#define TARGET_FORMAT   (target_big_endian ? "elf32-mep" : "elf32-mep-little")
#define TARGET_BYTES_BIG_ENDIAN   1
#define LOCAL_LABELS_FB   1
#define DIFF_EXPR_OK
#define WORKING_DOT_WORD
#define MD_APPLY_SYM_VALUE(FIX)   0
#define MD_APPLY_FIX
#define md_apply_fix   mep_apply_fix
#define MD_PCREL_FROM_SECTION(FIXP, SEC)   md_pcrel_from_section (FIXP, SEC)
#define tc_frob_file()   mep_frob_file ()
#define tc_fix_adjustable(fixP)   mep_fix_adjustable (fixP)
#define md_cgen_record_fixup_exp   mep_cgen_record_fixup_exp
#define TC_FORCE_RELOCATION(fix)   mep_force_relocation (fix)
#define tc_gen_reloc   gas_cgen_tc_gen_reloc
#define md_operand(x)   gas_cgen_md_operand (x)
#define md_flush_pending_output()   mep_flush_pending_output()
#define TC_GENERIC_RELAX_TABLE   md_relax_table
#define TC_CGEN_MAX_RELAX(insn, len)   ((len) + 4)
#define md_prepare_relax_scan(FRAGP, ADDR, AIM, STATE, TYPE)   mep_prepare_relax_scan (FRAGP, &AIM, STATE)
#define skip_whitespace(str)   while (*(str) == ' ') ++(str)
#define CORE   0
#define VLIW   1
#define MAX_PARALLEL_INSNS   56 /* From email from Toshiba. */
#define VTEXT_SECTION_NAME   ".vtext"
#define TC_START_LABEL(ch, ptr)   ((ch == ':') && mep_flush_pending_output ())
#define tc_unrecognized_line(c)   mep_unrecognized_line (c)
#define md_cleanup   mep_cleanup
#define md_elf_section_letter   mep_elf_section_letter
#define md_elf_section_flags   mep_elf_section_flags
#define ELF_TC_SPECIAL_SECTIONS   { VTEXT_SECTION_NAME, SHT_PROGBITS, SHF_ALLOC|SHF_EXECINSTR|SHF_MEP_VLIW },

Typedefs

typedef enum exp_par_insn_ EXP_PAR_INSN

Enumerations

enum  exp_par_insn_ { FIRST, SECOND }

Functions

void mep_apply_fix (struct fix *, valueT *, segT)
long md_pcrel_from_section (struct fix *, segT)
void mep_frob_file (void)
bfd_boolean mep_fix_adjustable (struct fix *)
int mep_force_relocation (struct fix *)
void gas_cgen_md_operand (expressionS *)
int mep_flush_pending_output (void)
void mep_prepare_relax_scan (fragS *, offsetT *, relax_substateT)
int mep_unrecognized_line (int)
void mep_cleanup (void)
int mep_elf_section_letter (int, char **)
flagword mep_elf_section_flags (flagword, int, int)

Define Documentation

#define CORE   0

Definition at line 94 of file tc-mep.h.

#define DIFF_EXPR_OK

Definition at line 43 of file tc-mep.h.

Definition at line 112 of file tc-mep.h.

#define GAS_CGEN_MAX_FIXUPS   10

Definition at line 27 of file tc-mep.h.

#define LISTING_HEADER   "MEP GAS "

Definition at line 29 of file tc-mep.h.

#define LOCAL_LABELS_FB   1

Definition at line 40 of file tc-mep.h.

#define MAX_PARALLEL_INSNS   56 /* From email from Toshiba. */

Definition at line 96 of file tc-mep.h.

#define MD_APPLY_FIX

Definition at line 51 of file tc-mep.h.

Definition at line 52 of file tc-mep.h.

#define MD_APPLY_SYM_VALUE (   FIX)    0

Definition at line 49 of file tc-mep.h.

Definition at line 67 of file tc-mep.h.

#define md_cleanup   mep_cleanup

Definition at line 104 of file tc-mep.h.

Definition at line 109 of file tc-mep.h.

Definition at line 107 of file tc-mep.h.

Definition at line 78 of file tc-mep.h.

#define md_operand (   x)    gas_cgen_md_operand (x)

Definition at line 76 of file tc-mep.h.

#define MD_PCREL_FROM_SECTION (   FIXP,
  SEC 
)    md_pcrel_from_section (FIXP, SEC)

Definition at line 56 of file tc-mep.h.

#define md_prepare_relax_scan (   FRAGP,
  ADDR,
  AIM,
  STATE,
  TYPE 
)    mep_prepare_relax_scan (FRAGP, &AIM, STATE)

Definition at line 88 of file tc-mep.h.

Definition at line 24 of file tc-mep.h.

#define skip_whitespace (   str)    while (*(str) == ' ') ++(str)

Definition at line 91 of file tc-mep.h.

#define TARGET_ARCH   bfd_arch_mep

Definition at line 32 of file tc-mep.h.

#define TARGET_BYTES_BIG_ENDIAN   1

Definition at line 37 of file tc-mep.h.

#define TARGET_FORMAT   (target_big_endian ? "elf32-mep" : "elf32-mep-little")

Definition at line 34 of file tc-mep.h.

#define TC_CGEN_MAX_RELAX (   insn,
  len 
)    ((len) + 4)

Definition at line 85 of file tc-mep.h.

#define tc_fix_adjustable (   fixP)    mep_fix_adjustable (fixP)

Definition at line 62 of file tc-mep.h.

Definition at line 70 of file tc-mep.h.

#define tc_frob_file ( )    mep_frob_file ()

Definition at line 59 of file tc-mep.h.

Definition at line 73 of file tc-mep.h.

Definition at line 82 of file tc-mep.h.

#define TC_MEP

Definition at line 21 of file tc-mep.h.

#define TC_START_LABEL (   ch,
  ptr 
)    ((ch == ':') && mep_flush_pending_output ())

Definition at line 100 of file tc-mep.h.

Definition at line 102 of file tc-mep.h.

#define VLIW   1

Definition at line 95 of file tc-mep.h.

#define VTEXT_SECTION_NAME   ".vtext"

Definition at line 97 of file tc-mep.h.

Definition at line 46 of file tc-mep.h.


Typedef Documentation


Enumeration Type Documentation

Enumerator:
FIRST 
SECOND 

Definition at line 119 of file tc-mep.h.


Function Documentation

void mep_apply_fix ( struct fix ,
valueT ,
segT   
)
void mep_cleanup ( void  )

Definition at line 1867 of file tc-mep.c.

{
  /* Take care of any insns left to be parallelized when the file ends.
     This is mainly here to handle the case where the file ends with an
     insn preceeded by a + or the file ends unexpectedly.  */
  if (mode == VLIW)
    mep_process_saved_insns ();
}

Here is the call graph for this function:

int mep_elf_section_letter ( int  ,
char **   
)

Definition at line 1767 of file tc-mep.c.

{
  if (letter == 'v')
    return SHF_MEP_VLIW;

  *ptrmsg = _("Bad .section directive: want a,v,w,x,M,S in string");
  return 0;
}

Definition at line 1877 of file tc-mep.c.

{
  if (mode == VLIW)
    {
      mep_process_saved_insns ();
      pluspresent = 0;
    }

  return 1; 
}

Here is the call graph for this function:

void mep_frob_file ( void  )

Definition at line 1576 of file tc-mep.c.

{
  struct mep_hi_fixup * l;

  for (l = mep_hi_fixup_list; l != NULL; l = l->next)
    {
      segment_info_type * seginfo;
      int pass;

      assert (FX_OPINFO_R_TYPE (l->fixp) == BFD_RELOC_HI16
             || FX_OPINFO_R_TYPE (l->fixp) == BFD_RELOC_LO16);

      /* Check quickly whether the next fixup happens to be a matching low.  */
      if (l->fixp->fx_next != NULL
         && FX_OPINFO_R_TYPE (l->fixp->fx_next) == BFD_RELOC_LO16
         && l->fixp->fx_addsy == l->fixp->fx_next->fx_addsy
         && l->fixp->fx_offset == l->fixp->fx_next->fx_offset)
       continue;

      /* Look through the fixups for this segment for a matching
         `low'.  When we find one, move the high just in front of it.
         We do this in two passes.  In the first pass, we try to find
         a unique `low'.  In the second pass, we permit multiple
         high's relocs for a single `low'.  */
      seginfo = seg_info (l->seg);
      for (pass = 0; pass < 2; pass++)
       {
         fixS * f;
         fixS * prev;

         prev = NULL;
         for (f = seginfo->fix_root; f != NULL; f = f->fx_next)
           {
             /* Check whether this is a `low' fixup which matches l->fixp.  */
             if (FX_OPINFO_R_TYPE (f) == BFD_RELOC_LO16
                && f->fx_addsy == l->fixp->fx_addsy
                && f->fx_offset == l->fixp->fx_offset
                && (pass == 1
                    || prev == NULL
                    || (FX_OPINFO_R_TYPE (prev) != BFD_RELOC_HI16)
                    || prev->fx_addsy != f->fx_addsy
                    || prev->fx_offset !=  f->fx_offset))
              {
                fixS ** pf;

                /* Move l->fixp before f.  */
                for (pf = &seginfo->fix_root;
                     * pf != l->fixp;
                     pf = & (* pf)->fx_next)
                  assert (* pf != NULL);

                * pf = l->fixp->fx_next;

                l->fixp->fx_next = f;
                if (prev == NULL)
                  seginfo->fix_root = l->fixp;
                else
                  prev->fx_next = l->fixp;

                break;
              }

             prev = f;
           }

         if (f != NULL)
           break;

         if (pass == 1)
           as_warn_where (l->fixp->fx_file, l->fixp->fx_line,
                        _("Unmatched high relocation"));
       }
    }
}

Here is the call graph for this function:

void mep_prepare_relax_scan ( fragS *  ,
offsetT ,
relax_substateT   
)

Definition at line 1179 of file tc-mep.c.

{
  symbolS *symbolP = fragP->fr_symbol;
  if (symbolP && !S_IS_DEFINED (symbolP))
    *aim = 0;
  /* Adjust for MeP pcrel not being relative to the next opcode.  */
  *aim += 2 + md_relax_table[this_state].rlx_length;
}

Here is the call graph for this function:

Definition at line 1854 of file tc-mep.c.

{
  switch (ch)
    {
    case '+':
      pluspresent = 1;
      return 1; /* '+' indicates an instruction to be parallelized. */
    default:
      return 0; /* If it's not a '+', the line can't be parsed. */
    }
}