Mail Archives: djgpp/1997/08/18/08:51:45
Victor wrote:
>
> On Fri, 15 Aug 1997 13:15:15 +0200, Robert Hoehne
> <Robert DOT Hoehne AT Mathematik DOT TU-Chemnitz DOT DE> wrote:
>
> >What do you mean with "substituting in my source and some of
> >the libarries" ? As far as understand this switch of ld, you have
> >nothing to substitute, but only to provide your wrapper functions
> >and then link with the --wrap option.
>
> I meant writing
> #define malloc(a) mymalloc(a)
> in the library's header and recompiling it (and of course, providing
> mymalloc() function which will substitute malloc()).
Here is probably a misunderstanding of you what the
--wrap switch does. PLEASE read the ld doc about this switch.
And as I said already, try at first the example from the
ld docs (which is in that case a sample for wrapping
the malloc function) and then adapt or extent it to all the
other functions you want to wrap.
In general again. If you use the --wrap option and you
provide in your soures the correct wrap-function you have
not to change anything in the libraries, this is done
automatically by the linker. That means again, you have
NOT to do any #define malloc(x) mymallox(x) or something like
this.
If all of this does not help you (or you don't understand),
please post a short example of code with an as detailed as
possible description what you want to get and I will try if
I can get you more specific help.
Robert
---
*****************************************************************
* Robert Hoehne, Fakultaet fuer Mathematik, TU-Chemnitz-Zwickau *
* Post: Am Berg 3, D-09573 Dittmannsdorf *
* e-Mail: Robert DOT Hoehne AT Mathematik DOT TU-Chemnitz DOT DE *
* WWW: http://www.tu-chemnitz.de/~rho *
*****************************************************************
- Raw text -