Is it possible to wrap calls to statically linked 3rd party library?

Posted by robusta on Stack Overflow See other posts from Stack Overflow or by robusta
Published on 2010-06-16T13:08:56Z Indexed on 2010/06/16 13:12 UTC
Read the original article Hit count: 101

Filed under:
|
|

Hi,

I would like to trace calls to some 3rd party library which are made from another 3rd party library.

Example: I want to trace calls to library A. My application statically links library B, which in turn is statically linked to library A.

In case of dynamic linking I could write library A2 with wrappers for functions which I want to trace of library A and use LD_PRELOAD=A2.so. Then, my wrappers will be called instead, and I will see the trace. In my case I cannot use dynamic linking.

Is it possible to achieve the same using static linking?

Thanks,
Robusta

© Stack Overflow or respective owner

Related posts about c

    Related posts about linux