Back to index

cell-binutils  2.17cvs20070401
Functions
elf-vxworks.h File Reference
#include "elf/common.h"
#include "elf/internal.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

bfd_boolean elf_vxworks_add_symbol_hook (bfd *, struct bfd_link_info *, Elf_Internal_Sym *, const char **, flagword *, asection **, bfd_vma *)
bfd_boolean elf_vxworks_link_output_symbol_hook (struct bfd_link_info *, const char *name, Elf_Internal_Sym *, asection *, struct elf_link_hash_entry *)
bfd_boolean elf_vxworks_emit_relocs (bfd *, asection *, Elf_Internal_Shdr *, Elf_Internal_Rela *, struct elf_link_hash_entry **)
void elf_vxworks_final_write_processing (bfd *, bfd_boolean)
bfd_boolean elf_vxworks_create_dynamic_sections (bfd *, struct bfd_link_info *, asection **)

Function Documentation

bfd_boolean elf_vxworks_add_symbol_hook ( bfd ,
struct bfd_link_info ,
Elf_Internal_Sym *  ,
const char **  ,
flagword ,
asection **  ,
bfd_vma  
)

Definition at line 81 of file elf-vxworks.c.

{
  struct elf_link_hash_table *htab;
  const struct elf_backend_data *bed;
  asection *s;

  htab = elf_hash_table (info);
  bed = get_elf_backend_data (dynobj);

  if (!info->shared)
    {
      s = bfd_make_section_with_flags (dynobj,
                                   bed->default_use_rela_p
                                   ? ".rela.plt.unloaded"
                                   : ".rel.plt.unloaded",
                                   SEC_HAS_CONTENTS | SEC_IN_MEMORY
                                   | SEC_READONLY | SEC_LINKER_CREATED);
      if (s == NULL
         || !bfd_set_section_alignment (dynobj, s, bed->s->log_file_align))
       return FALSE;

      *srelplt2_out = s;
    }

  /* Mark the GOT and PLT symbols as having relocations; they might
     not, but we won't know for sure until we build the GOT in
     finish_dynamic_symbol.  Also make sure that the GOT symbol
     is entered into the dynamic symbol table; the loader uses it
     to initialize __GOTT_BASE__[__GOTT_INDEX__].  */
  if (htab->hgot)
    {
      htab->hgot->indx = -2;
      htab->hgot->other &= ~ELF_ST_VISIBILITY (-1);
      htab->hgot->forced_local = 0;
      if (!bfd_elf_link_record_dynamic_symbol (info, htab->hgot))
       return FALSE;
    }
  if (htab->hplt)
    {
      htab->hplt->indx = -2;
      htab->hplt->type = STT_FUNC;
    }

  return TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 151 of file elf-vxworks.c.

{
  const struct elf_backend_data *bed;
  Elf_Internal_Rela *irela;
  Elf_Internal_Rela *irelaend;
  int j;

  bed = get_elf_backend_data (output_bfd);

  irela = internal_relocs;
  irelaend = irela + (NUM_SHDR_ENTRIES (input_rel_hdr)
                    * bed->s->int_rels_per_ext_rel);
  while (irela < irelaend)
    {
      if ((output_bfd->flags & (DYNAMIC|EXEC_P))
         && *rel_hash
         && (*rel_hash)->def_dynamic
         && !(*rel_hash)->def_regular
         && (*rel_hash)->root.type == bfd_link_hash_defined
         && (*rel_hash)->root.u.def.section->output_section != NULL)
       {
         /* This is a relocation from an executable or shared library
            against a symbol in a different shared library.  We are
            creating a definition in the output file but it does not come
            from any of our normal (.o) files. ie. a PLT stub.
            Normally this would be a relocation against against SHN_UNDEF
            with the VMA of the PLT stub.  This upsets the VxWorks loader.
            Convert it to a section-relative relocation.
            This gets some other symbols (for instance .dynbss),
            but is conservatively correct.  */
         for (j = 0; j < bed->s->int_rels_per_ext_rel; j++)
           {
             asection *sec = (*rel_hash)->root.u.def.section;
             int this_idx = sec->output_section->target_index;

             irela[j].r_info = ELF32_R_INFO (this_idx,
                ELF32_R_TYPE (irela[j].r_info));
             irela[j].r_addend += (*rel_hash)->root.u.def.value;
             irela[j].r_addend += sec->output_offset;
           }
         /* Stop the generic routine adjusting this entry.  */
         *rel_hash = NULL;
       }
      irela += bed->s->int_rels_per_ext_rel;
      rel_hash++;
    }
  return _bfd_elf_link_output_relocs (output_bfd, input_section,
                                  input_rel_hdr, internal_relocs,
                                  rel_hash);
}

Here is the call graph for this function:

bfd_boolean elf_vxworks_link_output_symbol_hook ( struct bfd_link_info ,
const char *  name,
Elf_Internal_Sym *  ,
asection ,
struct elf_link_hash_entry  
)