This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Track libc calls
- From: Davide Italiano <davide dot italiano at gmail dot com>
- To: libc-help at sourceware dot org
- Date: Wed, 11 Aug 2010 21:13:41 +0200
- Subject: Track libc calls
I'm doing a project in which I'm trying to intercept all libc calls to
do somethin' with ( for example track w/ buffer have been allocated
for a specific function call, like strdup() or printf() ).
There were some problems in doing this mainly for some reasons:
1) For efficiency, internal calls are direct jumps whenever possible
rather than going through the PLT, so it's impossible to intercept
calls within libc.Some functions, like abs() , aren't translated to a
library function call but are realized using assembly inline
2) Considering you want to override every function in libc (at time of
linking, using --wrap or ad runtime using LD_PRELOAD ) , this override
is allowed only for weak aliases, that are a little part of the whole
functions.
So, my question is: Is there a sane way to do this?
Thanks
Cheers