diff --git a/apps/examples/nxflat/nxflat_main.c b/apps/examples/nxflat/nxflat_main.c index 4cd2cd5375..2c0030c608 100644 --- a/apps/examples/nxflat/nxflat_main.c +++ b/apps/examples/nxflat/nxflat_main.c @@ -50,8 +50,8 @@ #include #include -#include -#include +#include +#include #include "tests/romfs.h" #include "tests/dirlist.h" diff --git a/apps/examples/nxflat/tests/mksymtab.sh b/apps/examples/nxflat/tests/mksymtab.sh index 611d3a87a0..4b5347f17f 100755 --- a/apps/examples/nxflat/tests/mksymtab.sh +++ b/apps/examples/nxflat/tests/mksymtab.sh @@ -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 " +echo "#include " echo "" echo "static const struct symtab_s exports[] = " echo "{" diff --git a/apps/examples/thttpd/content/mksymtab.sh b/apps/examples/thttpd/content/mksymtab.sh index 611d3a87a0..4b5347f17f 100755 --- a/apps/examples/thttpd/content/mksymtab.sh +++ b/apps/examples/thttpd/content/mksymtab.sh @@ -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 " +echo "#include " echo "" echo "static const struct symtab_s exports[] = " echo "{" diff --git a/apps/examples/thttpd/thttpd_main.c b/apps/examples/thttpd/thttpd_main.c index b31d0a8642..97f922a768 100644 --- a/apps/examples/thttpd/thttpd_main.c +++ b/apps/examples/thttpd/thttpd_main.c @@ -56,8 +56,8 @@ #include #include -#include -#include +#include +#include #ifdef CONFIG_NET_SLIP # include #endif diff --git a/apps/include/netutils/thttpd.h b/apps/include/netutils/thttpd.h index 92ed7ba974..217914c332 100644 --- a/apps/include/netutils/thttpd.h +++ b/apps/include/netutils/thttpd.h @@ -42,7 +42,7 @@ #include -#include +#include /**************************************************************************** * Public Data diff --git a/apps/netutils/thttpd/thttpd.c b/apps/netutils/thttpd/thttpd.c index 1b074902de..a04a932bf7 100644 --- a/apps/netutils/thttpd/thttpd.c +++ b/apps/netutils/thttpd/thttpd.c @@ -54,7 +54,7 @@ #include #include -#include +#include #include #include "config.h" diff --git a/apps/netutils/thttpd/thttpd_cgi.c b/apps/netutils/thttpd/thttpd_cgi.c index 9c0de509bd..31b1e0d8dd 100644 --- a/apps/netutils/thttpd/thttpd_cgi.c +++ b/apps/netutils/thttpd/thttpd_cgi.c @@ -53,8 +53,8 @@ #include #include -#include -#include +#include +#include #include #include "config.h" diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 59fa735449..c2c9a1413a 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -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/. + diff --git a/nuttx/Documentation/NuttXNxFlat.html b/nuttx/Documentation/NuttXNxFlat.html index c51e3b6a1d..2e6d2f59a8 100644 --- a/nuttx/Documentation/NuttXNxFlat.html +++ b/nuttx/Documentation/NuttXNxFlat.html @@ -554,19 +554,19 @@ cat ../syscall/syscall.csv ../lib/lib.csv | sort >tmp.csv diff --git a/nuttx/binfmt/binfmt_dumpmodule.c b/nuttx/binfmt/binfmt_dumpmodule.c index 32a3fef3e3..06e97e4572 100644 --- a/nuttx/binfmt/binfmt_dumpmodule.c +++ b/nuttx/binfmt/binfmt_dumpmodule.c @@ -43,7 +43,7 @@ #include #include -#include +#include #include "binfmt_internal.h" diff --git a/nuttx/binfmt/binfmt_exec.c b/nuttx/binfmt/binfmt_exec.c index c070324c31..60e8d8efde 100644 --- a/nuttx/binfmt/binfmt_exec.c +++ b/nuttx/binfmt/binfmt_exec.c @@ -44,7 +44,7 @@ #include #include -#include +#include #include "binfmt_internal.h" diff --git a/nuttx/binfmt/binfmt_execmodule.c b/nuttx/binfmt/binfmt_execmodule.c index 1b511b0cb8..bc76d4acfc 100644 --- a/nuttx/binfmt/binfmt_execmodule.c +++ b/nuttx/binfmt/binfmt_execmodule.c @@ -47,7 +47,7 @@ #include #include -#include +#include #include "os_internal.h" #include "binfmt_internal.h" diff --git a/nuttx/binfmt/binfmt_globals.c b/nuttx/binfmt/binfmt_globals.c index 069d3a2aa9..d3246bd506 100644 --- a/nuttx/binfmt/binfmt_globals.c +++ b/nuttx/binfmt/binfmt_globals.c @@ -39,7 +39,7 @@ #include -#include +#include #ifndef CONFIG_BINFMT_DISABLE diff --git a/nuttx/binfmt/binfmt_internal.h b/nuttx/binfmt/binfmt_internal.h index da67f5350b..4fab9724d4 100644 --- a/nuttx/binfmt/binfmt_internal.h +++ b/nuttx/binfmt/binfmt_internal.h @@ -42,7 +42,7 @@ #include -#include +#include /**************************************************************************** * Pre-processor Definitions diff --git a/nuttx/binfmt/binfmt_loadmodule.c b/nuttx/binfmt/binfmt_loadmodule.c index 01ab8cc883..e87075aa90 100644 --- a/nuttx/binfmt/binfmt_loadmodule.c +++ b/nuttx/binfmt/binfmt_loadmodule.c @@ -43,7 +43,7 @@ #include #include -#include +#include #include "binfmt_internal.h" diff --git a/nuttx/binfmt/binfmt_register.c b/nuttx/binfmt/binfmt_register.c index 7f6eef671a..925f29353f 100644 --- a/nuttx/binfmt/binfmt_register.c +++ b/nuttx/binfmt/binfmt_register.c @@ -44,7 +44,7 @@ #include #include -#include +#include #include "binfmt_internal.h" diff --git a/nuttx/binfmt/binfmt_unloadmodule.c b/nuttx/binfmt/binfmt_unloadmodule.c index 04859a2910..0de9dfccd1 100644 --- a/nuttx/binfmt/binfmt_unloadmodule.c +++ b/nuttx/binfmt/binfmt_unloadmodule.c @@ -45,7 +45,7 @@ #include #include -#include +#include #include "binfmt_internal.h" diff --git a/nuttx/binfmt/binfmt_unregister.c b/nuttx/binfmt/binfmt_unregister.c index b97b9b67dd..f895e354d0 100644 --- a/nuttx/binfmt/binfmt_unregister.c +++ b/nuttx/binfmt/binfmt_unregister.c @@ -44,7 +44,7 @@ #include #include -#include +#include #include "binfmt_internal.h" diff --git a/nuttx/binfmt/elf.c b/nuttx/binfmt/elf.c index 74a35174f3..fb3b5acd23 100644 --- a/nuttx/binfmt/elf.c +++ b/nuttx/binfmt/elf.c @@ -47,8 +47,8 @@ #include #include -#include -#include +#include +#include #ifdef CONFIG_ELF diff --git a/nuttx/binfmt/libelf/libelf_bind.c b/nuttx/binfmt/libelf/libelf_bind.c index 44532ab88d..87afe79c9f 100644 --- a/nuttx/binfmt/libelf/libelf_bind.c +++ b/nuttx/binfmt/libelf/libelf_bind.c @@ -47,8 +47,8 @@ #include #include -#include -#include +#include +#include /**************************************************************************** * Pre-processor Definitions diff --git a/nuttx/binfmt/libelf/libelf_init.c b/nuttx/binfmt/libelf/libelf_init.c index d72e96b622..71b6b92272 100644 --- a/nuttx/binfmt/libelf/libelf_init.c +++ b/nuttx/binfmt/libelf/libelf_init.c @@ -48,7 +48,7 @@ #include #include -#include +#include /**************************************************************************** * 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 */ diff --git a/nuttx/binfmt/libelf/libelf_load.c b/nuttx/binfmt/libelf/libelf_load.c index 94d200b568..26785f6b1c 100644 --- a/nuttx/binfmt/libelf/libelf_load.c +++ b/nuttx/binfmt/libelf/libelf_load.c @@ -48,7 +48,7 @@ #include #include -#include +#include /**************************************************************************** * Pre-Processor Definitions diff --git a/nuttx/binfmt/libelf/libelf_read.c b/nuttx/binfmt/libelf/libelf_read.c index 5f00a531e4..3770301747 100644 --- a/nuttx/binfmt/libelf/libelf_read.c +++ b/nuttx/binfmt/libelf/libelf_read.c @@ -48,7 +48,7 @@ #include #include -#include +#include /**************************************************************************** * Pre-Processor Definitions diff --git a/nuttx/binfmt/libelf/libelf_uninit.c b/nuttx/binfmt/libelf/libelf_uninit.c index cd7ae72827..e5fa2e6c33 100644 --- a/nuttx/binfmt/libelf/libelf_uninit.c +++ b/nuttx/binfmt/libelf/libelf_uninit.c @@ -42,7 +42,7 @@ #include #include #include -#include +#include /**************************************************************************** * Pre-Processor Definitions diff --git a/nuttx/binfmt/libelf/libelf_unload.c b/nuttx/binfmt/libelf/libelf_unload.c index 9e930e295f..9a198fc780 100644 --- a/nuttx/binfmt/libelf/libelf_unload.c +++ b/nuttx/binfmt/libelf/libelf_unload.c @@ -43,7 +43,7 @@ #include #include -#include +#include /**************************************************************************** * Pre-Processor Definitions diff --git a/nuttx/binfmt/libelf/libelf_verify.c b/nuttx/binfmt/libelf/libelf_verify.c index 9e265573a5..9139700b34 100644 --- a/nuttx/binfmt/libelf/libelf_verify.c +++ b/nuttx/binfmt/libelf/libelf_verify.c @@ -43,7 +43,7 @@ #include #include #include -#include +#include /**************************************************************************** * 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) { diff --git a/nuttx/binfmt/libnxflat/libnxflat_bind.c b/nuttx/binfmt/libnxflat/libnxflat_bind.c index c18a16cd8f..2b9f647159 100644 --- a/nuttx/binfmt/libnxflat/libnxflat_bind.c +++ b/nuttx/binfmt/libnxflat/libnxflat_bind.c @@ -47,8 +47,8 @@ #include #include -#include -#include +#include +#include /**************************************************************************** * Pre-processor Definitions diff --git a/nuttx/binfmt/libnxflat/libnxflat_init.c b/nuttx/binfmt/libnxflat/libnxflat_init.c index 5b6375ff16..20f06c6ab7 100644 --- a/nuttx/binfmt/libnxflat/libnxflat_init.c +++ b/nuttx/binfmt/libnxflat/libnxflat_init.c @@ -48,7 +48,7 @@ #include #include -#include +#include /**************************************************************************** * Pre-Processor Definitions diff --git a/nuttx/binfmt/libnxflat/libnxflat_load.c b/nuttx/binfmt/libnxflat/libnxflat_load.c index 0991d0c2d7..02f035072d 100644 --- a/nuttx/binfmt/libnxflat/libnxflat_load.c +++ b/nuttx/binfmt/libnxflat/libnxflat_load.c @@ -48,7 +48,7 @@ #include #include -#include +#include /**************************************************************************** * Pre-Processor Definitions diff --git a/nuttx/binfmt/libnxflat/libnxflat_read.c b/nuttx/binfmt/libnxflat/libnxflat_read.c index dbcd542791..da05bc3999 100644 --- a/nuttx/binfmt/libnxflat/libnxflat_read.c +++ b/nuttx/binfmt/libnxflat/libnxflat_read.c @@ -48,7 +48,7 @@ #include #include -#include +#include /**************************************************************************** * Pre-Processor Definitions diff --git a/nuttx/binfmt/libnxflat/libnxflat_uninit.c b/nuttx/binfmt/libnxflat/libnxflat_uninit.c index c507fdc14c..b9715196b9 100644 --- a/nuttx/binfmt/libnxflat/libnxflat_uninit.c +++ b/nuttx/binfmt/libnxflat/libnxflat_uninit.c @@ -42,7 +42,8 @@ #include #include #include -#include + +#include /**************************************************************************** * Pre-Processor Definitions diff --git a/nuttx/binfmt/libnxflat/libnxflat_unload.c b/nuttx/binfmt/libnxflat/libnxflat_unload.c index 55a2e45e60..47c30bd55f 100644 --- a/nuttx/binfmt/libnxflat/libnxflat_unload.c +++ b/nuttx/binfmt/libnxflat/libnxflat_unload.c @@ -43,7 +43,7 @@ #include #include -#include +#include /**************************************************************************** * Pre-Processor Definitions diff --git a/nuttx/binfmt/libnxflat/libnxflat_verify.c b/nuttx/binfmt/libnxflat/libnxflat_verify.c index da25d21c71..20af5d2f74 100644 --- a/nuttx/binfmt/libnxflat/libnxflat_verify.c +++ b/nuttx/binfmt/libnxflat/libnxflat_verify.c @@ -42,8 +42,9 @@ #include #include #include + #include -#include +#include /**************************************************************************** * Pre-processor Definitions diff --git a/nuttx/binfmt/nxflat.c b/nuttx/binfmt/nxflat.c index 4f5869bd92..babc51ff95 100644 --- a/nuttx/binfmt/nxflat.c +++ b/nuttx/binfmt/nxflat.c @@ -47,8 +47,8 @@ #include #include -#include -#include +#include +#include #ifdef CONFIG_NXFLAT diff --git a/nuttx/binfmt/symtab_findbyname.c b/nuttx/binfmt/symtab_findbyname.c index 201d7ba07d..c0343e2708 100644 --- a/nuttx/binfmt/symtab_findbyname.c +++ b/nuttx/binfmt/symtab_findbyname.c @@ -44,7 +44,7 @@ #include #include -#include +#include /**************************************************************************** * Pre-processor Definitions diff --git a/nuttx/binfmt/symtab_findbyvalue.c b/nuttx/binfmt/symtab_findbyvalue.c index 4382ed5d8d..c47d5c7518 100644 --- a/nuttx/binfmt/symtab_findbyvalue.c +++ b/nuttx/binfmt/symtab_findbyvalue.c @@ -44,7 +44,7 @@ #include #include -#include +#include /**************************************************************************** * Pre-processor Definitions diff --git a/nuttx/binfmt/symtab_findorderedbyname.c b/nuttx/binfmt/symtab_findorderedbyname.c index 61decf49ad..a678788e78 100644 --- a/nuttx/binfmt/symtab_findorderedbyname.c +++ b/nuttx/binfmt/symtab_findorderedbyname.c @@ -44,7 +44,7 @@ #include #include -#include +#include /**************************************************************************** * Pre-processor Definitions diff --git a/nuttx/binfmt/symtab_findorderedbyvalue.c b/nuttx/binfmt/symtab_findorderedbyvalue.c index 92b107856d..bad4bf8cd7 100644 --- a/nuttx/binfmt/symtab_findorderedbyvalue.c +++ b/nuttx/binfmt/symtab_findorderedbyvalue.c @@ -44,7 +44,7 @@ #include #include -#include +#include /**************************************************************************** * Pre-processor Definitions diff --git a/nuttx/include/nuttx/binfmt.h b/nuttx/include/nuttx/binfmt/binfmt.h similarity index 97% rename from nuttx/include/nuttx/binfmt.h rename to nuttx/include/nuttx/binfmt/binfmt.h index 70beda3933..82e5f3557c 100644 --- a/nuttx/include/nuttx/binfmt.h +++ b/nuttx/include/nuttx/binfmt/binfmt.h @@ -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 * * 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 */ diff --git a/nuttx/include/nuttx/elf.h b/nuttx/include/nuttx/binfmt/elf.h similarity index 96% rename from nuttx/include/nuttx/elf.h rename to nuttx/include/nuttx/binfmt/elf.h index 4be2c23a04..8937790b13 100644 --- a/nuttx/include/nuttx/elf.h +++ b/nuttx/include/nuttx/binfmt/elf.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 * * 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 */ diff --git a/nuttx/include/nuttx/nxflat.h b/nuttx/include/nuttx/binfmt/nxflat.h similarity index 98% rename from nuttx/include/nuttx/nxflat.h rename to nuttx/include/nuttx/binfmt/nxflat.h index 59dcea854a..89e28fbcc1 100644 --- a/nuttx/include/nuttx/nxflat.h +++ b/nuttx/include/nuttx/binfmt/nxflat.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 @@ -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 */ diff --git a/nuttx/include/nuttx/symtab.h b/nuttx/include/nuttx/binfmt/symtab.h similarity index 97% rename from nuttx/include/nuttx/symtab.h rename to nuttx/include/nuttx/binfmt/symtab.h index b302ab20a9..497327031d 100644 --- a/nuttx/include/nuttx/symtab.h +++ b/nuttx/include/nuttx/binfmt/symtab.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 @@ -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 */ diff --git a/nuttx/tools/mksymtab.c b/nuttx/tools/mksymtab.c index c5a46a92be..e401812c00 100644 --- a/nuttx/tools/mksymtab.c +++ b/nuttx/tools/mksymtab.c @@ -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 \n"); - fprintf(outstream, "#include \n\n"); + fprintf(outstream, "#include \n\n"); /* Output all of the require header files */