override memset...
Adam Stein
adam@scan.mc.xerox.com
Wed Nov 12 15:56:00 GMT 2003
>Hi all,
>
>I know this is a long shot, but is there a way to "override" memset, strcpy,
and
>other c string functions without renaming their calls?
If your system supports LD_PRELOAD, then yes, you can override any function in
any system library. I'm guessing you're using FreeBSD and I don't know if it
supports that or not (I use Solaris which does). By setting LD_PRELOAD to your
shared library, any program you run with LD_PRELOAD set will go thru your
library first. If you have a function called memset(), it will use the one in
your library since it finds that before the system version.
>BTW are there any known problems with -minline-all-stringops. I tried that and
>for some reason, I was still getting a function call for memset.
Can't help you with -minline-all-stringops.
Adam Stein
--
Adam Stein @ Xerox Corporation Email: adam@scan.mc.xerox.com
Disclaimer: All views expressed
here have been proved to be my own. [http://www.csh.rit.edu/~adam/]
More information about the Gcc-help
mailing list