so_internalize directive
Syntax
so_internalize symbol [,symbol...];
Parameters
| The name of a symbol in the standard library to add to the shared object—not just refer to. |
Description
Use this directive or the ‑‑so_internalize linker option to add symbols from the standard library to the shared object—instead of relying on someone else to supply those symbols.
Symbols that are undefined in the shared object normally become imported symbols—they will trigger errors unless they have been specified using the ‑‑so_import linker option or the so_import directive.
If the added symbols refer to other symbols, those symbols are not automatically added as well. They must be added in the same way if you do not want them to become external symbols.
This directive gives you exact control over which symbols from the standard library to add to the shared object. The specified symbols will become a part of the shared object. Standard library references that are not specified with this directive will become external references in the shared object.
Example
so_internalize memcpy;
This adds the standard library symbol memcpy to the shared object. The effect will be as if the input files contained the code. A symbol that has been added this way can be exported using the so_export directive.