From b8f437ef4b6fbdb3bcdbe2f0488e2ccd3a7bf2df Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 24 Oct 2012 20:19:44 +0000 Subject: [PATCH] Move binfmt.h, nxflat.h, elf.h, and symtab.h to include/nuttx/binfmt/ git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5252 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog | 3 +++ Documentation/NuttXNxFlat.html | 12 ++++++------ binfmt/binfmt_dumpmodule.c | 2 +- binfmt/binfmt_exec.c | 2 +- binfmt/binfmt_execmodule.c | 2 +- binfmt/binfmt_globals.c | 2 +- binfmt/binfmt_internal.h | 2 +- binfmt/binfmt_loadmodule.c | 2 +- binfmt/binfmt_register.c | 2 +- binfmt/binfmt_unloadmodule.c | 2 +- binfmt/binfmt_unregister.c | 2 +- binfmt/elf.c | 4 ++-- binfmt/libelf/libelf_bind.c | 4 ++-- binfmt/libelf/libelf_init.c | 8 +++----- binfmt/libelf/libelf_load.c | 2 +- binfmt/libelf/libelf_read.c | 2 +- binfmt/libelf/libelf_uninit.c | 2 +- binfmt/libelf/libelf_unload.c | 2 +- binfmt/libelf/libelf_verify.c | 4 ++-- binfmt/libnxflat/libnxflat_bind.c | 4 ++-- binfmt/libnxflat/libnxflat_init.c | 2 +- binfmt/libnxflat/libnxflat_load.c | 2 +- binfmt/libnxflat/libnxflat_read.c | 2 +- binfmt/libnxflat/libnxflat_uninit.c | 3 ++- binfmt/libnxflat/libnxflat_unload.c | 2 +- binfmt/libnxflat/libnxflat_verify.c | 3 ++- binfmt/nxflat.c | 4 ++-- binfmt/symtab_findbyname.c | 2 +- binfmt/symtab_findbyvalue.c | 2 +- binfmt/symtab_findorderedbyname.c | 2 +- binfmt/symtab_findorderedbyvalue.c | 2 +- include/nuttx/{ => binfmt}/binfmt.h | 10 +++++----- include/nuttx/{ => binfmt}/elf.h | 16 ++++++++-------- include/nuttx/{ => binfmt}/nxflat.h | 8 ++++---- include/nuttx/{ => binfmt}/symtab.h | 8 ++++---- tools/mksymtab.c | 2 +- 36 files changed, 69 insertions(+), 66 deletions(-) rename include/nuttx/{ => binfmt}/binfmt.h (97%) rename include/nuttx/{ => binfmt}/elf.h (96%) rename include/nuttx/{ => binfmt}/nxflat.h (98%) rename include/nuttx/{ => binfmt}/symtab.h (97%) diff --git a/ChangeLog b/ChangeLog index 59fa735449d..c2c9a1413ad 100644 --- a/ChangeLog +++ b/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/Documentation/NuttXNxFlat.html b/Documentation/NuttXNxFlat.html index c51e3b6a1df..2e6d2f59a86 100644 --- a/Documentation/NuttXNxFlat.html +++ b/Documentation/NuttXNxFlat.html @@ -554,19 +554,19 @@ cat ../syscall/syscall.csv ../lib/lib.csv | sort >tmp.csv diff --git a/binfmt/binfmt_dumpmodule.c b/binfmt/binfmt_dumpmodule.c index 32a3fef3e35..06e97e45720 100644 --- a/binfmt/binfmt_dumpmodule.c +++ b/binfmt/binfmt_dumpmodule.c @@ -43,7 +43,7 @@ #include #include -#include +#include #include "binfmt_internal.h" diff --git a/binfmt/binfmt_exec.c b/binfmt/binfmt_exec.c index c070324c316..60e8d8efdee 100644 --- a/binfmt/binfmt_exec.c +++ b/binfmt/binfmt_exec.c @@ -44,7 +44,7 @@ #include #include -#include +#include #include "binfmt_internal.h" diff --git a/binfmt/binfmt_execmodule.c b/binfmt/binfmt_execmodule.c index 1b511b0cb8a..bc76d4acfc3 100644 --- a/binfmt/binfmt_execmodule.c +++ b/binfmt/binfmt_execmodule.c @@ -47,7 +47,7 @@ #include #include -#include +#include #include "os_internal.h" #include "binfmt_internal.h" diff --git a/binfmt/binfmt_globals.c b/binfmt/binfmt_globals.c index 069d3a2aa9f..d3246bd5069 100644 --- a/binfmt/binfmt_globals.c +++ b/binfmt/binfmt_globals.c @@ -39,7 +39,7 @@ #include -#include +#include #ifndef CONFIG_BINFMT_DISABLE diff --git a/binfmt/binfmt_internal.h b/binfmt/binfmt_internal.h index da67f5350b4..4fab9724d49 100644 --- a/binfmt/binfmt_internal.h +++ b/binfmt/binfmt_internal.h @@ -42,7 +42,7 @@ #include -#include +#include /**************************************************************************** * Pre-processor Definitions diff --git a/binfmt/binfmt_loadmodule.c b/binfmt/binfmt_loadmodule.c index 01ab8cc8832..e87075aa906 100644 --- a/binfmt/binfmt_loadmodule.c +++ b/binfmt/binfmt_loadmodule.c @@ -43,7 +43,7 @@ #include #include -#include +#include #include "binfmt_internal.h" diff --git a/binfmt/binfmt_register.c b/binfmt/binfmt_register.c index 7f6eef671a6..925f29353fd 100644 --- a/binfmt/binfmt_register.c +++ b/binfmt/binfmt_register.c @@ -44,7 +44,7 @@ #include #include -#include +#include #include "binfmt_internal.h" diff --git a/binfmt/binfmt_unloadmodule.c b/binfmt/binfmt_unloadmodule.c index 04859a29109..0de9dfccd19 100644 --- a/binfmt/binfmt_unloadmodule.c +++ b/binfmt/binfmt_unloadmodule.c @@ -45,7 +45,7 @@ #include #include -#include +#include #include "binfmt_internal.h" diff --git a/binfmt/binfmt_unregister.c b/binfmt/binfmt_unregister.c index b97b9b67dd1..f895e354d07 100644 --- a/binfmt/binfmt_unregister.c +++ b/binfmt/binfmt_unregister.c @@ -44,7 +44,7 @@ #include #include -#include +#include #include "binfmt_internal.h" diff --git a/binfmt/elf.c b/binfmt/elf.c index 74a35174f37..fb3b5acd233 100644 --- a/binfmt/elf.c +++ b/binfmt/elf.c @@ -47,8 +47,8 @@ #include #include -#include -#include +#include +#include #ifdef CONFIG_ELF diff --git a/binfmt/libelf/libelf_bind.c b/binfmt/libelf/libelf_bind.c index 44532ab88d4..87afe79c9fa 100644 --- a/binfmt/libelf/libelf_bind.c +++ b/binfmt/libelf/libelf_bind.c @@ -47,8 +47,8 @@ #include #include -#include -#include +#include +#include /**************************************************************************** * Pre-processor Definitions diff --git a/binfmt/libelf/libelf_init.c b/binfmt/libelf/libelf_init.c index d72e96b6221..71b6b922723 100644 --- a/binfmt/libelf/libelf_init.c +++ b/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/binfmt/libelf/libelf_load.c b/binfmt/libelf/libelf_load.c index 94d200b5686..26785f6b1c8 100644 --- a/binfmt/libelf/libelf_load.c +++ b/binfmt/libelf/libelf_load.c @@ -48,7 +48,7 @@ #include #include -#include +#include /**************************************************************************** * Pre-Processor Definitions diff --git a/binfmt/libelf/libelf_read.c b/binfmt/libelf/libelf_read.c index 5f00a531e40..37703017472 100644 --- a/binfmt/libelf/libelf_read.c +++ b/binfmt/libelf/libelf_read.c @@ -48,7 +48,7 @@ #include #include -#include +#include /**************************************************************************** * Pre-Processor Definitions diff --git a/binfmt/libelf/libelf_uninit.c b/binfmt/libelf/libelf_uninit.c index cd7ae728274..e5fa2e6c338 100644 --- a/binfmt/libelf/libelf_uninit.c +++ b/binfmt/libelf/libelf_uninit.c @@ -42,7 +42,7 @@ #include #include #include -#include +#include /**************************************************************************** * Pre-Processor Definitions diff --git a/binfmt/libelf/libelf_unload.c b/binfmt/libelf/libelf_unload.c index 9e930e295f3..9a198fc780e 100644 --- a/binfmt/libelf/libelf_unload.c +++ b/binfmt/libelf/libelf_unload.c @@ -43,7 +43,7 @@ #include #include -#include +#include /**************************************************************************** * Pre-Processor Definitions diff --git a/binfmt/libelf/libelf_verify.c b/binfmt/libelf/libelf_verify.c index 9e265573a54..9139700b34d 100644 --- a/binfmt/libelf/libelf_verify.c +++ b/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/binfmt/libnxflat/libnxflat_bind.c b/binfmt/libnxflat/libnxflat_bind.c index c18a16cd8f5..2b9f647159f 100644 --- a/binfmt/libnxflat/libnxflat_bind.c +++ b/binfmt/libnxflat/libnxflat_bind.c @@ -47,8 +47,8 @@ #include #include -#include -#include +#include +#include /**************************************************************************** * Pre-processor Definitions diff --git a/binfmt/libnxflat/libnxflat_init.c b/binfmt/libnxflat/libnxflat_init.c index 5b6375ff168..20f06c6ab78 100644 --- a/binfmt/libnxflat/libnxflat_init.c +++ b/binfmt/libnxflat/libnxflat_init.c @@ -48,7 +48,7 @@ #include #include -#include +#include /**************************************************************************** * Pre-Processor Definitions diff --git a/binfmt/libnxflat/libnxflat_load.c b/binfmt/libnxflat/libnxflat_load.c index 0991d0c2d79..02f035072d9 100644 --- a/binfmt/libnxflat/libnxflat_load.c +++ b/binfmt/libnxflat/libnxflat_load.c @@ -48,7 +48,7 @@ #include #include -#include +#include /**************************************************************************** * Pre-Processor Definitions diff --git a/binfmt/libnxflat/libnxflat_read.c b/binfmt/libnxflat/libnxflat_read.c index dbcd5427915..da05bc39997 100644 --- a/binfmt/libnxflat/libnxflat_read.c +++ b/binfmt/libnxflat/libnxflat_read.c @@ -48,7 +48,7 @@ #include #include -#include +#include /**************************************************************************** * Pre-Processor Definitions diff --git a/binfmt/libnxflat/libnxflat_uninit.c b/binfmt/libnxflat/libnxflat_uninit.c index c507fdc14c6..b9715196b91 100644 --- a/binfmt/libnxflat/libnxflat_uninit.c +++ b/binfmt/libnxflat/libnxflat_uninit.c @@ -42,7 +42,8 @@ #include #include #include -#include + +#include /**************************************************************************** * Pre-Processor Definitions diff --git a/binfmt/libnxflat/libnxflat_unload.c b/binfmt/libnxflat/libnxflat_unload.c index 55a2e45e603..47c30bd55f0 100644 --- a/binfmt/libnxflat/libnxflat_unload.c +++ b/binfmt/libnxflat/libnxflat_unload.c @@ -43,7 +43,7 @@ #include #include -#include +#include /**************************************************************************** * Pre-Processor Definitions diff --git a/binfmt/libnxflat/libnxflat_verify.c b/binfmt/libnxflat/libnxflat_verify.c index da25d21c710..20af5d2f743 100644 --- a/binfmt/libnxflat/libnxflat_verify.c +++ b/binfmt/libnxflat/libnxflat_verify.c @@ -42,8 +42,9 @@ #include #include #include + #include -#include +#include /**************************************************************************** * Pre-processor Definitions diff --git a/binfmt/nxflat.c b/binfmt/nxflat.c index 4f5869bd92e..babc51ff958 100644 --- a/binfmt/nxflat.c +++ b/binfmt/nxflat.c @@ -47,8 +47,8 @@ #include #include -#include -#include +#include +#include #ifdef CONFIG_NXFLAT diff --git a/binfmt/symtab_findbyname.c b/binfmt/symtab_findbyname.c index 201d7ba07d1..c0343e2708b 100644 --- a/binfmt/symtab_findbyname.c +++ b/binfmt/symtab_findbyname.c @@ -44,7 +44,7 @@ #include #include -#include +#include /**************************************************************************** * Pre-processor Definitions diff --git a/binfmt/symtab_findbyvalue.c b/binfmt/symtab_findbyvalue.c index 4382ed5d8dd..c47d5c7518f 100644 --- a/binfmt/symtab_findbyvalue.c +++ b/binfmt/symtab_findbyvalue.c @@ -44,7 +44,7 @@ #include #include -#include +#include /**************************************************************************** * Pre-processor Definitions diff --git a/binfmt/symtab_findorderedbyname.c b/binfmt/symtab_findorderedbyname.c index 61decf49adb..a678788e78b 100644 --- a/binfmt/symtab_findorderedbyname.c +++ b/binfmt/symtab_findorderedbyname.c @@ -44,7 +44,7 @@ #include #include -#include +#include /**************************************************************************** * Pre-processor Definitions diff --git a/binfmt/symtab_findorderedbyvalue.c b/binfmt/symtab_findorderedbyvalue.c index 92b107856df..bad4bf8cd78 100644 --- a/binfmt/symtab_findorderedbyvalue.c +++ b/binfmt/symtab_findorderedbyvalue.c @@ -44,7 +44,7 @@ #include #include -#include +#include /**************************************************************************** * Pre-processor Definitions diff --git a/include/nuttx/binfmt.h b/include/nuttx/binfmt/binfmt.h similarity index 97% rename from include/nuttx/binfmt.h rename to include/nuttx/binfmt/binfmt.h index 70beda3933d..82e5f3557ca 100644 --- a/include/nuttx/binfmt.h +++ b/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/include/nuttx/elf.h b/include/nuttx/binfmt/elf.h similarity index 96% rename from include/nuttx/elf.h rename to include/nuttx/binfmt/elf.h index 4be2c23a04a..8937790b130 100644 --- a/include/nuttx/elf.h +++ b/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/include/nuttx/nxflat.h b/include/nuttx/binfmt/nxflat.h similarity index 98% rename from include/nuttx/nxflat.h rename to include/nuttx/binfmt/nxflat.h index 59dcea854ae..89e28fbcc1e 100644 --- a/include/nuttx/nxflat.h +++ b/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/include/nuttx/symtab.h b/include/nuttx/binfmt/symtab.h similarity index 97% rename from include/nuttx/symtab.h rename to include/nuttx/binfmt/symtab.h index b302ab20a97..497327031d1 100644 --- a/include/nuttx/symtab.h +++ b/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/tools/mksymtab.c b/tools/mksymtab.c index c5a46a92beb..e401812c000 100644 --- a/tools/mksymtab.c +++ b/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 */