Re: override memset...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



y2bismil@xxxxxxxxxxxxxxxxxxxx writes:

> 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?
> 
> Basically at link time, I want to use my own version of memset, strcpy and a
> select few others.

Which function calls do you want to override?

If you want to override calls made in your own code, just provide your
own versions of memset, strcpy, etc.  They will be called in
preference to the one in libc.

If you want to override the calls in libc, then it depends upon what
host you are using.  In some cases you can again simply provide the
function yourself.  But in some cases the library never calls memset,
etc., it instead calls internal versions to avoid overriding
problems.  So, it depends.

> 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.

That suggests that you are using an i386 target.  Please always
mention what you are using.

-minline-all-stringops doesn't necessarily eliminate every call to the
string operations, although it tries.  There are a number of possible
cases in which gcc will still emit calls to memset.  If you provide a
small test case, somebody can probably tell you whether it is a bug or
a case which is not handled.

Ian

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux