Back to index

cell-binutils  2.17cvs20070401
Functions
ns32k.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

bfd_reloc_status_type _bfd_ns32k_relocate_contents (reloc_howto_type *, bfd *, bfd_vma, bfd_byte *)
bfd_reloc_status_type _bfd_do_ns32k_reloc_contents (reloc_howto_type *, bfd *, bfd_vma, bfd_byte *, bfd_vma(*)(bfd_byte *, int), void(*)(bfd_vma, bfd_byte *, int))
bfd_reloc_status_type _bfd_ns32k_final_link_relocate (reloc_howto_type *, bfd *, asection *, bfd_byte *, bfd_vma, bfd_vma, bfd_vma)
bfd_vma _bfd_ns32k_get_displacement (bfd_byte *, int)
bfd_vma _bfd_ns32k_get_immediate (bfd_byte *, int)
void _bfd_ns32k_put_displacement (bfd_vma, bfd_byte *, int)
void _bfd_ns32k_put_immediate (bfd_vma, bfd_byte *, int)
bfd_reloc_status_type _bfd_ns32k_reloc_disp (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **)
bfd_reloc_status_type _bfd_ns32k_reloc_imm (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **)

Function Documentation

bfd_reloc_status_type _bfd_do_ns32k_reloc_contents ( reloc_howto_type *  ,
bfd ,
bfd_vma  ,
bfd_byte ,
bfd_vma(*)(bfd_byte *, int ,
void(*)(bfd_vma, bfd_byte *, int  
)
bfd_reloc_status_type _bfd_ns32k_final_link_relocate ( reloc_howto_type *  ,
bfd ,
asection ,
bfd_byte ,
bfd_vma  ,
bfd_vma  ,
bfd_vma   
)

Definition at line 792 of file cpu-ns32k.c.

{
  bfd_vma relocation;

  /* Sanity check the address.  */
  if (address > bfd_get_section_limit (input_bfd, input_section))
    return bfd_reloc_outofrange;

  /* This function assumes that we are dealing with a basic relocation
     against a symbol.  We want to compute the value of the symbol to
     relocate to.  This is just VALUE, the value of the symbol, plus
     ADDEND, any addend associated with the reloc.  */
  relocation = value + addend;

  /* If the relocation is PC relative, we want to set RELOCATION to
     the distance between the symbol (currently in RELOCATION) and the
     location we are relocating.  Some targets (e.g., i386-aout)
     arrange for the contents of the section to be the negative of the
     offset of the location within the section; for such targets
     pcrel_offset is FALSE.  Other targets (e.g., m88kbcs or ELF)
     simply leave the contents of the section as zero; for such
     targets pcrel_offset is TRUE.  If pcrel_offset is FALSE we do not
     need to subtract out the offset of the location within the
     section (which is just ADDRESS).  */
  if (howto->pc_relative)
    {
      relocation -= (input_section->output_section->vma
                   + input_section->output_offset);
      if (howto->pcrel_offset)
       relocation -= address;
    }

  return _bfd_ns32k_relocate_contents (howto, input_bfd, relocation,
                                   contents + address);
}

Here is the call graph for this function:

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

{
  bfd_signed_vma value;

  switch (size)
    {
    case 1:
      value = ((*buffer & 0x7f) ^ 0x40) - 0x40;
      break;

    case 2:
      value = ((*buffer++ & 0x3f) ^ 0x20) - 0x20;
      value = (value << 8) | (0xff & *buffer);
      break;

    case 4:
      value = ((*buffer++ & 0x3f) ^ 0x20) - 0x20;
      value = (value << 8) | (0xff & *buffer++);
      value = (value << 8) | (0xff & *buffer++);
      value = (value << 8) | (0xff & *buffer);
      break;

    default:
      abort ();
      return 0;
    }

  return value;
}

Here is the caller graph for this function:

Definition at line 110 of file cpu-ns32k.c.

{
  bfd_vma value = 0;

  switch (size)
    {
    case 4:
      value = (value << 8) | (*buffer++ & 0xff);
      value = (value << 8) | (*buffer++ & 0xff);
    case 2:
      value = (value << 8) | (*buffer++ & 0xff);
    case 1:
      value = (value << 8) | (*buffer++ & 0xff);
      break;
    default:
      abort ();
    }
  return value;
}

Here is the caller graph for this function:

Definition at line 79 of file cpu-ns32k.c.

{
  switch (size)
    {
    case 1:
      value &= 0x7f;
      *buffer++ = value;
      break;

    case 2:
      value &= 0x3fff;
      value |= 0x8000;
      *buffer++ = (value >> 8);
      *buffer++ = value;
      break;

    case 4:
      value |= (bfd_vma) 0xc0000000;
      *buffer++ = (value >> 24);
      *buffer++ = (value >> 16);
      *buffer++ = (value >> 8);
      *buffer++ = value;
      break;
  }
  return;
}

Here is the caller graph for this function:

void _bfd_ns32k_put_immediate ( bfd_vma  ,
bfd_byte ,
int   
)

Definition at line 133 of file cpu-ns32k.c.

{
  buffer += size - 1;
  switch (size)
    {
    case 4:
      *buffer-- = (value & 0xff); value >>= 8;
      *buffer-- = (value & 0xff); value >>= 8;
    case 2:
      *buffer-- = (value & 0xff); value >>= 8;
    case 1:
      *buffer-- = (value & 0xff); value >>= 8;
    }
}

Here is the caller graph for this function:

bfd_reloc_status_type _bfd_ns32k_reloc_disp ( bfd ,
arelent ,
asymbol ,
void *  ,
asection ,
bfd ,
char **   
)
bfd_reloc_status_type _bfd_ns32k_reloc_imm ( bfd ,
arelent ,
asymbol ,
void *  ,
asection ,
bfd ,
char **   
)
bfd_reloc_status_type _bfd_ns32k_relocate_contents ( reloc_howto_type *  ,
bfd ,
bfd_vma  ,
bfd_byte  
)

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;
      break;
    case 1:
      get_data = _bfd_ns32k_get_displacement;
      put_data = _bfd_ns32k_put_displacement;
      break;
    case 2:
      return _bfd_relocate_contents (howto, input_bfd, relocation,
                                location);
    default:
      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: