mudflap wrappers [patch]

Eyal Lebedinsky eyal@eyal.emu.id.au
Fri Apr 25 12:47:00 GMT 2003


It is time to show what I am doing with the wrappers in order
to attract some criticism. Attached is a patch for gcc/libmudflap
that adds a bunch of wrappers. This is a significant portion of
the ones I use in my system

Please note that this is work in progress, very lightly tested,
so do not install it on your heart-lung machine just yet...

Can someone who knows have a quick look and say what needs to be
changed so that the patch will be accepted when finished?

The code also shows that not all functions are easy to wrap. Look
at the *dir() functions and you will see that the 'DIR *' type is
never exposed, so checking it is problematic - what length should
one use (I used 4, is 1 safer?)?

Another issue is the treatment of alien addresses returned from
an external library. I defined
	MF_REGISTER_FOPEN
	MF_REGISTER_OPENDIR
	MF_REGISTER_READDIR
to indicate if these objects need to be registered. On my
Linux/i386 all were trapped by the malloc hook and did not need
to handle un/registration. This will be different on other
platform and I am not yet sure how to easily implement an
automatic way of detecting what to do (i.e. using autoconf).
It looks like a manual port will be necessary whenever these
wrappers are enabled on a new platform.

However, if I can assume that the GNU libc will always be used
with gcc then I can make some assumptions from the way it works.

--
Eyal Lebedinsky (eyal@eyal.emu.id.au) <http://samba.org/eyal/>



More information about the Gcc mailing list