|
|
Interned Symbols from Elf objects
Each symbol interned from an Elf object has a corresponding Csym which is mapped into the store and contains storage for the symbol.
In the case of a DATA or VTBL type Csym, the storage contains the content of the symbol from the original Elf. In the case of a FUNCTION type, the storage contains an absolute JMP into the Elf object's function.
enum Type {FUNCTION, DATA, VTBL, UNKNOWN } |
symbol type FUNCTION a function symbol DATA a data symbol VTBL a vtable UNKNOWN not found
const Elf * in |
Elf this Csym is in
const char * symname () |
Csym's mangled name
Returns: mangled name of Csym
void * address () |
address of the Csym's coldstored content
Returns: address of the symbol's content
Throws: undefined
void * vtype () |
virtual type implemented by this vtbl
Returns: type implemented by this vtbl
Throws: not-loaded, not-VTBL
void * call (void *arg) |
call the function represented by this symbol
Parameters:
arg | a single void* argument to the function |
Returns: whatever's returned by the call
Throws: not-loaded, not-FUNCTION
unsigned len () |
allocation length
Returns: symbol's allocation length
Throws: undefined
enum Type type () |
Csym type
Returns: type of the Csym
bool isLoaded () |
predicate: is Csym loaded?
Returns: true iff Csym has been loaded