Morphing Attributes
Morphing Attributes
There is a possibility to select a subset of functions to be processed by Morpher. Such selection is done via so-called "morphing attribute". Attributes might be specified in:
- In the source file (only for C / C++ code)
- In the special attributes file
- Via the command line
Each attribute might have 3 basic values:
- ''morph-on'' - always process given function
- ''morph-off'' - never process given function
- ''morph-default'' - use the default rules for function processing (see below)
Let us consider different ways which the attributes might be specified in
C / C++ Source
Attributes might be injected into the source code via annotate attribute:
void __attribute__((annotate("morph-off"))) foo(void);
By default all the functions have morph-off annotation specified implicitly.
Attributes File
Attributes might be specified via the special file. The file has the following format:
default = morph-on
foo = morph-off
bar = morph-on
...
Here foo and bar are function names. default is a special name which selects the default behavior of Morpher (e.g. whether to morph all the functions or not).
Please note that foo and bar must be already mangled names (this important for C++ / ObjectiveC / ObjectiveC++ code).
File might be specified via -function-attr-file Mopher command line option.
For the users's convenience we created the special Morpher mode which dumps all the attributes specified for all functions in the given file into file. The path to such file can be specified via -dump-function-attr command line option. Note that if the file doest exist, then Morpher tries to merge the contents in the case they do not conflict with each other.
Command Line
Attributes might be specified directly via the command line. The default morphing attribute can be specified via -default-morph-attr command line option. -function-attr-list option allows to provide the list of attributes for the the given set of functions
Priority
The attributes file has higher priority than the set of attributes specified inside the source file. Attributes which are set directly in the command line have the highest priority (and thus will override all other attributes)
Hiding Attributes
SymbolHider pass hides the static function from the symbol table of a given object. User can specify which functions to hide via the following set of attributes
- hide - hide the given function, apply default morphing rules
- hide+morph - hide and always morph the given function
- hide-morph - hide and never morph the given function
By default hiding is turned off for all the functions. User must specify explicitly which functions should be hidden.

