# EL_GetGlobalAdr

## Syntax

  `#include <twl/el.h>`
  `typedef u32 ELDlld;`
  `void* EL_GetGlobalAdr( ELDlld my_dlld, const char* ent_name );`

## Arguments

my_dlld | Dynamic module to search for symbols.
ent_name | Symbol name for which an address will be obtained.

## Return Values

Returns the symbol's address if the symbol is found in the specified dynamic module.
Returns 0 if not found.

## Description

Returns the address for the symbol corresponding to the specified string from the specified dynamic module. (If 0 is specified for the `my_dlld` argument, this will search all dynamic modules that were attempted to be linked.) In cases such as calling a dynamic module function from the static module, get its address using this function, and then call the function through the function pointer.
Because pointers are used to access dynamic module symbols from the static module and type checking is not performed when compiling, make sure to verify the correct type by checking the dynamic module's header file and substituting the correct pointer type for this function's return value or by taking similar measures.

Example: Accessing a dynamic module's `u16` variable.
`u16* dll_data_p;`
`dll_data_p = (u16*)EL_GetGlobalAdr( dlld, "dll_data");`
`OS_TPrintf( "dll_data:%d\n", *dll_data_p);`

Example: Calling a dynamic module function.
`typedef void (*dllfunc)( u16 a)`
`dllfunc dll_func1;`
`dll_func1 = (dllfunc)EL_GetGlobalAdr( dlld, "dll_func1");`
`dll_func1( 0x1234);`

## See Also

`EL_AddStaticSym`

## Revision History

2008/07/11 Added `ELDlld`.
2007/08/21 Initial version.

CONFIDENTIAL