forked from Archive/PX4-Autopilot
Move binfmt.h, nxflat.h, elf.h, and symtab.h to include/nuttx/binfmt/
git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5252 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
bd76ec3dc0
commit
8a2348d18d
|
@ -50,8 +50,8 @@
|
|||
#include <errno.h>
|
||||
|
||||
#include <nuttx/ramdisk.h>
|
||||
#include <nuttx/binfmt.h>
|
||||
#include <nuttx/nxflat.h>
|
||||
#include <nuttx/binfmt/binfmt.h>
|
||||
#include <nuttx/binfmt/nxflat.h>
|
||||
|
||||
#include "tests/romfs.h"
|
||||
#include "tests/dirlist.h"
|
||||
|
|
|
@ -22,7 +22,7 @@ varlist=`find $dir -name "*-thunk.S"| xargs grep -h asciz | cut -f3 | sort | uni
|
|||
echo "#ifndef __EXAMPLES_NXFLAT_TESTS_SYMTAB_H"
|
||||
echo "#define __EXAMPLES_NXFLAT_TESTS_SYMTAB_H"
|
||||
echo ""
|
||||
echo "#include <nuttx/symtab.h>"
|
||||
echo "#include <nuttx/binfmt/symtab.h>"
|
||||
echo ""
|
||||
echo "static const struct symtab_s exports[] = "
|
||||
echo "{"
|
||||
|
|
|
@ -22,7 +22,7 @@ varlist=`find $dir -name "*-thunk.S"| xargs grep -h asciz | cut -f3 | sort | uni
|
|||
echo "#ifndef __EXAMPLES_NXFLAT_TESTS_SYMTAB_H"
|
||||
echo "#define __EXAMPLES_NXFLAT_TESTS_SYMTAB_H"
|
||||
echo ""
|
||||
echo "#include <nuttx/symtab.h>"
|
||||
echo "#include <nuttx/binfmt/symtab.h>"
|
||||
echo ""
|
||||
echo "static const struct symtab_s exports[] = "
|
||||
echo "{"
|
||||
|
|
|
@ -56,8 +56,8 @@
|
|||
#include <apps/netutils/thttpd.h>
|
||||
|
||||
#include <nuttx/ramdisk.h>
|
||||
#include <nuttx/binfmt.h>
|
||||
#include <nuttx/nxflat.h>
|
||||
#include <nuttx/binfmt/binfmt.h>
|
||||
#include <nuttx/binfmt/nxflat.h>
|
||||
#ifdef CONFIG_NET_SLIP
|
||||
# include <nuttx/net/net.h>
|
||||
#endif
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <nuttx/symtab.h>
|
||||
#include <nuttx/binfmt/symtab.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
#include <debug.h>
|
||||
|
||||
#include <nuttx/compiler.h>
|
||||
#include <nuttx/symtab.h>
|
||||
#include <nuttx/binfmt/symtab.h>
|
||||
#include <apps/netutils/thttpd.h>
|
||||
|
||||
#include "config.h"
|
||||
|
|
|
@ -53,8 +53,8 @@
|
|||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <nuttx/symtab.h>
|
||||
#include <nuttx/binfmt.h>
|
||||
#include <nuttx/binfmt/symtab.h>
|
||||
#include <nuttx/binfmt/binfmt.h>
|
||||
#include <apps/netutils/thttpd.h>
|
||||
|
||||
#include "config.h"
|
||||
|
|
|
@ -3511,3 +3511,6 @@
|
|||
* binfmt/elf.c, binfmt/libelf, include/elf.h, include/nuttx/elf.h: Add
|
||||
basic framework for loadable ELF module support. The initial check-
|
||||
in is non-functional and is simply the framework for ELF support.
|
||||
* include/nuttx/binfmt.h, nxflat.h, elf.h, and symtab.h: Moved to
|
||||
include/nuttx/binfmt/.
|
||||
|
||||
|
|
|
@ -554,19 +554,19 @@ cat ../syscall/syscall.csv ../lib/lib.csv | sort >tmp.csv
|
|||
<ul>
|
||||
<li>
|
||||
The interface to the binary loader is described in the header file
|
||||
<a href="http://svn.code.sf.net/p/nuttx/code/trunk/nuttx/include/nuttx/binfmt.h?view=log">
|
||||
<code>include/nuttx/binfmt.h</code></a>.
|
||||
<a href="http://svn.code.sf.net/p/nuttx/code/trunk/nuttx/include/nuttx/binfmt/binfmt.h?view=log">
|
||||
<code>include/nuttx/binfmt/binfmt.h</code></a>.
|
||||
A brief summary of the APIs prototyped in that header file are listed below.
|
||||
</li>
|
||||
<li>
|
||||
NXFLAT APIs needed to register NXFLAT as a binary loader appear in the header file
|
||||
<a href="http://svn.code.sf.net/p/nuttx/code/trunk/nuttx/include/nuttx/nxflat.h?view=log">
|
||||
<code>include/nuttx/nxflat.h</code></a>.
|
||||
<a href="http://svn.code.sf.net/p/nuttx/code/trunk/nuttx/include/nuttx/binfmt/nxflat.h?view=log">
|
||||
<code>include/nuttx/binfmt/nxflat.h</code></a>.
|
||||
</li>
|
||||
<li>
|
||||
The format of an NXFLAT object itself is described in the header file:
|
||||
<a href="http://svn.code.sf.net/p/nuttx/code/trunk/nuttx/include/nuttx/nxflat.h?view=log">
|
||||
<code>include/nuttx/nxflat.h</code></a>.
|
||||
<a href="http://svn.code.sf.net/p/nuttx/code/trunk/nuttx/include/nuttx/binfmt/nxflat.h?view=log">
|
||||
<code>include/nuttx/binfmt/nxflat.h</code></a>.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
#include <debug.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <nuttx/binfmt.h>
|
||||
#include <nuttx/binfmt/binfmt.h>
|
||||
|
||||
#include "binfmt_internal.h"
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
#include <debug.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <nuttx/binfmt.h>
|
||||
#include <nuttx/binfmt/binfmt.h>
|
||||
|
||||
#include "binfmt_internal.h"
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
#include <errno.h>
|
||||
|
||||
#include <nuttx/arch.h>
|
||||
#include <nuttx/binfmt.h>
|
||||
#include <nuttx/binfmt/binfmt.h>
|
||||
|
||||
#include "os_internal.h"
|
||||
#include "binfmt_internal.h"
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <nuttx/binfmt.h>
|
||||
#include <nuttx/binfmt/binfmt.h>
|
||||
|
||||
#ifndef CONFIG_BINFMT_DISABLE
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <nuttx/binfmt.h>
|
||||
#include <nuttx/binfmt/binfmt.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
#include <debug.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <nuttx/binfmt.h>
|
||||
#include <nuttx/binfmt/binfmt.h>
|
||||
|
||||
#include "binfmt_internal.h"
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
#include <debug.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <nuttx/binfmt.h>
|
||||
#include <nuttx/binfmt/binfmt.h>
|
||||
|
||||
#include "binfmt_internal.h"
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
#include <debug.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <nuttx/binfmt.h>
|
||||
#include <nuttx/binfmt/binfmt.h>
|
||||
|
||||
#include "binfmt_internal.h"
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
#include <debug.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <nuttx/binfmt.h>
|
||||
#include <nuttx/binfmt/binfmt.h>
|
||||
|
||||
#include "binfmt_internal.h"
|
||||
|
||||
|
|
|
@ -47,8 +47,8 @@
|
|||
#include <errno.h>
|
||||
|
||||
#include <arpa/inet.h>
|
||||
#include <nuttx/binfmt.h>
|
||||
#include <nuttx/elf.h>
|
||||
#include <nuttx/binfmt/binfmt.h>
|
||||
#include <nuttx/binfmt/elf.h>
|
||||
|
||||
#ifdef CONFIG_ELF
|
||||
|
||||
|
|
|
@ -47,8 +47,8 @@
|
|||
#include <debug.h>
|
||||
|
||||
#include <arpa/inet.h>
|
||||
#include <nuttx/elf.h>
|
||||
#include <nuttx/symtab.h>
|
||||
#include <nuttx/binfmt/elf.h>
|
||||
#include <nuttx/binfmt/symtab.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
#include <errno.h>
|
||||
|
||||
#include <arpa/inet.h>
|
||||
#include <nuttx/elf.h>
|
||||
#include <nuttx/binfmt/elf.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-Processor Definitions
|
||||
|
@ -118,16 +118,14 @@ int elf_init(FAR const char *filename, FAR struct elf_loadinfo_s *loadinfo)
|
|||
|
||||
/* Read the ELF header from offset 0 */
|
||||
|
||||
ret = elf_read(loadinfo, (char*)&loadinfo->header,
|
||||
sizeof(struct elf_hdr_s), 0);
|
||||
ret = elf_read(loadinfo, (char*)&loadinfo->header, sizeof(Elf32_Ehdr), 0);
|
||||
if (ret < 0)
|
||||
{
|
||||
bdbg("Failed to read ELF header: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
elf_dumpbuffer("ELF header", (FAR const uint8_t*)&loadinfo->header,
|
||||
sizeof(struct elf_hdr_s));
|
||||
elf_dumpbuffer("ELF header", (FAR const uint8_t*)&loadinfo->header, sizeof(Elf32_Ehdr));
|
||||
|
||||
/* Verify the ELF header */
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
#include <errno.h>
|
||||
|
||||
#include <arpa/inet.h>
|
||||
#include <nuttx/elf.h>
|
||||
#include <nuttx/binfmt/elf.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-Processor Definitions
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
#include <errno.h>
|
||||
|
||||
#include <arpa/inet.h>
|
||||
#include <nuttx/elf.h>
|
||||
#include <nuttx/binfmt/elf.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-Processor Definitions
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
#include <unistd.h>
|
||||
#include <debug.h>
|
||||
#include <errno.h>
|
||||
#include <nuttx/elf.h>
|
||||
#include <nuttx/binfmt/elf.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-Processor Definitions
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <nuttx/elf.h>
|
||||
#include <nuttx/binfmt/elf.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-Processor Definitions
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
#include <debug.h>
|
||||
#include <errno.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <nuttx/elf.h>
|
||||
#include <nuttx/binfmt/elf.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
@ -74,7 +74,7 @@
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int elf_verifyheader(const struct elf_hdr_s *header)
|
||||
int elf_verifyheader(const Elf32_Ehdr *header)
|
||||
{
|
||||
if (!header)
|
||||
{
|
||||
|
|
|
@ -47,8 +47,8 @@
|
|||
#include <debug.h>
|
||||
|
||||
#include <arpa/inet.h>
|
||||
#include <nuttx/nxflat.h>
|
||||
#include <nuttx/symtab.h>
|
||||
#include <nuttx/binfmt/nxflat.h>
|
||||
#include <nuttx/binfmt/symtab.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
#include <errno.h>
|
||||
|
||||
#include <arpa/inet.h>
|
||||
#include <nuttx/nxflat.h>
|
||||
#include <nuttx/binfmt/nxflat.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-Processor Definitions
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
#include <errno.h>
|
||||
|
||||
#include <arpa/inet.h>
|
||||
#include <nuttx/nxflat.h>
|
||||
#include <nuttx/binfmt/nxflat.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-Processor Definitions
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
#include <errno.h>
|
||||
|
||||
#include <arpa/inet.h>
|
||||
#include <nuttx/nxflat.h>
|
||||
#include <nuttx/binfmt/nxflat.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-Processor Definitions
|
||||
|
|
|
@ -42,7 +42,8 @@
|
|||
#include <unistd.h>
|
||||
#include <debug.h>
|
||||
#include <errno.h>
|
||||
#include <nuttx/nxflat.h>
|
||||
|
||||
#include <nuttx/binfmt/nxflat.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-Processor Definitions
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <nuttx/nxflat.h>
|
||||
#include <nuttx/binfmt/nxflat.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-Processor Definitions
|
||||
|
|
|
@ -42,8 +42,9 @@
|
|||
#include <string.h>
|
||||
#include <debug.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <arpa/inet.h>
|
||||
#include <nuttx/nxflat.h>
|
||||
#include <nuttx/binfmt/nxflat.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
|
|
@ -47,8 +47,8 @@
|
|||
#include <errno.h>
|
||||
|
||||
#include <arpa/inet.h>
|
||||
#include <nuttx/binfmt.h>
|
||||
#include <nuttx/nxflat.h>
|
||||
#include <nuttx/binfmt/binfmt.h>
|
||||
#include <nuttx/binfmt/nxflat.h>
|
||||
|
||||
#ifdef CONFIG_NXFLAT
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <nuttx/symtab.h>
|
||||
#include <nuttx/binfmt/symtab.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <nuttx/symtab.h>
|
||||
#include <nuttx/binfmt/symtab.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <nuttx/symtab.h>
|
||||
#include <nuttx/binfmt/symtab.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <nuttx/symtab.h>
|
||||
#include <nuttx/binfmt/symtab.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/****************************************************************************
|
||||
* include/nuttx/binfmt.h
|
||||
* include/nuttx/binfmt/binfmt.h
|
||||
*
|
||||
* Copyright (C) 2009 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2009, 2012 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -33,8 +33,8 @@
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __INCLUDE_NUTTX_BINFMT_H
|
||||
#define __INCLUDE_NUTTX_BINFMT_H
|
||||
#ifndef __INCLUDE_NUTTX_BINFMT_BINFMT_H
|
||||
#define __INCLUDE_NUTTX_BINFMT_BINFMT_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
|
@ -205,5 +205,5 @@ EXTERN int exec(FAR const char *filename, FAR const char **argv,
|
|||
}
|
||||
#endif
|
||||
|
||||
#endif /* __INCLUDE_NUTTX_BINFMT_H */
|
||||
#endif /* __INCLUDE_NUTTX_BINFMT_BINFMT_H */
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
/****************************************************************************
|
||||
* include/nuttx/elf.h
|
||||
* include/nuttx/binfmt/elf.h
|
||||
*
|
||||
* Copyright (C) 2009, 2012 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -33,8 +33,8 @@
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __INCLUDE_NUTTX_ELF_H
|
||||
#define __INCLUDE_NUTTX_ELF_H
|
||||
#ifndef __INCLUDE_NUTTX_BINFMT_ELF_H
|
||||
#define __INCLUDE_NUTTX_BINFMT_ELF_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
|
@ -89,9 +89,9 @@ struct elf_loadinfo_s
|
|||
|
||||
int filfd; /* Descriptor for the file being loaded */
|
||||
|
||||
/* This is a copy of the ELF header (still in network order) */
|
||||
/* This is a copy of the ELF header */
|
||||
|
||||
FAR struct elf_hdr_s header;
|
||||
Elf32_Ehdr header;
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -123,7 +123,7 @@ extern "C" {
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
EXTERN int elf_verifyheader(FAR const struct elf_hdr_s *header);
|
||||
EXTERN int elf_verifyheader(FAR const Elf32_Ehdr *header);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: elf_init
|
||||
|
@ -256,4 +256,4 @@ EXTERN void elf_uninitialize(void);
|
|||
}
|
||||
#endif
|
||||
|
||||
#endif /* __INCLUDE_NUTTX_ELF_H */
|
||||
#endif /* __INCLUDE_NUTTX_BINFMT_ELF_H */
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* include/nuttx/nxflat.h
|
||||
* include/nuttx/binfmt/nxflat.h
|
||||
*
|
||||
* Copyright (C) 2009, 2012 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
@ -33,8 +33,8 @@
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __INCLUDE_NUTTX_NXFLAT_H
|
||||
#define __INCLUDE_NUTTX_NXFLAT_H
|
||||
#ifndef __INCLUDE_NUTTX_BINFMT_NXFLAT_H
|
||||
#define __INCLUDE_NUTTX_BINFMT_NXFLAT_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
|
@ -261,4 +261,4 @@ EXTERN void nxflat_uninitialize(void);
|
|||
}
|
||||
#endif
|
||||
|
||||
#endif /* __INCLUDE_NUTTX_NXFLAT_H */
|
||||
#endif /* __INCLUDE_NUTTX_BINFMT_NXFLAT_H */
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* include/nuttx/symtab.h
|
||||
* include/nuttx/binfmt/symtab.h
|
||||
*
|
||||
* Copyright (C) 2009 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
@ -33,8 +33,8 @@
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __INCLUDE_NUTTX_SYMTAB_H
|
||||
#define __INCLUDE_NUTTX_SYMTAB_H
|
||||
#ifndef __INCLUDE_NUTTX_BINFMT_SYMTAB_H
|
||||
#define __INCLUDE_NUTTX_BINFMT_SYMTAB_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
|
@ -159,5 +159,5 @@ symtab_findorderedbyvalue(FAR const struct symtab_s *symtab,
|
|||
}
|
||||
#endif
|
||||
|
||||
#endif /* __INCLUDE_NUTTX_SYMTAB_H */
|
||||
#endif /* __INCLUDE_NUTTX_BINFMT_SYMTAB_H */
|
||||
|
|
@ -222,7 +222,7 @@ int main(int argc, char **argv, char **envp)
|
|||
|
||||
fprintf(outstream, "/* %s: Auto-generated symbol table. Do not edit */\n\n", symtab);
|
||||
fprintf(outstream, "#include <nuttx/config.h>\n");
|
||||
fprintf(outstream, "#include <nuttx/symtab.h>\n\n");
|
||||
fprintf(outstream, "#include <nuttx/binfmt/symtab.h>\n\n");
|
||||
|
||||
/* Output all of the require header files */
|
||||
|
||||
|
|
Loading…
Reference in New Issue