PPL Logo

conv-core/loadsym.c File Reference

Go to the source code of this file.

Data Structures

struct  symlist
struct  symtab
struct  mm

Typedefs

typedef Elf64_Addr ELFXX_TYPE_Addr
typedef Elf64_Dyn ELFXX_TYPE_Dyn
typedef Elf64_Rela ELFXX_TYPE_Rel
typedef Elf64_Sym ELFXX_TYPE_Sym
typedef Elf64_Shdr ELFXX_TYPE_Shdr
typedef Elf64_Ehdr ELFXX_TYPE_Ehdr
typedef struct symtabsymtab_t

Functions

ssize_t pread (int fd, void *buf, size_t count, off_t offset)
static struct symlistget_syms (int fd, ELFXX_TYPE_Shdr *symh, ELFXX_TYPE_Shdr *strh)
static int do_load (int fd, symtab_t symtab)
static symtab_t load_symtab (char *filename)
static int lookup2 (struct symlist *sl, unsigned char type, char *name, unsigned long *val, unsigned int *size)
static int lookup_sym (symtab_t s, unsigned char type, char *name, unsigned long *val, int *size)
static int load_memmap ()
static int match_libc (const char *name)
static int find_my_libc (char *name, int len, unsigned long *start)
static int patch (unsigned long from, unsigned long to)
int lookup_obj_sym (char *name, unsigned long *val, int *size)
int init_symtab (char *exename)

Variables

static struct mm mm [50]
static int nmm
static symtab_t symtab
static unsigned long libc


Typedef Documentation

typedef Elf32_Addr ELFXX_TYPE_Addr

Definition at line 44 of file loadsym.c.

typedef Elf32_Dyn ELFXX_TYPE_Dyn

Definition at line 45 of file loadsym.c.

typedef Elf32_Rel ELFXX_TYPE_Rel

Definition at line 46 of file loadsym.c.

typedef Elf32_Sym ELFXX_TYPE_Sym

Definition at line 47 of file loadsym.c.

typedef Elf32_Shdr ELFXX_TYPE_Shdr

Definition at line 48 of file loadsym.c.

typedef Elf32_Ehdr ELFXX_TYPE_Ehdr

Definition at line 49 of file loadsym.c.

typedef struct symtab* symtab_t

Definition at line 74 of file loadsym.c.


Function Documentation

ssize_t pread ( int  fd,
void *  buf,
size_t  count,
off_t  offset 
)

static struct symlist* get_syms ( int  fd,
ELFXX_TYPE_Shdr symh,
ELFXX_TYPE_Shdr strh 
) [static, read]

Definition at line 100 of file loadsym.c.

References malloc(), symlist::num, pread(), symlist::str, and symlist::sym.

Referenced by do_load().

static int do_load ( int  fd,
symtab_t  symtab 
) [static]

Definition at line 159 of file loadsym.c.

References symtab::dyn, free(), get_syms(), malloc(), p, pread(), size, and symtab::st.

Referenced by load_symtab().

static symtab_t load_symtab ( char *  filename  )  [static]

Definition at line 282 of file loadsym.c.

References do_load(), free(), and malloc().

Referenced by init_symtab().

static int lookup2 ( struct symlist sl,
unsigned char  type,
char *  name,
unsigned long *  val,
unsigned int size 
) [static]

Definition at line 311 of file loadsym.c.

References symlist::num, p, symlist::str, and symlist::sym.

Referenced by lookup_sym().

static int lookup_sym ( symtab_t  s,
unsigned char  type,
char *  name,
unsigned long *  val,
int size 
) [static]

Definition at line 332 of file loadsym.c.

References symtab::dyn, lookup2(), and symtab::st.

Referenced by lookup_obj_sym().

static int load_memmap (  )  [static]

Definition at line 343 of file loadsym.c.

References mm::end, mm::name, p, and mm::start.

Referenced by find_my_libc().

static int match_libc ( const char *  name  )  [static]

Definition at line 414 of file loadsym.c.

References p.

Referenced by find_my_libc().

static int find_my_libc ( char *  name,
int  len,
unsigned long *  start 
) [static]

Definition at line 437 of file loadsym.c.

References load_memmap(), match_libc(), mm::name, and mm::start.

static int patch ( unsigned long  from,
unsigned long  to 
) [static]

Definition at line 465 of file loadsym.c.

References getpagesize(), and p.

int lookup_obj_sym ( char *  name,
unsigned long *  val,
int size 
)

Definition at line 495 of file loadsym.c.

References lookup_sym().

Referenced by CtgGlobalList::CtgGlobalList().

int init_symtab ( char *  exename  ) 

Definition at line 505 of file loadsym.c.

References load_symtab().

Referenced by CtgInit().


Variable Documentation

struct mm mm[50] [static]

Definition at line 93 of file loadsym.c.

int nmm [static]

Definition at line 94 of file loadsym.c.

symtab_t symtab [static]

Definition at line 491 of file loadsym.c.

unsigned long libc [static]

Definition at line 492 of file loadsym.c.


Generated on Sat May 26 08:08:07 2012 for Charm++ by  doxygen 1.5.5