Back to index

cell-binutils  2.17cvs20070401
Classes | Defines | Functions | Variables
elf32-arc.c File Reference
#include "bfd.h"
#include "sysdep.h"
#include "libbfd.h"
#include "elf-bfd.h"
#include "elf/arc.h"
#include "libiberty.h"
#include "elf32-target.h"

Go to the source code of this file.


struct  arc_reloc_map


#define USE_REL   1
#define TARGET_LITTLE_SYM   bfd_elf32_littlearc_vec
#define TARGET_LITTLE_NAME   "elf32-littlearc"
#define TARGET_BIG_SYM   bfd_elf32_bigarc_vec
#define TARGET_BIG_NAME   "elf32-bigarc"
#define ELF_ARCH   bfd_arch_arc
#define ELF_MAXPAGESIZE   0x1000
#define elf_info_to_howto   0
#define elf_info_to_howto_rel   arc_info_to_howto_rel
#define elf_backend_object_p   arc_elf_object_p
#define elf_backend_final_write_processing   arc_elf_final_write_processing


static bfd_reloc_status_type arc_elf_b22_pcrel (bfd *abfd, arelent *reloc_entry, asymbol *symbol, void *data, asection *input_section, bfd *output_bfd, char **error_message)
static reloc_howto_type * bfd_elf32_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, bfd_reloc_code_real_type code)
static reloc_howto_type * bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, const char *r_name)
static void arc_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr, Elf_Internal_Rela *dst)
static bfd_boolean arc_elf_object_p (bfd *abfd)
static void arc_elf_final_write_processing (bfd *abfd, bfd_boolean linker ATTRIBUTE_UNUSED)


static reloc_howto_type elf_arc_howto_table []
static struct arc_reloc_map []

Class Documentation

struct arc_reloc_map

Definition at line 122 of file elf32-arc.c.

Class Members
bfd_reloc_code_real_type bfd_reloc_val
unsigned char elf_reloc_val

Define Documentation

#define ELF_ARCH   bfd_arch_arc

Definition at line 244 of file elf32-arc.c.

Definition at line 251 of file elf32-arc.c.

Definition at line 250 of file elf32-arc.c.

#define elf_info_to_howto   0

Definition at line 248 of file elf32-arc.c.

Definition at line 249 of file elf32-arc.c.


Definition at line 245 of file elf32-arc.c.

#define ELF_MAXPAGESIZE   0x1000

Definition at line 246 of file elf32-arc.c.

#define TARGET_BIG_NAME   "elf32-bigarc"

Definition at line 243 of file elf32-arc.c.

Definition at line 242 of file elf32-arc.c.

#define TARGET_LITTLE_NAME   "elf32-littlearc"

Definition at line 241 of file elf32-arc.c.

Definition at line 240 of file elf32-arc.c.

#define USE_REL   1

Definition at line 33 of file elf32-arc.c.

Function Documentation

static bfd_reloc_status_type arc_elf_b22_pcrel ( bfd abfd,
arelent reloc_entry,
asymbol symbol,
void *  data,
asection input_section,
bfd output_bfd,
char **  error_message 
) [static]

Definition at line 36 of file elf32-arc.c.

  /* If linking, back up the final symbol address by the address of the
     reloc.  This cannot be accomplished by setting the pcrel_offset
     field to TRUE, as bfd_install_relocation will detect this and refuse
     to install the offset in the first place, but bfd_perform_relocation
     will still insist on removing it.  */
  if (output_bfd == NULL)
    reloc_entry->addend -= reloc_entry->address;

  /* Fall through to the default elf reloc handler.  */
  return bfd_elf_generic_reloc (abfd, reloc_entry, symbol, data,
                            input_section, output_bfd, error_message);

Here is the call graph for this function:

static void arc_elf_final_write_processing ( bfd abfd,
bfd_boolean linker  ATTRIBUTE_UNUSED 
) [static]

Definition at line 215 of file elf32-arc.c.

  unsigned long val;

  switch (bfd_get_mach (abfd))
    case bfd_mach_arc_5:
      val = E_ARC_MACH_ARC5;
    case bfd_mach_arc_6:
      val = E_ARC_MACH_ARC6;
    case bfd_mach_arc_7:
      val = E_ARC_MACH_ARC7;
    case bfd_mach_arc_8:
      val = E_ARC_MACH_ARC8;
  elf_elfheader (abfd)->e_flags &=~ EF_ARC_MACH;
  elf_elfheader (abfd)->e_flags |= val;

Here is the call graph for this function:

static bfd_boolean arc_elf_object_p ( bfd abfd) [static]

Definition at line 183 of file elf32-arc.c.

  unsigned int mach = bfd_mach_arc_6;

  if (elf_elfheader(abfd)->e_machine == EM_ARC)
      unsigned long arch = elf_elfheader (abfd)->e_flags & EF_ARC_MACH;

      switch (arch)
       case E_ARC_MACH_ARC5:
         mach = bfd_mach_arc_5;
       case E_ARC_MACH_ARC6:
         mach = bfd_mach_arc_6;
       case E_ARC_MACH_ARC7:
         mach = bfd_mach_arc_7;
       case E_ARC_MACH_ARC8:
         mach = bfd_mach_arc_8;
  return bfd_default_set_arch_mach (abfd, bfd_arch_arc, mach);

Here is the call graph for this function:

static void arc_info_to_howto_rel ( bfd *abfd  ATTRIBUTE_UNUSED,
arelent cache_ptr,
Elf_Internal_Rela dst 
) [static]

Definition at line 169 of file elf32-arc.c.

  unsigned int r_type;

  r_type = ELF32_R_TYPE (dst->r_info);
  BFD_ASSERT (r_type < (unsigned int) R_ARC_max);
  cache_ptr->howto = &elf_arc_howto_table[r_type];
static reloc_howto_type* bfd_elf32_bfd_reloc_name_lookup ( bfd *abfd  ATTRIBUTE_UNUSED,
const char *  r_name 
) [static]

Definition at line 151 of file elf32-arc.c.

  unsigned int i;

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

  return NULL;

Here is the call graph for this function:

static reloc_howto_type* bfd_elf32_bfd_reloc_type_lookup ( bfd *abfd  ATTRIBUTE_UNUSED,
bfd_reloc_code_real_type  code 
) [static]

Definition at line 138 of file elf32-arc.c.

  unsigned int i;

  for (i = ARRAY_SIZE (arc_reloc_map); i--;)
    if (arc_reloc_map[i].bfd_reloc_val == code)
      return elf_arc_howto_table + arc_reloc_map[i].elf_reloc_val;

  return NULL;

Variable Documentation

struct arc_reloc_map[] [static]
Initial value:
  { BFD_RELOC_32, R_ARC_32 },
  { BFD_RELOC_ARC_B26, R_ARC_B26 },

Definition at line 128 of file elf32-arc.c.

reloc_howto_type elf_arc_howto_table[] [static]

Definition at line 57 of file elf32-arc.c.