|instrumenting ELF executables firstname.lastname@example.org (Dipak Rath) (2001-03-22)|
|Re: instrumenting ELF executables pg+nm@sabi.Clara.co.UK (2001-03-26)|
|Re: instrumenting ELF executables email@example.com (Manoj Plakal) (2001-03-27)|
|Re: Re: instrumenting ELF executables firstname.lastname@example.org (Mihai Christodorescu) (2001-03-27)|
|From:||pg+nm@sabi.Clara.co.UK (Piercarlo Grandi)|
|Date:||26 Mar 2001 13:41:55 -0500|
|Posted-Date:||26 Mar 2001 13:41:55 EST|
>>> On 22 Mar 2001 01:22:18 -0500, Dipak Rath <email@example.com> said:
drath> I am working on a problem to generate the execution profile of a
drath> program, now that requires instrumenting the code with some
drath> profiling func calls at appropriate positions. Here I am dealing
drath> with sun executables(in ELF format). The question is how do I do
drath> the required using the elf library routines. [ ... ]
It seems a bit painful to actually read in an executable and then
write out a modified version. Still, there are at least two freeware
tools that might help you in that, 'libelf':
and 'libbfd' (from the GNU binary utilities package). A Sun version of
'libelf' is also bundled with SunOS or Solaris, IIRC.
Do you _really_ want to do this? There are alternatives, e.g.
sampling the program counter, that don't require modifying an
executable, if you have sources you can instrument the source, or the
assembler output instead, for example:
(there is also a much older one for Edition 8 or 9 of UNIX, IIRC, and
it has been cloned by someone else, but I can't remember the name).
Return to the
Search the comp.compilers archives again.