Back to index

cell-binutils  2.17cvs20070401
Defines | Functions
elf32-hppa.h File Reference
#include "elf-bfd.h"
#include "libhppa.h"
#include "elf/hppa.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define R_HPPA_NONE   R_PARISC_NONE
#define R_HPPA   R_PARISC_DIR32
#define R_HPPA_GOTOFF   R_PARISC_DPREL21L
#define R_HPPA_PCREL_CALL   R_PARISC_PCREL21L
#define R_HPPA_ABS_CALL   R_PARISC_DIR17F
#define R_HPPA_COMPLEX   R_PARISC_UNIMPLEMENTED

Functions

int elf32_hppa_setup_section_lists (bfd *, struct bfd_link_info *)
void elf32_hppa_next_input_section (struct bfd_link_info *, asection *)
bfd_boolean elf32_hppa_size_stubs (bfd *, bfd *, struct bfd_link_info *, bfd_boolean, bfd_signed_vma, asection *(*)(const char *, asection *), void(*)(void))
bfd_boolean elf32_hppa_set_gp (bfd *, struct bfd_link_info *)
bfd_boolean elf32_hppa_build_stubs (struct bfd_link_info *)
elf_hppa_reloc_type elf32_hppa_reloc_final_type (bfd *, elf_hppa_reloc_type, int, unsigned int)
elf_hppa_reloc_type ** _bfd_elf32_hppa_gen_reloc_type (bfd *, elf_hppa_reloc_type, int, unsigned int, int, asymbol *)

Define Documentation

#define R_HPPA   R_PARISC_DIR32

Definition at line 71 of file elf32-hppa.h.

#define R_HPPA_ABS_CALL   R_PARISC_DIR17F

Definition at line 74 of file elf32-hppa.h.

#define R_HPPA_COMPLEX   R_PARISC_UNIMPLEMENTED

Definition at line 75 of file elf32-hppa.h.

#define R_HPPA_GOTOFF   R_PARISC_DPREL21L

Definition at line 72 of file elf32-hppa.h.

#define R_HPPA_NONE   R_PARISC_NONE

Definition at line 70 of file elf32-hppa.h.

#define R_HPPA_PCREL_CALL   R_PARISC_PCREL21L

Definition at line 73 of file elf32-hppa.h.


Function Documentation

elf_hppa_reloc_type** _bfd_elf32_hppa_gen_reloc_type ( bfd ,
elf_hppa_reloc_type  ,
int  ,
unsigned  int,
int  ,
asymbol  
)

Definition at line 3203 of file elf32-hppa.c.

{
  asection *stub_sec;
  struct bfd_hash_table *table;
  struct elf32_hppa_link_hash_table *htab;

  htab = hppa_link_hash_table (info);

  for (stub_sec = htab->stub_bfd->sections;
       stub_sec != NULL;
       stub_sec = stub_sec->next)
    {
      bfd_size_type size;

      /* Allocate memory to hold the linker stubs.  */
      size = stub_sec->size;
      stub_sec->contents = bfd_zalloc (htab->stub_bfd, size);
      if (stub_sec->contents == NULL && size != 0)
       return FALSE;
      stub_sec->size = 0;
    }

  /* Build the stubs as directed by the stub hash table.  */
  table = &htab->bstab;
  bfd_hash_traverse (table, hppa_build_one_stub, info);

  return TRUE;
}

Here is the call graph for this function:

Definition at line 2607 of file elf32-hppa.c.

{
  struct elf32_hppa_link_hash_table *htab = hppa_link_hash_table (info);

  if (isec->output_section->index <= htab->top_index)
    {
      asection **list = htab->input_list + isec->output_section->index;
      if (*list != bfd_abs_section_ptr)
       {
         /* Steal the link_sec pointer for our list.  */
#define PREV_SEC(sec) (htab->stub_group[(sec)->id].link_sec)
         /* This happens to make the list in reverse order,
            which is what we want.  */
         PREV_SEC (isec) = *list;
         *list = isec;
       }
    }
}
elf_hppa_reloc_type elf32_hppa_reloc_final_type ( bfd ,
elf_hppa_reloc_type  ,
int  ,
unsigned  int 
)

Definition at line 3118 of file elf32-hppa.c.

{
  struct bfd_link_hash_entry *h;
  asection *sec = NULL;
  bfd_vma gp_val = 0;
  struct elf32_hppa_link_hash_table *htab;

  htab = hppa_link_hash_table (info);
  h = bfd_link_hash_lookup (&htab->etab.root, "$global$", FALSE, FALSE, FALSE);

  if (h != NULL
      && (h->type == bfd_link_hash_defined
         || h->type == bfd_link_hash_defweak))
    {
      gp_val = h->u.def.value;
      sec = h->u.def.section;
    }
  else
    {
      asection *splt = bfd_get_section_by_name (abfd, ".plt");
      asection *sgot = bfd_get_section_by_name (abfd, ".got");

      /* Choose to point our LTP at, in this order, one of .plt, .got,
        or .data, if these sections exist.  In the case of choosing
        .plt try to make the LTP ideal for addressing anywhere in the
        .plt or .got with a 14 bit signed offset.  Typically, the end
        of the .plt is the start of the .got, so choose .plt + 0x2000
        if either the .plt or .got is larger than 0x2000.  If both
        the .plt and .got are smaller than 0x2000, choose the end of
        the .plt section.  */
      sec = strcmp (bfd_get_target (abfd), "elf32-hppa-netbsd") == 0
         ? NULL : splt;
      if (sec != NULL)
       {
         gp_val = sec->size;
         if (gp_val > 0x2000 || (sgot && sgot->size > 0x2000))
           {
             gp_val = 0x2000;
           }
       }
      else
       {
         sec = sgot;
         if (sec != NULL)
           {
             if (strcmp (bfd_get_target (abfd), "elf32-hppa-netbsd") != 0)
              {
                 /* We know we don't have a .plt.  If .got is large,
                   offset our LTP.  */
                 if (sec->size > 0x2000)
                  gp_val = 0x2000;
              }
           }
         else
           {
             /* No .plt or .got.  Who cares what the LTP is?  */
             sec = bfd_get_section_by_name (abfd, ".data");
           }
       }

      if (h != NULL)
       {
         h->type = bfd_link_hash_defined;
         h->u.def.value = gp_val;
         if (sec != NULL)
           h->u.def.section = sec;
         else
           h->u.def.section = bfd_abs_section_ptr;
       }
    }

  if (sec != NULL && sec->output_section != NULL)
    gp_val += sec->output_section->vma + sec->output_offset;

  elf_gp (abfd) = gp_val;
  return TRUE;
}

Here is the call graph for this function:

Definition at line 2534 of file elf32-hppa.c.

{
  bfd *input_bfd;
  unsigned int bfd_count;
  int top_id, top_index;
  asection *section;
  asection **input_list, **list;
  bfd_size_type amt;
  struct elf32_hppa_link_hash_table *htab = hppa_link_hash_table (info);

  /* Count the number of input BFDs and find the top input section id.  */
  for (input_bfd = info->input_bfds, bfd_count = 0, top_id = 0;
       input_bfd != NULL;
       input_bfd = input_bfd->link_next)
    {
      bfd_count += 1;
      for (section = input_bfd->sections;
          section != NULL;
          section = section->next)
       {
         if (top_id < section->id)
           top_id = section->id;
       }
    }
  htab->bfd_count = bfd_count;

  amt = sizeof (struct map_stub) * (top_id + 1);
  htab->stub_group = bfd_zmalloc (amt);
  if (htab->stub_group == NULL)
    return -1;

  /* We can't use output_bfd->section_count here to find the top output
     section index as some sections may have been removed, and
     strip_excluded_output_sections doesn't renumber the indices.  */
  for (section = output_bfd->sections, top_index = 0;
       section != NULL;
       section = section->next)
    {
      if (top_index < section->index)
       top_index = section->index;
    }

  htab->top_index = top_index;
  amt = sizeof (asection *) * (top_index + 1);
  input_list = bfd_malloc (amt);
  htab->input_list = input_list;
  if (input_list == NULL)
    return -1;

  /* For sections we aren't interested in, mark their entries with a
     value we can check later.  */
  list = input_list + top_index;
  do
    *list = bfd_abs_section_ptr;
  while (list-- != input_list);

  for (section = output_bfd->sections;
       section != NULL;
       section = section->next)
    {
      if ((section->flags & SEC_CODE) != 0)
       input_list[section->index] = NULL;
    }

  return 1;
}

Here is the call graph for this function:

bfd_boolean elf32_hppa_size_stubs ( bfd ,
bfd ,
struct bfd_link_info ,
bfd_boolean  ,
bfd_signed_vma  ,
asection *)(const char *, asection *,
void(*)(void)   
)