This is an automated email from the ASF dual-hosted git repository.

pkarashchenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit ebcb03dce9a952429fd3233cf02ecbc6c7ec38ef
Author: Xiang Xiao <[email protected]>
AuthorDate: Sun Jul 9 05:23:32 2023 +0800

    libc/symtab: Don't include symtab.h in the header files
    
    to unify the inclusion of symtab.h only from the source files
    
    Signed-off-by: Xiang Xiao <[email protected]>
---
 binfmt/binfmt_execsymtab.c        |  2 +-
 include/nuttx/allsyms.h           |  4 +---
 include/nuttx/binfmt/elf.h        | 18 ++++++++----------
 include/nuttx/binfmt/symtab.h     |  4 +---
 include/nuttx/lib/modlib.h        |  4 +---
 libs/libc/dlfcn/lib_dlsym.c       |  1 +
 libs/libc/modlib/modlib_symbols.c |  1 +
 libs/libc/modlib/modlib_symtab.c  |  1 +
 libs/libc/stdio/lib_libvsprintf.c |  1 +
 libs/libc/symtab/symtab_allsyms.c |  1 +
 sched/module/mod_modsym.c         |  1 +
 11 files changed, 18 insertions(+), 20 deletions(-)

diff --git a/binfmt/binfmt_execsymtab.c b/binfmt/binfmt_execsymtab.c
index 2ecf4f29c2..ef810f7a1e 100644
--- a/binfmt/binfmt_execsymtab.c
+++ b/binfmt/binfmt_execsymtab.c
@@ -27,7 +27,7 @@
 #include <assert.h>
 
 #include <nuttx/irq.h>
-#include <nuttx/arch.h>
+#include <nuttx/symtab.h>
 #include <nuttx/binfmt/symtab.h>
 
 #ifdef CONFIG_LIBC_EXECFUNCS
diff --git a/include/nuttx/allsyms.h b/include/nuttx/allsyms.h
index 46272c04bc..e068d3eec2 100644
--- a/include/nuttx/allsyms.h
+++ b/include/nuttx/allsyms.h
@@ -25,9 +25,6 @@
  * Included Files
  ****************************************************************************/
 
-#include <nuttx/compiler.h>
-#include <nuttx/symtab.h>
-
 #include <stddef.h>
 
 /****************************************************************************
@@ -55,6 +52,7 @@ extern "C"
  *
  ****************************************************************************/
 
+struct symtab_s;
 FAR const struct symtab_s *allsyms_findbyname(FAR const char *name,
                                               FAR size_t *size);
 
diff --git a/include/nuttx/binfmt/elf.h b/include/nuttx/binfmt/elf.h
index 1484f2d47f..3f35f609c5 100644
--- a/include/nuttx/binfmt/elf.h
+++ b/include/nuttx/binfmt/elf.h
@@ -28,12 +28,10 @@
 #include <nuttx/config.h>
 
 #include <sys/types.h>
-
 #include <stdint.h>
 #include <stdbool.h>
 #include <elf.h>
 
-#include <nuttx/arch.h>
 #include <nuttx/binfmt/binfmt.h>
 
 /****************************************************************************
@@ -92,15 +90,15 @@ struct elf_loadinfo_s
    * after the ELF module has been loaded.
    */
 
-  uintptr_t         textalloc;   /* .text memory allocated when ELF file was 
loaded */
-  uintptr_t         dataalloc;   /* .bss/.data memory allocated when ELF file 
was loaded */
-  size_t            textsize;    /* Size of the ELF .text memory allocation */
-  size_t            datasize;    /* Size of the ELF .bss/.data memory 
allocation */
-  size_t            textalign;   /* Necessary alignment of .text */
-  size_t            dataalign;   /* Necessary alignment of .bss/.data */
-  off_t             filelen;     /* Length of the entire ELF file */
+  uintptr_t          textalloc;  /* .text memory allocated when ELF file was 
loaded */
+  uintptr_t          dataalloc;  /* .bss/.data memory allocated when ELF file 
was loaded */
+  size_t             textsize;   /* Size of the ELF .text memory allocation */
+  size_t             datasize;   /* Size of the ELF .bss/.data memory 
allocation */
+  size_t             textalign;  /* Necessary alignment of .text */
+  size_t             dataalign;  /* Necessary alignment of .bss/.data */
+  off_t              filelen;    /* Length of the entire ELF file */
 
-  Elf_Ehdr          ehdr;        /* Buffered ELF file header */
+  Elf_Ehdr           ehdr;       /* Buffered ELF file header */
   FAR Elf_Shdr      *shdr;       /* Buffered ELF section headers */
   uint8_t           *iobuffer;   /* File I/O buffer */
 
diff --git a/include/nuttx/binfmt/symtab.h b/include/nuttx/binfmt/symtab.h
index ef9f382352..9bbade8f1d 100644
--- a/include/nuttx/binfmt/symtab.h
+++ b/include/nuttx/binfmt/symtab.h
@@ -25,9 +25,6 @@
  * Included Files
  ****************************************************************************/
 
-#include <nuttx/config.h>
-#include <nuttx/symtab.h>
-
 /****************************************************************************
  * Public Functions Definitions
  ****************************************************************************/
@@ -58,6 +55,7 @@ extern "C"
  *
  ****************************************************************************/
 
+struct symtab_s;
 void exec_getsymtab(FAR const struct symtab_s **symtab, FAR int *nsymbols);
 
 /****************************************************************************
diff --git a/include/nuttx/lib/modlib.h b/include/nuttx/lib/modlib.h
index 505972d45e..e60e30d225 100644
--- a/include/nuttx/lib/modlib.h
+++ b/include/nuttx/lib/modlib.h
@@ -30,9 +30,6 @@
 #include <sys/types.h>
 #include <elf.h>
 
-#include <nuttx/arch.h>
-#include <nuttx/symtab.h>
-
 /****************************************************************************
  * Pre-processor Definitions
  ****************************************************************************/
@@ -117,6 +114,7 @@ typedef CODE int (*mod_uninitializer_t)(FAR void *arg);
  *   nexports      - The number of symbols in the exported symbol table.
  */
 
+struct symtab_s;
 struct mod_info_s
 {
   mod_uninitializer_t uninitializer;   /* Module uninitializer */
diff --git a/libs/libc/dlfcn/lib_dlsym.c b/libs/libc/dlfcn/lib_dlsym.c
index ce116b180e..66fa6af077 100644
--- a/libs/libc/dlfcn/lib_dlsym.c
+++ b/libs/libc/dlfcn/lib_dlsym.c
@@ -29,6 +29,7 @@
 #include <debug.h>
 #include <errno.h>
 
+#include <nuttx/symtab.h>
 #include <nuttx/module.h>
 #include <nuttx/lib/modlib.h>
 
diff --git a/libs/libc/modlib/modlib_symbols.c 
b/libs/libc/modlib/modlib_symbols.c
index 21ddcd3d18..26784587bd 100644
--- a/libs/libc/modlib/modlib_symbols.c
+++ b/libs/libc/modlib/modlib_symbols.c
@@ -31,6 +31,7 @@
 #include <errno.h>
 #include <debug.h>
 
+#include <nuttx/symtab.h>
 #include <nuttx/lib/modlib.h>
 
 #include "libc.h"
diff --git a/libs/libc/modlib/modlib_symtab.c b/libs/libc/modlib/modlib_symtab.c
index af3292334a..203c4e5d9b 100644
--- a/libs/libc/modlib/modlib_symtab.c
+++ b/libs/libc/modlib/modlib_symtab.c
@@ -26,6 +26,7 @@
 
 #include <assert.h>
 
+#include <nuttx/symtab.h>
 #include <nuttx/lib/modlib.h>
 
 /****************************************************************************
diff --git a/libs/libc/stdio/lib_libvsprintf.c 
b/libs/libc/stdio/lib_libvsprintf.c
index efef971194..a49fee0daa 100644
--- a/libs/libc/stdio/lib_libvsprintf.c
+++ b/libs/libc/stdio/lib_libvsprintf.c
@@ -51,6 +51,7 @@
 #include <nuttx/compiler.h>
 #include <nuttx/streams.h>
 #include <nuttx/allsyms.h>
+#include <nuttx/symtab.h>
 
 #include "lib_dtoa_engine.h"
 #include "lib_ultoa_invert.h"
diff --git a/libs/libc/symtab/symtab_allsyms.c 
b/libs/libc/symtab/symtab_allsyms.c
index eb34ec1c80..436d0c5dbb 100644
--- a/libs/libc/symtab/symtab_allsyms.c
+++ b/libs/libc/symtab/symtab_allsyms.c
@@ -23,6 +23,7 @@
  ****************************************************************************/
 
 #include <nuttx/allsyms.h>
+#include <nuttx/symtab.h>
 
 /****************************************************************************
  * Public Data
diff --git a/sched/module/mod_modsym.c b/sched/module/mod_modsym.c
index b694d557a1..31946a1b48 100644
--- a/sched/module/mod_modsym.c
+++ b/sched/module/mod_modsym.c
@@ -28,6 +28,7 @@
 #include <errno.h>
 #include <debug.h>
 
+#include <nuttx/symtab.h>
 #include <nuttx/module.h>
 #include <nuttx/lib/modlib.h>
 

Reply via email to