>> Hi,
>> I'm trying to wrap mallocs (ld --wrap,malloc). With this option, the >> linker is informed that some methods like malloc() (or others) must >> be caught >> and that user defined methods are called instead (which will >> eventually call malloc() but adding some user code like printf())
>> The problem also arose with cygwin: >> 2000-09/msg00083.html
>> It seems that the XCode version of the linker does not support the -- >> wrap option. It is not even documented in the Apple ld man pages >> (compared to Linux man pages).
>> Does anyone has a solution? (I still have to try with the fink ports >> of gcc/ld)
> Apple's ld is not GNU ld, as Cygwin and Linux are.
> The fink port of ld will not link Mach-O object code.
> Why do you need this feature?
I need this feature to port an ongoing research project on a new networking protocol stack that can run either in Linux Kernel space, user space or on network simulators. Hence the need to wrap malloc() and sleep() for example and give them a different behavior depending on the running environment. Of course, other issues will arise to port the all thing to the Darwin environment.
> -- > Best regards, > Peter
-- Dr. Franck Legendre ETH Zürich - Swiss Federal Institute of Technology
|