‑‑wrap
Syntax
‑‑wrap=symbolParameters
| The name of the symbol to redirect |
Description
Use this option to provide a wrapper for a system function. All calls to the symbol symbol will call another symbol that should be named __wrap_symbol. Calls to the original code can be made as calls the symbol __real_symbol.
The linker only replaces external references. Internal references to symbol within the translation unit are not redirected to __wrap_symbol.
Note
Do not use --wrap on symbols that are either redirected or $Super$$/$Sub$$ symbols. Also note that using this option has the same limitations as other types of redirects. For example, the symbol symbol and the symbol __wrap_symbol must be in different files.
This option exists for interoperability with GCC. Patching symbol definitions using the $Sub$$ and $Super$$ special patterns instead of using --wrap imposes fewer limitations and is recommended.
See also
Patching symbol definitions using $Super$$ and $Sub$$ and the GCC documentation for the GCC option --wrap.
Caution
To set this option, use Project>Options>Linker>Extra Options