binfmt: Remove filename/exports/nexports from binary_s

to simplify the life cycle management

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao
2021-05-24 17:12:06 +08:00
committed by Masayuki Ishikawa
parent cf78a5b6cf
commit bebdbc5c87
8 changed files with 61 additions and 60 deletions
+8 -9
View File
@@ -61,12 +61,6 @@ typedef FAR void (*binfmt_dtor_t)(void);
struct symtab_s;
struct binary_s
{
/* Information provided to the loader to load and bind a module */
FAR const char *filename; /* Full path to the binary to be loaded (See NOTE 1 above) */
FAR const struct symtab_s *exports; /* Table of exported symbols */
int nexports; /* The number of symbols in exports[] */
/* Information provided from the loader (if successful) describing the
* resources used by the loaded module.
*/
@@ -118,7 +112,10 @@ struct binfmt_s
/* Verify and load binary into memory */
CODE int (*load)(FAR struct binary_s *bin);
CODE int (*load)(FAR struct binary_s *bin,
FAR const char *filename,
FAR const struct symtab_s *exports,
int nexports);
/* Unload module callback */
@@ -192,7 +189,8 @@ int unregister_binfmt(FAR struct binfmt_s *binfmt);
*
****************************************************************************/
int load_module(FAR struct binary_s *bin);
int load_module(FAR struct binary_s *bin, FAR const char *filename,
FAR const struct symtab_s *exports, int nexports);
/****************************************************************************
* Name: unload_module
@@ -228,7 +226,8 @@ int unload_module(FAR struct binary_s *bin);
*
****************************************************************************/
int exec_module(FAR const struct binary_s *binp, FAR char * const *argv);
int exec_module(FAR const struct binary_s *binp,
FAR const char *filename, FAR char * const *argv);
/****************************************************************************
* Name: exec