Object-elf.C File Reference

#include "Type.h"
#include "Variable.h"
#include "Symbol.h"
#include "Symtab.h"
#include "Object.h"
#include "emitElf.h"
#include "Module.h"
#include "Aggregate.h"
#include "Function.h"
#include "debug.h"
#include "dwarf/h/dwarfHandle.h"
#include "dwarfWalker.h"
#include <elf.h>
#include <stdio.h>
#include <algorithm>
#include "common/h/pathName.h"
#include "Collections.h"
#include <iostream>
#include <iomanip>
#include <fstream>
#include <sys/stat.h>
#include <boost/assign/list_of.hpp>
#include <boost/assign/std/set.hpp>
#include "dynutil/h/SymReader.h"
#include <libgen.h>

Go to the source code of this file.

Data Structures

struct  SectionHeaderSortFunction

Defines

#define EXTRA_SPACE   8

Functions

void print_symbols (std::vector< Symbol * > &allsymbols)
void print_symbol_map (dyn_hash_map< std::string, std::vector< Symbol * > > *symbols)
static bool pdelf_check_ehdr (Elf_X &elf)
const char * pdelf_get_shnames (Elf_X *elf)
Region::perm_t getSegmentPerms (unsigned long flags)
Region::RegionType getSegmentType (unsigned long type, unsigned long flags)
Region::perm_t getRegionPerms (unsigned long flags)
Region::RegionType getRegionType (unsigned long type, unsigned long flags, const char *reg_name)
static Region::RegionType getRelTypeByElfMachine (Elf_X *localHdr)
static Symbol::SymbolType pdelf_type (int elf_type)
static Symbol::SymbolLinkage pdelf_linkage (int elf_binding)
static Symbol::SymbolVisibility pdelf_visibility (int elf_visibility)
bool lookUpSymbol (std::vector< Symbol * > &allsymbols, Offset &addr)
bool lookUpAddress (std::vector< Offset > &jumpTargets, Offset &addr)
void printSyms (std::vector< Symbol * > &allsymbols)
bool parseCompilerType (Object *objPtr)
bool sort_dbg_map (const Object::DbgAddrConversion_t &a, const Object::DbgAddrConversion_t &b)

Variables

string symt_current_func_name
string symt_current_mangled_func_name
Symbolsymt_current_func = NULL
std::vector< Symbol * > opdsymbols_
void(* dwarf_err_func )(const char *)
const char * EDITED_TEXT_NAME = ".edited.text"
const char * INTERP_NAME = ".interp"
const char * FINI_NAME = ".fini"
const char * TEXT_NAME = ".text"
const char * BSS_NAME = ".bss"
const char * SYMTAB_NAME = ".symtab"
const char * STRTAB_NAME = ".strtab"
const char * STAB_NAME = ".stab"
const char * STABSTR_NAME = ".stabstr"
const char * STAB_INDX_NAME = ".stab.index"
const char * STABSTR_INDX_NAME = ".stab.indexstr"
const char * COMMENT_NAME = ".comment"
const char * OPD_NAME = ".opd"
const char * PLT_NAME = ".plt"
const char * REL_PLT_NAME = ".rela.plt"
const char * REL_PLT_NAME2 = ".rel.plt"
const char * GOT_NAME = ".got"
const char * DYNSYM_NAME = ".dynsym"
const char * DYNSTR_NAME = ".dynstr"
const char * DATA_NAME = ".data"
const char * RO_DATA_NAME = ".ro_data"
const char * DYNAMIC_NAME = ".dynamic"
const char * EH_FRAME_NAME = ".eh_frame"
const char * EXCEPT_NAME = ".gcc_except_table"
const char * EXCEPT_NAME_ALT = ".except_table"
set< string > debugInfoSections

Define Documentation

#define EXTRA_SPACE   8

Definition at line 99 of file Object-elf.C.

Referenced by Dyninst::SymtabAPI::Object::loaded_elf().


Function Documentation

Region::perm_t getRegionPerms ( unsigned long  flags  ) 
Region::RegionType getRegionType ( unsigned long  type,
unsigned long  flags,
const char *  reg_name 
)
static Region::RegionType getRelTypeByElfMachine ( Elf_X localHdr  )  [static]
Region::perm_t getSegmentPerms ( unsigned long  flags  ) 
Region::RegionType getSegmentType ( unsigned long  type,
unsigned long  flags 
)

Definition at line 165 of file Object-elf.C.

Referenced by Dyninst::SymtabAPI::Object::find_code_and_data().

bool lookUpAddress ( std::vector< Offset > &  jumpTargets,
Offset &  addr 
)

Definition at line 1919 of file Object-elf.C.

bool lookUpSymbol ( std::vector< Symbol * > &  allsymbols,
Offset &  addr 
)

Definition at line 1907 of file Object-elf.C.

bool parseCompilerType ( Object objPtr  ) 
static bool pdelf_check_ehdr ( Elf_X elf  )  [static]
const char* pdelf_get_shnames ( Elf_X elf  ) 
static Symbol::SymbolLinkage pdelf_linkage ( int  elf_binding  )  [static]
static Symbol::SymbolType pdelf_type ( int  elf_type  )  [static]
static Symbol::SymbolVisibility pdelf_visibility ( int  elf_visibility  )  [static]
void print_symbol_map ( dyn_hash_map< std::string, std::vector< Symbol * > > *  symbols  ) 
void print_symbols ( std::vector< Symbol * > &  allsymbols  ) 

Definition at line 61 of file Object.C.

Referenced by Dyninst::SymtabAPI::Object::emitDriver(), and print_symbol_map().

void printSyms ( std::vector< Symbol * > &  allsymbols  ) 

Definition at line 1932 of file Object-elf.C.

References getType(), and Dyninst::SymtabAPI::Symbol::ST_FUNCTION.

bool sort_dbg_map ( const Object::DbgAddrConversion_t &  a,
const Object::DbgAddrConversion_t &  b 
)

Definition at line 5258 of file Object-elf.C.

Referenced by Dyninst::SymtabAPI::Object::convertDebugOffset().


Variable Documentation

const char* BSS_NAME = ".bss"
const char* COMMENT_NAME = ".comment"

Definition at line 321 of file Object-elf.C.

Referenced by Dyninst::SymtabAPI::Object::loaded_elf().

const char* DATA_NAME = ".data"
set<string> debugInfoSections
Initial value:
 list_of(string(SYMTAB_NAME))
  (string(STRTAB_NAME))

Definition at line 341 of file Object-elf.C.

void(* dwarf_err_func)(const char *)
const char* DYNAMIC_NAME = ".dynamic"

Definition at line 336 of file Object-elf.C.

Referenced by Dyninst::SymtabAPI::Object::get_relocation_entries().

const char* DYNSTR_NAME = ".dynstr"

Definition at line 333 of file Object-elf.C.

const char* DYNSYM_NAME = ".dynsym"

Definition at line 332 of file Object-elf.C.

const char* EDITED_TEXT_NAME = ".edited.text"

Definition at line 309 of file Object-elf.C.

Referenced by Dyninst::SymtabAPI::Object::loaded_elf().

const char* EH_FRAME_NAME = ".eh_frame"

Definition at line 337 of file Object-elf.C.

Referenced by Dyninst::SymtabAPI::Object::loaded_elf().

const char* EXCEPT_NAME = ".gcc_except_table"

Definition at line 338 of file Object-elf.C.

Referenced by Dyninst::SymtabAPI::Object::loaded_elf().

const char* EXCEPT_NAME_ALT = ".except_table"

Definition at line 339 of file Object-elf.C.

Referenced by Dyninst::SymtabAPI::Object::loaded_elf().

const char* FINI_NAME = ".fini"

Definition at line 312 of file Object-elf.C.

const char* GOT_NAME = ".got"
const char* INTERP_NAME = ".interp"

Definition at line 311 of file Object-elf.C.

Referenced by Dyninst::SymtabAPI::Object::loaded_elf().

const char* OPD_NAME = ".opd"
std::vector<Symbol *> opdsymbols_
const char* PLT_NAME = ".plt"
const char* REL_PLT_NAME = ".rela.plt"
const char* REL_PLT_NAME2 = ".rel.plt"

Definition at line 330 of file Object-elf.C.

Referenced by Dyninst::SymtabAPI::Object::loaded_elf().

const char* RO_DATA_NAME = ".ro_data"

Definition at line 335 of file Object-elf.C.

Referenced by Dyninst::SymtabAPI::Object::loaded_elf().

const char* STAB_INDX_NAME = ".stab.index"

Definition at line 319 of file Object-elf.C.

Referenced by Dyninst::SymtabAPI::Object::loaded_elf().

const char* STAB_NAME = ".stab"

Definition at line 317 of file Object-elf.C.

Referenced by Dyninst::SymtabAPI::Object::loaded_elf().

const char* STABSTR_INDX_NAME = ".stab.indexstr"

Definition at line 320 of file Object-elf.C.

Referenced by Dyninst::SymtabAPI::Object::loaded_elf().

const char* STABSTR_NAME = ".stabstr"

Definition at line 318 of file Object-elf.C.

Referenced by Dyninst::SymtabAPI::Object::loaded_elf().

const char* STRTAB_NAME = ".strtab"

Definition at line 316 of file Object-elf.C.

Referenced by Dyninst::SymtabAPI::Object::loaded_elf().

Definition at line 105 of file Object-elf.C.

const char* SYMTAB_NAME = ".symtab"

Definition at line 315 of file Object-elf.C.

Referenced by Dyninst::SymtabAPI::Object::loaded_elf().

const char* TEXT_NAME = ".text"

Definition at line 313 of file Object-elf.C.

Referenced by Dyninst::SymtabAPI::Object::loaded_elf().

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 12 Jul 2013 for SymtabAPI by  doxygen 1.6.1