class ElfExe

ElfExe - direct meddling in elf executable symbol table to add new symbols More...

Definition#include <elfexe.hh>
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Members


Detailed Description

ElfExe - direct meddling in elf executable symbol table to add new symbols

this class modifies the symbol table of the currently running process' executable by directly modifying the internal data of the ld-linux and libdl.so libraries.

This is regrettable, but the alternative is to beg the glibc `maintainers' to fix bugs they hardly even seem to recognise.

The result is a glibc2 version-specific meddling object which will completely die as soon as the internal representation used in libdl.so and ld.so changes. It will need to be ported to new architectures, and may not even be portable to some.

ElfExe ()

create an ElfExe for the current process

Permits new symbols to be defined in the current process

~ElfExe ()

restore the process' symbol table to a pristine state

void addSym (const char *name, void *value, int size, int type, int bind = STB_GLOBAL, int section = SHN_ABS)

add a global symbol to the executable

Parameters:
namesymbol's mangled name
valuesymbol's value
sizesymbol's allocation size
typesymbol's STT_ type
typesymbol's STB_ binding (def: STB_GLOBAL)
sectionsymbol's program .section (def: SHN_ABS)


Generated by: colin@sharedtech.dhis.org on Sat Nov 6 11:59:21 199.