binfmt: nxstyle fixes
small nxstyle fixes for binfmt to avoid CI warnings Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
This commit is contained in:
parent
02ab0cd149
commit
7ddf7c6c25
10 changed files with 40 additions and 26 deletions
|
|
@ -61,9 +61,10 @@ extern "C"
|
||||||
#define EXTERN extern
|
#define EXTERN extern
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* This is a list of registered handlers for different binary formats. This
|
/* This is a list of registered handlers for different binary formats.
|
||||||
* list should only be accessed by normal user programs. It should be sufficient
|
* This list should only be accessed by normal user programs. It should be
|
||||||
* protection to simply disable pre-emption when accessing this list.
|
* sufficient protection to simply disable pre-emption when accessing this
|
||||||
|
* list.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
EXTERN FAR struct binfmt_s *g_binfmts;
|
EXTERN FAR struct binfmt_s *g_binfmts;
|
||||||
|
|
|
||||||
|
|
@ -103,19 +103,23 @@ int binfmt_copyargv(FAR struct binary_s *bin, FAR char * const *argv)
|
||||||
|
|
||||||
for (i = 0; argv[i]; i++)
|
for (i = 0; argv[i]; i++)
|
||||||
{
|
{
|
||||||
/* Increment the size of the allocation with the size of the next string */
|
/* Increment the size of the allocation with the size of the next
|
||||||
|
* string
|
||||||
|
*/
|
||||||
|
|
||||||
argsize += (strlen(argv[i]) + 1);
|
argsize += (strlen(argv[i]) + 1);
|
||||||
nargs++;
|
nargs++;
|
||||||
|
|
||||||
/* This is a sanity check to prevent running away with an unterminated
|
/* This is a sanity check to prevent running away with an
|
||||||
* argv[] list. MAX_EXEC_ARGS should be sufficiently large that this
|
* unterminated argv[] list.
|
||||||
|
* MAX_EXEC_ARGS should be sufficiently large that this
|
||||||
* never happens in normal usage.
|
* never happens in normal usage.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (nargs > MAX_EXEC_ARGS)
|
if (nargs > MAX_EXEC_ARGS)
|
||||||
{
|
{
|
||||||
berr("ERROR: Too many arguments: %lu\n", (unsigned long)argvsize);
|
berr("ERROR: Too many arguments: %lu\n",
|
||||||
|
(unsigned long)argvsize);
|
||||||
return -E2BIG;
|
return -E2BIG;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,9 @@ int dump_module(FAR const struct binary_s *bin)
|
||||||
binfo(" argv: %p\n", bin->argv);
|
binfo(" argv: %p\n", bin->argv);
|
||||||
binfo(" entrypt: %p\n", bin->entrypt);
|
binfo(" entrypt: %p\n", bin->entrypt);
|
||||||
binfo(" mapped: %p size=%d\n", bin->mapped, bin->mapsize);
|
binfo(" mapped: %p size=%d\n", bin->mapped, bin->mapsize);
|
||||||
binfo(" alloc: %p %p %p\n", bin->alloc[0], bin->alloc[1], bin->alloc[2]);
|
binfo(" alloc: %p %p %p\n", bin->alloc[0],
|
||||||
|
bin->alloc[1],
|
||||||
|
bin->alloc[2]);
|
||||||
#ifdef CONFIG_BINFMT_CONSTRUCTORS
|
#ifdef CONFIG_BINFMT_CONSTRUCTORS
|
||||||
binfo(" ctors: %p nctors=%d\n", bin->ctors, bin->nctors);
|
binfo(" ctors: %p nctors=%d\n", bin->ctors, bin->nctors);
|
||||||
binfo(" dtors: %p ndtors=%d\n", bin->dtors, bin->ndtors);
|
binfo(" dtors: %p ndtors=%d\n", bin->dtors, bin->ndtors);
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,8 @@ static int g_exec_nsymbols;
|
||||||
*
|
*
|
||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
* symtab - The location to store the symbol table.
|
* symtab - The location to store the symbol table.
|
||||||
* nsymbols - The location to store the number of symbols in the symbol table.
|
* nsymbols - The location to store the number of symbols in the symbol
|
||||||
|
* table.
|
||||||
*
|
*
|
||||||
* Returned Value:
|
* Returned Value:
|
||||||
* None
|
* None
|
||||||
|
|
|
||||||
|
|
@ -51,9 +51,10 @@
|
||||||
* Public Data
|
* Public Data
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/* This is a list of registered handlers for different binary formats. This
|
/* This is a list of registered handlers for different binary formats.
|
||||||
* list should only be accessed by normal user programs. It should be sufficient
|
* This list should only be accessed by normal user programs. It should be
|
||||||
* protection to simply disable pre-emption when accessing this list.
|
* sufficient protection to simply disable pre-emption when accessing this
|
||||||
|
* list.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
FAR struct binfmt_s *g_binfmts;
|
FAR struct binfmt_s *g_binfmts;
|
||||||
|
|
|
||||||
|
|
@ -57,8 +57,8 @@
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/* CONFIG_DEBUG_FEATURES, CONFIG_DEBUG_INFO, and CONFIG_DEBUG_BINFMT have to be
|
/* CONFIG_DEBUG_FEATURES, CONFIG_DEBUG_INFO, and CONFIG_DEBUG_BINFMT
|
||||||
* defined or CONFIG_ELF_DUMPBUFFER does nothing.
|
* have to be defined or CONFIG_ELF_DUMPBUFFER does nothing.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if !defined(CONFIG_DEBUG_INFO) || !defined (CONFIG_DEBUG_BINFMT)
|
#if !defined(CONFIG_DEBUG_INFO) || !defined (CONFIG_DEBUG_BINFMT)
|
||||||
|
|
|
||||||
|
|
@ -169,8 +169,8 @@ int elf_readsym(FAR struct elf_loadinfo_s *loadinfo, int index,
|
||||||
* 0 (OK) is returned on success and a negated errno is returned on
|
* 0 (OK) is returned on success and a negated errno is returned on
|
||||||
* failure.
|
* failure.
|
||||||
*
|
*
|
||||||
* EINVAL - There is something inconsistent in the symbol table (should only
|
* EINVAL - There is something inconsistent in the symbol table (should
|
||||||
* happen if the file is corrupted)
|
* only happen if the file is corrupted)
|
||||||
* ENOSYS - Symbol lies in common
|
* ENOSYS - Symbol lies in common
|
||||||
* ESRCH - Symbol has no name
|
* ESRCH - Symbol has no name
|
||||||
* ENOENT - Symbol undefined and not provided via a symbol table
|
* ENOENT - Symbol undefined and not provided via a symbol table
|
||||||
|
|
@ -265,12 +265,13 @@ int elf_loaddtors(FAR struct elf_loadinfo_s *loadinfo);
|
||||||
* Name: elf_addrenv_alloc
|
* Name: elf_addrenv_alloc
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Allocate memory for the ELF image (textalloc and dataalloc). If
|
* Allocate memory for the ELF image (textalloc and dataalloc).
|
||||||
* CONFIG_ARCH_ADDRENV=n, textalloc will be allocated using kmm_zalloc() and
|
* If CONFIG_ARCH_ADDRENV=n, textalloc will be allocated using kmm_zalloc()
|
||||||
* dataalloc will be a offset from textalloc. If CONFIG_ARCH_ADDRENV-y, then
|
* and dataalloc will be a offset from textalloc.
|
||||||
* textalloc and dataalloc will be allocated using up_addrenv_create(). In
|
* If CONFIG_ARCH_ADDRENV-y, then textalloc and dataalloc will be allocated
|
||||||
* either case, there will be a unique instance of textalloc and dataalloc
|
* using up_addrenv_create().
|
||||||
* (and stack) for each instance of a process.
|
* In either case, there will be a unique instance of textalloc and
|
||||||
|
* dataalloc (and stack) for each instance of a process.
|
||||||
*
|
*
|
||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
* loadinfo - Load state information
|
* loadinfo - Load state information
|
||||||
|
|
|
||||||
|
|
@ -254,7 +254,9 @@ int elf_findsection(FAR struct elf_loadinfo_s *loadinfo,
|
||||||
int ret;
|
int ret;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* Search through the shdr[] array in loadinfo for a section named 'sectname' */
|
/* Search through the shdr[] array in loadinfo for a section named
|
||||||
|
* 'sectname'
|
||||||
|
*/
|
||||||
|
|
||||||
for (i = 0; i < loadinfo->ehdr.e_shnum; i++)
|
for (i = 0; i < loadinfo->ehdr.e_shnum; i++)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -319,7 +319,9 @@ int elf_symvalue(FAR struct elf_loadinfo_s *loadinfo, FAR Elf_Sym *sym,
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Yes... add the exported symbol value to the ELF symbol table entry */
|
/* Yes... add the exported symbol value to the ELF symbol table
|
||||||
|
* entry
|
||||||
|
*/
|
||||||
|
|
||||||
binfo("SHN_UNDEF: name=%s %08x+%08x=%08x\n",
|
binfo("SHN_UNDEF: name=%s %08x+%08x=%08x\n",
|
||||||
loadinfo->iobuffer, sym->st_value, symbol->sym_value,
|
loadinfo->iobuffer, sym->st_value, symbol->sym_value,
|
||||||
|
|
|
||||||
|
|
@ -58,8 +58,8 @@
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/* CONFIG_DEBUG_FEATURES, CONFIG_DEBUG_INFO, and CONFIG_DEBUG_BINFMT have to be
|
/* CONFIG_DEBUG_FEATURES, CONFIG_DEBUG_INFO, and CONFIG_DEBUG_BINFMT
|
||||||
* defined or CONFIG_NXFLAT_DUMPBUFFER does nothing.
|
* have to be defined or CONFIG_NXFLAT_DUMPBUFFER does nothing.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if !defined(CONFIG_DEBUG_INFO) || !defined (CONFIG_DEBUG_BINFMT)
|
#if !defined(CONFIG_DEBUG_INFO) || !defined (CONFIG_DEBUG_BINFMT)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue