Mail Archives: djgpp/1997/08/18/21:35:46
Victor wrote:
>
> When I'm trying to wrap malloc() related routines to use my functions
> instead, I get this GPF. This is how I compile and run it :
>
> gcc -I. -Isrc -Wall -O -g -o obj/print.o -c print.c
> gcc
> -Wl,--wrap,malloc,--wrap,calloc,--wrap,cfree,--wrap,realloc,--wrap,free,
> --wrap,xmalloc,--wrap,realloc,--wrap,xfree -o print.exe obj/print.o
> -lm -lscan -lalleg -lpc
Without seeing your sources I cannot say so much (and also I have
no experiance with these --wrap things). But one hint:
Have you carefully read the ld docs about this switch and have
you tried at first the example shown there?
> My programs run OK if I substitute those functions only in my source
> and some of the libraries, but when I'm trying to substitute those
> functions in all the libraries, than I'm getting this error.
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.
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 -