This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

how to override static function

Note: This was originally posted on 5th June 2009 at http://forums.arm.com

I find we can override a function Using $Super$$ and $Sub$$ to overide symbol definitions from the pdf ADS_LinkerGuide_A.pdf.But When I use this way to override a static function defined in a library, ads linker can't find the $Super$$func symbol, but I find when the function is global in a library, ads linker succeed.
How can I override the static function in a library!

extern void ExtraFunc(void);
extern void $Super$$foo(void):
/* this function will be linked instead of the original foo() */
void $Sub$$foo(void)
{
ExtraFunc(); /* does some extra setup work */
$Super$$foo(); /*
}
Parents
  • Note: This was originally posted on 23rd June 2009 at http://forums.arm.com

    > Do we have some ways to override the local static function?

    No. Same issue as static functions in a library - they are resolved at compile time, not link time.

    > And we can never override the static function in library, Is it right?

    Correct, you cannot overrride static functions in a library.
Reply
  • Note: This was originally posted on 23rd June 2009 at http://forums.arm.com

    > Do we have some ways to override the local static function?

    No. Same issue as static functions in a library - they are resolved at compile time, not link time.

    > And we can never override the static function in library, Is it right?

    Correct, you cannot overrride static functions in a library.
Children
No data