| |||
| Home > Accessing Image Symbols > Using $Super$$ and $Sub$$ to override symbol definitions | |||
There are situations where an existing symbol cannot be modified because, for example, it is located in an external library or in ROM code.
Use the $Super$$ and $Sub$$ patterns
to patch an existing symbol.
For example, to patch the definition of a function foo(),
use $Super$$foo() and $Sub$$foo() as
follows:
$Super$$fooIdentifies the original unpatched function foo().
Use this to call the original function directly.
$Sub$$fooIdentifies
the new function that will be called instead of the original function foo().
Use this to add processing before or after the original function.
Example 4.6 shows the
legacy function foo() modified to result in
a call to ExtraFunc() and a call to foo().
For more details, see ARM ELF specification, aaelf.pdf, in .install_directory\Documentation\Specifications\...