wrap functions in glibc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi
As indicated in gcc maunal and ld manual,
Using "-Wl,--wrap -Wl,wraper_func_name" can provide a wrapper function
for certain interface in the program. However, I found this doesn't
work for function calls in the shared library.

for example, if I use
-Wl,--wrap -Wl,malloc
to wrap the malloc function, I can wrap the calls to malloc in my
code, but the malloc called in library cannot be wrapped. I think this
is because --wrap option is managed by linker, while it cannot replace
calls to malloc in library with wrapper functions.

However, if I want to wrap function calls in library (e.g. memcpy),
what should I do?

Any hints on this problem is truly appreciated.

Andrew

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux