Strings as function names (again)

Stanley Friesen sarima at tdatirv.UUCP
Sat Jan 26 11:16:01 AEST 1991


In article <mpapp.664709840 at godzilla> mpapp@ (Mike Papper) writes:
>Again, the question, a bit more succintely is:
>Can I find the adress of a function from its name?

Not in any simple or portable way.
Most flavors of Unix provide some set of library routines for accessing
symbol tables in binaries.  However, there is no standard set, the library
changes completely from SysVr3 to SysVr4!

Given such a library, and an *unstripped* executable, it is possible,
with much contortion, to convert a function name into an address.

Essentially you need to locate the binary being executed (not always easy),
and 'open' it in the way prescribed by the library, and then grub around in
the symbol table using the mechanism(s) provided.
-- 
---------------
uunet!tdatirv!sarima				(Stanley Friesen)



More information about the Comp.lang.c mailing list