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
+11 -6
View File
@@ -44,7 +44,10 @@
* Private Function Prototypes
****************************************************************************/
static int builtin_loadbinary(FAR struct binary_s *binp);
static int builtin_loadbinary(FAR struct binary_s *binp,
FAR const char *filename,
FAR const struct symtab_s *exports,
int nexports);
/****************************************************************************
* Private Data
@@ -69,22 +72,24 @@ static struct binfmt_s g_builtin_binfmt =
*
****************************************************************************/
static int builtin_loadbinary(struct binary_s *binp)
static int builtin_loadbinary(FAR struct binary_s *binp,
FAR const char *filename,
FAR const struct symtab_s *exports,
int nexports)
{
FAR const char *filename;
FAR const struct builtin_s *builtin;
int fd;
int index;
int ret;
binfo("Loading file: %s\n", binp->filename);
binfo("Loading file: %s\n", filename);
/* Open the binary file for reading (only) */
fd = nx_open(binp->filename, O_RDONLY);
fd = nx_open(filename, O_RDONLY);
if (fd < 0)
{
berr("ERROR: Failed to open binary %s: %d\n", binp->filename, fd);
berr("ERROR: Failed to open binary %s: %d\n", filename, fd);
return fd;
}