Hi,
in some cases it is quite useful (despite also being dangerous)
to be able to find a pointer to a function by supplying the
function's name. I append the code below (originally from
Rob Kennedy) that I successfully (and to my great satisfaction)
used on IRIX for years.
I wonder if anyone knows how to do this on Linux...
Thanks!
Petar
Appendix: a working IRIX example:
---------------8<----------------------------------------------
void* nm_find( const char *name )
{
const int nm_loc_total = (int) _procedure_table_size ;
int i;
for ( i = 0; i < nm_loc_total; i++ ) {
if ( strcmp( &_procedure_string_table[_procedure_table[i].irpss],
name ) == 0 ) {
printf("found %s at %d\n", name, _procedure_table[i].adr );
break;
}
}
return (void*) _procedure_table[i].adr;
}