Back to index

glibc  2.9
Defines | Functions | Variables
dl-machine.h File Reference
#include <string.h>
#include <link.h>

Go to the source code of this file.

Defines

#define ELF_MACHINE_NAME   "stub"
#define RTLD_START   #error need some startup code

Functions

static int elf_machine_matches_host (const Elf32_Ehdr *ehdr)
static Elf32_Addr elf_machine_dynamic (void)
static Elf32_Addr elf_machine_load_address (void)
static Elf32_Addr elf_machine_fixup_plt (struct link_map *map, lookup_t t, const Elf32_Rel *reloc, Elf32_Addr *reloc_addr, Elf32_Addr value)
auto void __attribute__ ((always_inline)) elf_machine_rel(Elf32_Addr loadaddr
static int elf_machine_runtime_setup (struct link_map *l, int lazy)

Variables

auto void Elf32_Dyninfo [DT_NUM]
auto void Elf32_Dyn const
Elf32_Rel
reloc
auto void Elf32_Dyn const
Elf32_Rel const Elf32_Sym
sym
auto void Elf32_Dyn const
Elf32_Rel const Elf32_Sym
Elf32_Addr(* 
resolve )(const Elf32_Sym **ref, Elf32_Addr reloc_addr, int noplt))

Define Documentation

#define ELF_MACHINE_NAME   "stub"

Definition at line 21 of file dl-machine.h.

#define RTLD_START   #error need some startup code

Definition at line 135 of file dl-machine.h.


Function Documentation

auto void __attribute__ ( (always_inline)  ) [inline]
static Elf32_Addr elf_machine_dynamic ( void  ) [inline, static]

Definition at line 41 of file dl-machine.h.

{
#error "Damn, no _DYNAMIC"
}
static Elf32_Addr elf_machine_fixup_plt ( struct link_map map,
lookup_t  t,
const Elf32_Rel reloc,
Elf32_Addr reloc_addr,
Elf32_Addr  value 
) [inline, static]

Definition at line 57 of file dl-machine.h.

{
  return *reloc_addr = value;
}
static Elf32_Addr elf_machine_load_address ( void  ) [inline, static]

Definition at line 49 of file dl-machine.h.

{
#error "Where am I?"
}
static int elf_machine_matches_host ( const Elf32_Ehdr ehdr) [inline, static]

Definition at line 29 of file dl-machine.h.

{
  switch (ehdr->e_machine)
    {
    default:
      return 0;
    }
}
static int elf_machine_runtime_setup ( struct link_map l,
int  lazy 
) [inline, static]

Definition at line 109 of file dl-machine.h.

{
  extern void _dl_runtime_resolve (Elf32_Word);

  if (lazy)
    {
      /* The GOT entries for functions in the PLT have not yet been filled
         in.  Their initial contents will arrange when called to push an
         offset into the .rel.plt section, push _GLOBAL_OFFSET_TABLE_[1],
         and then jump to _GLOBAL_OFFSET_TABLE[2].  */
      Elf32_Addr *got = (Elf32_Addr *) D_PTR (l, l_info[DT_PLTGOT]);
      got[1] = (Elf32_Addr) l;     /* Identify this shared object.  */

      /* This function will get called to fix up the GOT entry indicated by
         the offset on the stack, and then jump to the resolved address.  */
      got[2] = (Elf32_Addr) &_dl_runtime_resolve;
    }

  return lazy;
}

Variable Documentation

Definition at line 70 of file dl-machine.h.

Definition at line 70 of file dl-machine.h.

Definition at line 72 of file dl-machine.h.

{
  Elf32_Addr *const reloc_addr = (Elf32_Addr *) reloc->r_offset;
  Elf32_Addr loadbase;

  switch (ELF32_R_TYPE (reloc->r_info))
    {
    case R_MACHINE_COPY:
      loadbase = (*resolve) (&sym, (Elf32_Addr) reloc_addr, 0);
      memcpy (reloc_addr, (void *) (loadbase + sym->st_value), sym->st_size);
      break;
    default:
      _dl_reloc_bad_type (map, ELF32_R_TYPE (reloc->r_info), 0);
      break;
    }
}

Definition at line 70 of file dl-machine.h.