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(); /*
}
0