Back to index

cell-binutils  2.17cvs20070401
Defines | Functions
aout-ns32k.c File Reference
#include "bfd.h"
#include "aout/aout64.h"
#include "ns32k.h"
#include "libaout.h"
#include "aoutx.h"

Go to the source code of this file.


#define MYNS(OP)   CONCAT2 (ns32kaout_,OP)
#define NAME(x, y)   CONCAT3 (ns32kaout,_32_,y)
#define MY(OP)   MYNS (OP)
#define MY_swap_std_reloc_in   MY (swap_std_reloc_in)
#define MY_swap_std_reloc_out   MY (swap_std_reloc_out)
#define CTOR_TABLE_RELOC_HOWTO(BFD)   (MY (howto_table) + 14)
#define RELOC_STD_BITS_NS32K_TYPE_BIG   0x06
#define MY_reloc_howto(BFD, REL, IN, EX, PC)   MY (reloc_howto) (BFD, REL, &IN, &EX, &PC)
#define MY_put_reloc(BFD, EXT, IDX, VAL, HOWTO, RELOC)   MY (put_reloc) (BFD, EXT, IDX, VAL, HOWTO, RELOC)
#define MY_final_link_relocate   _bfd_ns32k_final_link_relocate
#define MY_relocate_contents   _bfd_ns32k_relocate_contents
#define ENTRY(i, j)   case i: return &MY (howto_table)[j]
#define KEEPIT   udata.i


reloc_howto_type *MYNS() bfd_reloc_type_lookup (bfd *, bfd_reloc_code_real_type)
reloc_howto_type *MYNS() bfd_reloc_name_lookup (bfd *, const char *)
bfd_boolean MYNS() write_object_contents (bfd *)
void bfd_ns32k_arch (void)
reloc_howto_type MY (howto_table)[]
static reloc_howto_type *MY() reloc_howto (bfd *abfd ATTRIBUTE_UNUSED, struct reloc_std_external *rel, int *r_index, int *r_extern, int *r_pcrel)
static void MY() put_reloc (bfd *abfd, int r_extern, int r_index, bfd_vma value, reloc_howto_type *howto, struct reloc_std_external *reloc)
static void MY_swap_std_reloc_in (bfd *, struct reloc_std_external *, arelent *, asymbol **, bfd_size_type)
static void MY_swap_std_reloc_out (bfd *, arelent *, struct reloc_std_external *)
reloc_howto_type *MY() bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, const char *r_name)
static void MY_swap_std_reloc_in (bfd *abfd, struct reloc_std_external *bytes, arelent *cache_ptr, asymbol **symbols, bfd_size_type symcount ATTRIBUTE_UNUSED)
bfd_reloc_status_type _bfd_ns32k_relocate_contents (reloc_howto_type *howto, bfd *input_bfd, bfd_vma relocation, bfd_byte *location)

Define Documentation

#define CTOR_TABLE_RELOC_HOWTO (   BFD)    (MY (howto_table) + 14)

Definition at line 135 of file aout-ns32k.c.

#define ENTRY (   i,
)    case i: return &MY (howto_table)[j]
#define KEEPIT   udata.i
#define MY (   OP)    MYNS (OP)

Definition at line 43 of file aout-ns32k.c.

Definition at line 199 of file aout-ns32k.c.

#define MY_put_reloc (   BFD,
)    MY (put_reloc) (BFD, EXT, IDX, VAL, HOWTO, RELOC)

Definition at line 194 of file aout-ns32k.c.

#define MY_reloc_howto (   BFD,
)    MY (reloc_howto) (BFD, REL, &IN, &EX, &PC)

Definition at line 164 of file aout-ns32k.c.

Definition at line 200 of file aout-ns32k.c.

Definition at line 45 of file aout-ns32k.c.

#define MY_swap_std_reloc_out   MY (swap_std_reloc_out)

Definition at line 46 of file aout-ns32k.c.

#define MYNS (   OP)    CONCAT2 (ns32kaout_,OP)

Definition at line 29 of file aout-ns32k.c.

#define NAME (   x,
)    CONCAT3 (ns32kaout,_32_,y)

Definition at line 37 of file aout-ns32k.c.

#define RELOC_STD_BITS_NS32K_TYPE_BIG   0x06

Definition at line 137 of file aout-ns32k.c.

Definition at line 138 of file aout-ns32k.c.

Definition at line 139 of file aout-ns32k.c.

Definition at line 140 of file aout-ns32k.c.


Definition at line 197 of file aout-ns32k.c.

Function Documentation

bfd_reloc_status_type _bfd_ns32k_relocate_contents ( reloc_howto_type *  howto,
bfd input_bfd,
bfd_vma  relocation,
bfd_byte location 

Definition at line 336 of file aout-ns32k.c.

  int r_ns32k_type = (howto - MY (howto_table)) / 6;
  bfd_vma (*get_data) (bfd_byte *, int);
  void (*put_data) (bfd_vma, bfd_byte *, int);

  switch (r_ns32k_type)
    case 0:
      get_data = _bfd_ns32k_get_immediate;
      put_data = _bfd_ns32k_put_immediate;
    case 1:
      get_data = _bfd_ns32k_get_displacement;
      put_data = _bfd_ns32k_put_displacement;
    case 2:
      return _bfd_relocate_contents (howto, input_bfd, relocation,
      return bfd_reloc_notsupported;
  return _bfd_do_ns32k_reloc_contents (howto, input_bfd, relocation,
                                   location, get_data, put_data);

Here is the call graph for this function:

Here is the caller graph for this function:

void bfd_ns32k_arch ( void  )
reloc_howto_type* MYNS() bfd_reloc_name_lookup ( bfd ,
const char *   

Definition at line 4967 of file reloc.c.

  return BFD_SEND (abfd, reloc_name_lookup, (abfd, reloc_name));
reloc_howto_type* MY() bfd_reloc_name_lookup ( bfd *abfd  ATTRIBUTE_UNUSED,
const char *  r_name 

Definition at line 251 of file aout-ns32k.c.

  unsigned int i;

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

  return NULL;

Here is the call graph for this function:

reloc_howto_type* MYNS() bfd_reloc_type_lookup ( bfd abfd,
bfd_reloc_code_real_type  code 
reloc_howto_type MY ( howto_table  )
static void MY_swap_std_reloc_in ( bfd ,
struct reloc_std_external ,
arelent ,
asymbol **  ,
) [static]
static void MY_swap_std_reloc_in ( bfd abfd,
struct reloc_std_external bytes,
arelent cache_ptr,
asymbol **  symbols,
bfd_size_type symcount  ATTRIBUTE_UNUSED 
) [static]

Definition at line 267 of file aout-ns32k.c.

  int r_index;
  int r_extern;
  int r_pcrel;
  struct aoutdata  *su = &(abfd->tdata.aout_data->a);

  cache_ptr->address = H_GET_32 (abfd, bytes->r_address);

  /* Now the fun stuff.  */
  cache_ptr->howto = MY_reloc_howto (abfd, bytes, r_index, r_extern, r_pcrel);

static void MY_swap_std_reloc_out ( bfd abfd,
arelent g,
struct reloc_std_external natptr 
) [static]
static void MY() put_reloc ( bfd abfd,
int  r_extern,
int  r_index,
bfd_vma  value,
reloc_howto_type *  howto,
struct reloc_std_external reloc 
) [static]

Definition at line 168 of file aout-ns32k.c.

  unsigned int r_length;
  int r_pcrel;
  int r_ns32k_type;

  PUT_WORD (abfd, value, reloc->r_address);
  r_length = howto->size ;  /* Size as a power of two.  */
  r_pcrel  = (int) howto->pc_relative; /* Relative to PC?  */
  r_ns32k_type = (howto - MY (howto_table) )/6;

  reloc->r_index[2] = r_index >> 16;
  reloc->r_index[1] = r_index >> 8;
  reloc->r_index[0] = r_index;
  reloc->r_type[0] =
    (r_extern?    RELOC_STD_BITS_EXTERN_LITTLE: 0)
      | (r_pcrel?     RELOC_STD_BITS_PCREL_LITTLE: 0)
       | (r_length <<  RELOC_STD_BITS_LENGTH_SH_LITTLE)
         | (r_ns32k_type <<  RELOC_STD_BITS_NS32K_TYPE_SH_LITTLE);
static reloc_howto_type* MY() reloc_howto ( bfd *abfd  ATTRIBUTE_UNUSED,
struct reloc_std_external rel,
int r_index,
int r_extern,
int r_pcrel 
) [static]

Definition at line 143 of file aout-ns32k.c.

  unsigned int r_length;
  int r_ns32k_type;

  *r_index =  ((rel->r_index[2] << 16)
              | (rel->r_index[1] << 8)
              |  rel->r_index[0] );
  *r_extern  = (0 != (rel->r_type[0] & RELOC_STD_BITS_EXTERN_LITTLE));
  *r_pcrel   = (0 != (rel->r_type[0] & RELOC_STD_BITS_PCREL_LITTLE));
  r_length  =  ((rel->r_type[0] & RELOC_STD_BITS_LENGTH_LITTLE)
  r_ns32k_type  =  ((rel->r_type[0] & RELOC_STD_BITS_NS32K_TYPE_LITTLE)
                  >> RELOC_STD_BITS_NS32K_TYPE_SH_LITTLE);
  return (MY (howto_table) + r_length + 3 * (*r_pcrel) + 6 * r_ns32k_type);