Module * LoadModule( void * pRo, size_t roSize, void * pBuffer, size_t bufferSize, bool doRegister = true, FixLevel fixLevel = FIX_LEVEL_1, const RegistrationList * pRr = NULL );
| Name | Description | |
|---|---|---|
| in | pRo |
Specifies the start address of the cro to be loaded.Must be aligned on a 4096-byte boundary. The memory must be other than device memory. |
| in | roSize |
Specifies the size of the cro pointed to by pRo. |
| in | pBuffer |
Specifies the start address of the memory to be used for the .data/.bss section. Must be aligned on a 8-byte boundary. |
| in | bufferSize |
Specifies the size of the memory pointed to by pBuffer.A size greater than or equal to the value stored in SizeInfo::bufferSize by GetSizeInfo must be specified. |
| in | doRegister |
Specifies whether to register as an automatic link target. Registers as an automatic link target if true. Does not register as an automatic link target if false. |
| in | fixLevel |
Specifies that the memory be released after loading. |
| in | pRr |
Specifies the crr for which cro information specified by pR0 is registered.Searches among registered crr files if NULL is specified. |
cro if the cro is loaded successfully. If the function fails it returns NULL. Loads a cro.
Relocates cro, resolves references among already loaded modules registered as automatic link targets, and places them under the management of the ro library.
If execution succeeds, the memory pointed to by pRo is placed under the management of the ro library, after which it cannot be used for other purposes. To remove this memory region from management by the ro library, you must call Module::Unload.
If true is specified in doRegister, the cro is registered as an automatic link target. Once registered as an automatic link target, references with other modules are automatically resolved. References for the cro can also be resolved using Module::Link.
The corresponding memory after loading is successful is released from management by the ro library if a value other than FIX_LEVEL_0 (FIX_LEVEL_NONE) is specified in fixLevel. This allows the memory to be used for other purposes. Although you usually cannot specify the memory specified for pRo as pBuffer, memory released using fixLevel can be specified for pBuffer.
Usually, you must call Module::DoInitialize after loading the cro succeeds, but before referencing functions and symbols inside the module.
The pointer to Module returned by this function can be released using the Module::Unload function.
CONFIDENTIAL