Back to index

cell-binutils  2.17cvs20070401
Defines | Functions | Variables
coff-tic30.c File Reference
#include "bfd.h"
#include "sysdep.h"
#include "libbfd.h"
#include "bfdlink.h"
#include "coff/tic30.h"
#include "coff/internal.h"
#include "libcoff.h"
#include "coffcode.h"

Go to the source code of this file.

Defines

#define COFF_DEFAULT_SECTION_ALIGNMENT_POWER   (1)
#define coff_bfd_reloc_type_lookup   tic30_coff_reloc_type_lookup
#define coff_bfd_reloc_name_lookup   tic30_coff_reloc_name_lookup
#define SELECT_RELOC(x, howto)   x.r_type = coff_tic30_select_reloc(howto)
#define BADMAG(x)   TIC30BADMAG(x)
#define TIC30   1 /* Customize coffcode.h */
#define __A_MAGIC_SET__
#define SWAP_IN_RELOC_OFFSET   H_GET_32
#define SWAP_OUT_RELOC_OFFSET   H_PUT_32
#define SWAP_OUT_RELOC_EXTRA(abfd, src, dst)
#define RTYPE2HOWTO(internal, relocentry)   rtype2howto (internal, relocentry)
#define CALC_ADDEND(abfd, symbol, ext_reloc, cache_ptr)   cache_ptr->addend = ext_reloc.r_offset;
#define RELOC_PROCESSING(relent, reloc, symbols, abfd, section)   reloc_processing(relent, reloc, symbols, abfd, section)

Functions

static int coff_tic30_select_reloc PARAMS ((reloc_howto_type *))
static void rtype2howto PARAMS ((arelent *, struct internal_reloc *))
static void reloc_processing PARAMS ((arelent *, struct internal_reloc *, asymbol **, bfd *, asection *))
reloc_howto_type
*tic30_coff_reloc_type_lookup 
PARAMS ((bfd *, bfd_reloc_code_real_type))
reloc_howto_type * tic30_coff_reloc_type_lookup (abfd, bfd_reloc_code_real_type code)
static reloc_howto_type * tic30_coff_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, const char *r_name)
static int coff_tic30_select_reloc (reloc_howto_type *howto)
static void rtype2howto (arelent *internal, struct internal_reloc *dst)
static void reloc_processing (arelent *relent, struct internal_reloc *reloc, asymbol **symbols, bfd *abfd, asection *section)

Variables

reloc_howto_type tic30_coff_howto_table []
const bfd_target tic30_coff_vec

Define Documentation

#define __A_MAGIC_SET__

Definition at line 117 of file coff-tic30.c.

#define BADMAG (   x)    TIC30BADMAG(x)

Definition at line 115 of file coff-tic30.c.

#define CALC_ADDEND (   abfd,
  symbol,
  ext_reloc,
  cache_ptr 
)    cache_ptr->addend = ext_reloc.r_offset;

Definition at line 159 of file coff-tic30.c.

Definition at line 56 of file coff-tic30.c.

Definition at line 55 of file coff-tic30.c.

Definition at line 37 of file coff-tic30.c.

#define RELOC_PROCESSING (   relent,
  reloc,
  symbols,
  abfd,
  section 
)    reloc_processing(relent, reloc, symbols, abfd, section)

Definition at line 162 of file coff-tic30.c.

#define RTYPE2HOWTO (   internal,
  relocentry 
)    rtype2howto (internal, relocentry)

Definition at line 155 of file coff-tic30.c.

#define SELECT_RELOC (   x,
  howto 
)    x.r_type = coff_tic30_select_reloc(howto)

Definition at line 113 of file coff-tic30.c.

Definition at line 120 of file coff-tic30.c.

#define SWAP_OUT_RELOC_EXTRA (   abfd,
  src,
  dst 
)
Value:
dst->r_stuff[0] = 'S'; \
dst->r_stuff[1] = 'C';

Definition at line 122 of file coff-tic30.c.

Definition at line 121 of file coff-tic30.c.

#define TIC30   1 /* Customize coffcode.h */

Definition at line 116 of file coff-tic30.c.


Function Documentation

static int coff_tic30_select_reloc ( reloc_howto_type *  howto) [static]

Definition at line 107 of file coff-tic30.c.

{
  return howto->type;
}
static int coff_tic30_select_reloc PARAMS ( (reloc_howto_type *)  ) [static]
static void rtype2howto PARAMS ( (arelent *, struct internal_reloc *)  ) [static]
static void reloc_processing PARAMS ( (arelent *, struct internal_reloc *, asymbol **, bfd *, asection *)  ) [static]
static void reloc_processing ( arelent relent,
struct internal_reloc reloc,
asymbol **  symbols,
bfd abfd,
asection section 
) [static]

Definition at line 166 of file coff-tic30.c.

{
  relent->address = reloc->r_vaddr;
  rtype2howto (relent, reloc);

  if (reloc->r_symndx > 0)
    relent->sym_ptr_ptr = symbols + obj_convert (abfd)[reloc->r_symndx];
  else
    relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;

  relent->addend = reloc->r_offset;
  relent->address -= section->vma;
}

Here is the call graph for this function:

static void rtype2howto ( arelent internal,
struct internal_reloc dst 
) [static]

Definition at line 128 of file coff-tic30.c.

{
  switch (dst->r_type)
    {
    case R_TIC30_ABS16:
      internal->howto = &tic30_coff_howto_table[0];
      break;
    case R_TIC30_ABS24:
      internal->howto = &tic30_coff_howto_table[1];
      break;
    case R_TIC30_ABS32:
      internal->howto = &tic30_coff_howto_table[3];
      break;
    case R_TIC30_LDP:
      internal->howto = &tic30_coff_howto_table[2];
      break;
    case R_TIC30_PC16:
      internal->howto = &tic30_coff_howto_table[4];
      break;
    default:
      abort ();
      break;
    }
}

Here is the caller graph for this function:

static reloc_howto_type* tic30_coff_reloc_name_lookup ( bfd *abfd  ATTRIBUTE_UNUSED,
const char *  r_name 
) [static]

Definition at line 86 of file coff-tic30.c.

{
  unsigned int i;

  for (i = 0;
       i < (sizeof (tic30_coff_howto_table)
           / sizeof (tic30_coff_howto_table[0]));
       i++)
    if (tic30_coff_howto_table[i].name != NULL
       && strcasecmp (tic30_coff_howto_table[i].name, r_name) == 0)
      return &tic30_coff_howto_table[i];

  return NULL;
}

Here is the call graph for this function:

reloc_howto_type* tic30_coff_reloc_type_lookup ( abfd  ,
bfd_reloc_code_real_type  code 
)

Definition at line 63 of file coff-tic30.c.

{
  switch (code)
    {
    case BFD_RELOC_8:
    case BFD_RELOC_TIC30_LDP:
      return &tic30_coff_howto_table[2];
    case BFD_RELOC_16:
      return &tic30_coff_howto_table[0];
    case BFD_RELOC_24:
      return &tic30_coff_howto_table[1];
    case BFD_RELOC_16_PCREL:
      return &tic30_coff_howto_table[4];
    case BFD_RELOC_32:
      return &tic30_coff_howto_table[3];
    default:
      return (reloc_howto_type *) NULL;
    }
}

Variable Documentation

reloc_howto_type tic30_coff_howto_table[]
Initial value:
  {
    HOWTO (R_TIC30_ABS16, 2, 1, 16, FALSE, 0, 0, NULL,
          "16", FALSE, 0x0000FFFF, 0x0000FFFF, FALSE),
    HOWTO (R_TIC30_ABS24, 2, 2, 24, FALSE, 8, complain_overflow_bitfield, NULL,
          "24", FALSE, 0xFFFFFF00, 0xFFFFFF00, FALSE),
    HOWTO (R_TIC30_LDP, 18, 0, 24, FALSE, 0, complain_overflow_bitfield, NULL,
          "LDP", FALSE, 0x00FF0000, 0x000000FF, FALSE),
    HOWTO (R_TIC30_ABS32, 2, 2, 32, FALSE, 0, complain_overflow_bitfield, NULL,
          "32", FALSE, 0xFFFFFFFF, 0xFFFFFFFF, FALSE),
    HOWTO (R_TIC30_PC16, 2, 1, 16, TRUE, 0, complain_overflow_signed, NULL,
          "PCREL", FALSE, 0x0000FFFF, 0x0000FFFF, FALSE),

  }

Definition at line 39 of file coff-tic30.c.

Definition at line 187 of file coff-tic30.c.