# EL_Link*Ex

## Syntax

  `#include <twl/el.h>`
  `ELDlld EL_LinkEx( ELReadImage readfunc, u32 len, void* buf, u32 buf_size );`
  `ELDlld EL_LinkFileEx( const char* FilePath, void* buf, u32 buf_size );`
  `ELDlld EL_LinkImageEx( void* obj_image, u32 obj_len, void* buf, u32 buf_size );`

## Arguments

readfunc | Developer-specific READ function.
FilePath | Path name of the dynamic module to register.
obj_image | Memory address of the dynamic module to register.
len / obj_len | Size of the dynamic module to register.
buf | Buffer in which the dynamic module will be registered.
buf_size | Size of buffer in which the dynamic module will be registered.

## Return Values

Returns the registered dynamic module when registration succeeded.
Returns 0 when registration failed.

## Description

Registers a dynamic module with the EL library.
The `EL_LinkEx` function loads the dynamic module using a READ function specified by the user. The `EL_LinkFileEx` function loads the dynamic module to register from ROM. The `EL_LinkImageEx` function uses a dynamic module that has already been loaded into memory.
You must secure a region for buf of at least the size determined by the `EL_CalcEnoughBufferSizeforLink*` functions.
If the size specified in buf_size is insufficient, the linking process fails partway through. Then, when you call the `EL_GetResultCode` function, `EL_RESULT_NO_MORE_RESOURCE` is returned.
Also note that because buf is where the dynamic module is registered, if you use the `EL_LinkImageEx` function to register the dynamic module, you temporarily need an additional buffer (obj_image) equal in size to the dynamic module (ELF file).

Note:
You can use a debugger to debug the dynamic module only if the `EL_LinkFileEx` function has been used.

## See Also

`EL_CalcEnoughBufferSizeforLink*`
`ELReadImage`

## Revision History

2009/03/16 Initial version.

CONFIDENTIAL