2 msgConfused at usage of stack for MIPS arch
2 msglabels in inline asm
8 msgimplicit cast from unsigned long to unsigned in...
2 msgA bit field's length

wrap functions in glibc
\ ÎâêØ (21 Nov 2007)
. \ John (Eljay) Love-Jensen (21 Nov 2007)

2 msgProblems installing treelang
3 msgQuestions for GCC
2 msgbuilding gcc 4.2
2 msgUndocumented optimization flag, switched by O1
1 msgProblems building an windows toolchain using cy...
2 msgBuilding binary from code in C++...
5 msg-Wconversion bug in g++-4.3?
1 msgg++ 4.1.2 omits debug info for local symbols
1 msgld: duplicate symbol typeinfo
3 msgaliasing with char*
5 msggfortan requires old directory in LD_LIBRARY_PA...
1 msgLD_LIBRARY_PATH relation to gmp error
7 msg'error: there are no arguments to...' in my code
4 msgis it a bug or do i miss something?(about confl...
5 msgDebugging gcc-compiled programs on Windows
Subject:wrap functions in glibc
Group:Gcc-help
From:ÎâêØ
Date:21 Nov 2007


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


© 2004-2008 readlist.com