On Tue, Aug 10, 2010 at 10:16 AM, Loïc Minier <loic.min...@linaro.org> wrote:
> On Mon, Aug 09, 2010, John Rigby wrote:
>> Does ltrace do what you want?
>
>  This is what comes to my mind as well.
>
>  There is a catch: I think eglibc (in fact almost all Ubuntu packages)
>  is built with -Bsymbolic-functions, which means that you can't
>  intercept internal calls to memcpy() from other eglibc functions using
>  LD_PRELOAD.

memcpy is a particular scary example because the compiler may treat it
as an intrinsic and/or inline it (as for mem*() and str*() in
general).

I noticed when experimenting with memory allocation tracking that
glibc seems to avoid applying -Bsymbolic-functions to some things ...
so to my surprise you can intercept the malloc() family of calls and
it seems to work properly, even for "implicit" allocations (e.g.,
calling fopen or asprintf etc.)  This is probably deliberate -- I
guess this will only work for specific groups of functions though.

Didn't know about ltrace before; it does look useful :)

Cheers
---Dave

_______________________________________________
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev

Reply via email to