Shared libraries: Add a non-standard dllfnc.h function to set the symbol table.

This commit is contained in:
Gregory Nutt
2017-01-23 08:20:24 -06:00
parent f6504be6ef
commit a06d26e044
4 changed files with 132 additions and 9 deletions
+20
View File
@@ -104,6 +104,26 @@ extern "C"
#define EXTERN extern
#endif
/****************************************************************************
* Name: dlsymtab
*
* Description:
* dlsymtab() is a non-standard shared library interface. It selects the
* symbol table to use when binding a shared libary to the base firmware
* which may be in FLASH memory.
*
* Input Parameters:
* symtab - The new symbol table.
* nsymbols - The number of symbols in the symbol table.
*
* Returned Value:
* Always returns OK.
*
****************************************************************************/
struct symtab_s;
int dlsymtab(FAR const struct symtab_s *symtab, int nsymbols);
/****************************************************************************
* Name: dlopen
*
+8 -8
View File
@@ -107,10 +107,10 @@ typedef CODE int (*mod_uninitializer_t)(FAR void *arg);
struct mod_info_s
{
mod_uninitializer_t uninitializer; /* Module uninitializer */
FAR void *arg; /* Uninitializer argument */
FAR struct symtab_s *exports; /* Symbols exported by module */
unsigned int nexports; /* Number of symobols in exports list */
mod_uninitializer_t uninitializer; /* Module uninitializer */
FAR void *arg; /* Uninitializer argument */
FAR const struct symtab_s *exports; /* Symbols exported by module */
unsigned int nexports; /* Number of symobols in exports list */
};
/* A NuttX module is expected to export a function called module_initialize()
@@ -128,7 +128,7 @@ struct mod_info_s
typedef CODE int (*mod_initializer_t)(FAR struct mod_info_s *modinfo);
#ifdef __KERNEL__
#if defined(__KERNEL__) || defined(CONFIG_BUILD_FLAT)
/* This is the type of the callback function used by mod_registry_foreach() */
struct module_s;
@@ -163,7 +163,7 @@ extern "C"
*
****************************************************************************/
#ifdef __KERNEL__
#if defined(__KERNEL__) || defined(CONFIG_BUILD_FLAT)
void mod_getsymtab(FAR const struct symtab_s **symtab, FAR int *nsymbols);
#endif
@@ -182,7 +182,7 @@ void mod_getsymtab(FAR const struct symtab_s **symtab, FAR int *nsymbols);
*
****************************************************************************/
#ifdef __KERNEL__
#if defined(__KERNEL__) || defined(CONFIG_BUILD_FLAT)
void mod_setsymtab(FAR const struct symtab_s *symtab, int nsymbols);
#endif
@@ -301,7 +301,7 @@ FAR void *modhandle(FAR const char *name);
*
****************************************************************************/
#ifdef __KERNEL__
#if defined(__KERNEL__) || defined(CONFIG_BUILD_FLAT)
int mod_registry_foreach(mod_callback_t callback, FAR void *arg);
#endif