Back to index

cell-binutils  2.17cvs20070401
Classes | Defines | Functions | Variables
tc-sh.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  sh_segment_info_type

Defines

#define TC_SH
#define TARGET_ARCH   bfd_arch_sh
#define WORKING_DOT_WORD
#define md_cons_align(nbytes)   sh_cons_align (nbytes)
#define HANDLE_ALIGN(frag)   sh_handle_align (frag)
#define MAX_MEM_FOR_RS_ALIGN_CODE   (1 + 2)
#define TC_FORCE_RELOCATION(fix)   sh_force_relocation (fix)
#define SWITCH_TABLE(FIX)
#define TC_FORCE_RELOCATION_SUB_SAME(FIX, SEC)
#define TC_VALIDATE_FIX_SUB(FIX)   (sh_relax && SWITCH_TABLE (FIX))
#define MD_PCREL_FROM_SECTION(FIX, SEC)   md_pcrel_from_section (FIX, SEC)
#define TC_FX_SIZE_SLACK(FIX)   ((FIX)->fx_r_type == BFD_RELOC_SH_COUNT ? -1 : 2)
#define IGNORE_NONSTANDARD_ESCAPES
#define LISTING_HEADER
#define md_operand(x)
#define TC_GENERIC_RELAX_TABLE   md_relax_table
#define TC_SEGMENT_INFO_TYPE   struct sh_segment_info_type
#define tc_frob_label(sym)   sh_frob_label (sym)
#define md_flush_pending_output()   sh_flush_pending_output ()
#define tc_frob_file_before_adjust   sh_frob_file

Functions

void sh_cons_align (int)
void sh_handle_align (fragS *)
int sh_force_relocation (struct fix *)
long md_pcrel_from_section (struct fix *, segT)
void sh_frob_label (symbolS *)
void sh_flush_pending_output (void)
void sh_frob_file (void)

Variables

int sh_relax
int sh_small

Class Documentation

struct sh_segment_info_type

Definition at line 103 of file tc-sh.h.

Class Members
int in_code: 1

Define Documentation

#define HANDLE_ALIGN (   frag)    sh_handle_align (frag)

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

Definition at line 89 of file tc-sh.h.

#define LISTING_HEADER
Value:
(!target_big_endian \
   ? "Renesas / SuperH SH GAS Little Endian" \
   : "Renesas / SuperH SH GAS Big Endian")

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

#define MAX_MEM_FOR_RS_ALIGN_CODE   (1 + 2)

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

#define md_cons_align (   nbytes)    sh_cons_align (nbytes)

Definition at line 44 of file tc-sh.h.

Definition at line 117 of file tc-sh.h.

#define md_operand (   x)

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

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

Definition at line 81 of file tc-sh.h.

#define SWITCH_TABLE (   FIX)
Value:
((FIX)->fx_addsy != NULL                         \
   && (FIX)->fx_subsy != NULL                           \
   && S_GET_SEGMENT ((FIX)->fx_addsy) == text_section   \
   && S_GET_SEGMENT ((FIX)->fx_subsy) == text_section   \
   && ((FIX)->fx_r_type == BFD_RELOC_32                 \
       || (FIX)->fx_r_type == BFD_RELOC_16              \
       || (FIX)->fx_r_type == BFD_RELOC_8))

Definition at line 63 of file tc-sh.h.

#define TARGET_ARCH   bfd_arch_sh

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

Definition at line 55 of file tc-sh.h.

#define TC_FORCE_RELOCATION_SUB_SAME (   FIX,
  SEC 
)
Value:
(! SEG_NORMAL (SEC)                              \
   || TC_FORCE_RELOCATION (FIX)                         \
   || (sh_relax && SWITCH_TABLE (FIX)))

Definition at line 72 of file tc-sh.h.

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

#define tc_frob_label (   sym)    sh_frob_label (sym)

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

#define TC_FX_SIZE_SLACK (   FIX)    ((FIX)->fx_r_type == BFD_RELOC_SH_COUNT ? -1 : 2)

Definition at line 86 of file tc-sh.h.

Definition at line 99 of file tc-sh.h.

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

#define TC_SH

Definition at line 22 of file tc-sh.h.

#define TC_VALIDATE_FIX_SUB (   FIX)    (sh_relax && SWITCH_TABLE (FIX))

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

Definition at line 41 of file tc-sh.h.


Function Documentation

void sh_cons_align ( int  )

Definition at line 3617 of file tc-sh.c.

{
  int nalign;
  char *p;

  if (sh_no_align_cons)
    {
      /* This is an unaligned pseudo-op.  */
      sh_no_align_cons = 0;
      return;
    }

  nalign = 0;
  while ((nbytes & 1) == 0)
    {
      ++nalign;
      nbytes >>= 1;
    }

  if (nalign == 0)
    return;

  if (now_seg == absolute_section)
    {
      if ((abs_section_offset & ((1 << nalign) - 1)) != 0)
       as_warn (_("misaligned data"));
      return;
    }

  p = frag_var (rs_align_test, 1, 1, (relax_substateT) 0,
              (symbolS *) NULL, (offsetT) nalign, (char *) NULL);

  record_alignment (now_seg, nalign);
}

Here is the call graph for this function:

void sh_flush_pending_output ( void  )

Definition at line 2941 of file tc-sh.c.

{
  if (sh_relax
      && seg_info (now_seg)->tc_segment_info_data.in_code)
    {
      fix_new (frag_now, frag_now_fix (), 2, &abs_symbol, 0, 0,
              BFD_RELOC_SH_DATA);
      seg_info (now_seg)->tc_segment_info_data.in_code = 0;
    }
}

Here is the call graph for this function:

void sh_frob_file ( void  )

Definition at line 3429 of file tc-sh.c.

{
#ifdef HAVE_SH64
  shmedia_frob_file_before_adjust ();
#endif

  if (! sh_relax)
    return;

  bfd_map_over_sections (stdoutput, sh_frob_section, NULL);
}

Here is the call graph for this function:

void sh_frob_label ( symbolS *  )

Definition at line 2914 of file tc-sh.c.

{
  static fragS *last_label_frag;
  static int last_label_offset;

  if (sh_relax
      && seg_info (now_seg)->tc_segment_info_data.in_code)
    {
      int offset;

      offset = frag_now_fix ();
      if (frag_now != last_label_frag
         || offset != last_label_offset)
       {
         fix_new (frag_now, offset, 2, &abs_symbol, 0, 0, BFD_RELOC_SH_LABEL);
         last_label_frag = frag_now;
         last_label_offset = offset;
       }
    }

  dwarf2_emit_label (sym);
}

Here is the call graph for this function:

void sh_handle_align ( fragS *  )

Definition at line 3657 of file tc-sh.c.

{
  int bytes = frag->fr_next->fr_address - frag->fr_address - frag->fr_fix;

  if (frag->fr_type == rs_align_code)
    {
      static const unsigned char big_nop_pattern[] = { 0x00, 0x09 };
      static const unsigned char little_nop_pattern[] = { 0x09, 0x00 };

      char *p = frag->fr_literal + frag->fr_fix;

      if (bytes & 1)
       {
         *p++ = 0;
         bytes--;
         frag->fr_fix += 1;
       }

      if (target_big_endian)
       {
         memcpy (p, big_nop_pattern, sizeof big_nop_pattern);
         frag->fr_var = sizeof big_nop_pattern;
       }
      else
       {
         memcpy (p, little_nop_pattern, sizeof little_nop_pattern);
         frag->fr_var = sizeof little_nop_pattern;
       }
    }
  else if (frag->fr_type == rs_align_test)
    {
      if (bytes != 0)
       as_warn_where (frag->fr_file, frag->fr_line, _("misaligned data"));
    }

  if (sh_relax
      && (frag->fr_type == rs_align
         || frag->fr_type == rs_align_code)
      && frag->fr_address + frag->fr_fix > 0
      && frag->fr_offset > 1
      && now_seg != bss_section)
    fix_new (frag, frag->fr_fix, 2, &abs_symbol, frag->fr_offset, 0,
            BFD_RELOC_SH_ALIGN);
}

Here is the call graph for this function:


Variable Documentation

Definition at line 125 of file tc-sh.c.

Definition at line 129 of file tc-sh.c.