c - Use __wrap_malloc in a shared library -
i created shared library in linux calls malloc wrapper __wrap_malloc.
void * __wrap_malloc( size_t size ) { printf("test\n"); return __real_malloc( size ); }
then shared library generated successfully.
but when use shared library , build application. linker gives me "undefined" error message,
undefined reference `__wrap_malloc'
is possible call __wrap_malloc() function in shared library?
please advice.
many thanks.
you not using --wrap option ld correctly. without more information command line using impossible determine going wrong.
Comments
Post a Comment