This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 1efbe6b302 binfmt/modlib: reduce size of binary_s if
CONFIG_LIBC_MODLIB is disabled
1efbe6b302 is described below
commit 1efbe6b302605399aa6a0a4b95476aafaf88fa5e
Author: chao an <[email protected]>
AuthorDate: Wed Dec 11 08:50:34 2024 +0800
binfmt/modlib: reduce size of binary_s if CONFIG_LIBC_MODLIB is disabled
Test on nsh/sim
before:
sizeof(struct binary_s): 216
after:
sizeof(struct binary_s): 56(-160)
Signed-off-by: chao an <[email protected]>
---
include/nuttx/binfmt/binfmt.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/include/nuttx/binfmt/binfmt.h b/include/nuttx/binfmt/binfmt.h
index bd39cd2703..d3787bf11b 100644
--- a/include/nuttx/binfmt/binfmt.h
+++ b/include/nuttx/binfmt/binfmt.h
@@ -68,8 +68,14 @@ struct binary_s
main_t entrypt; /* Entry point into a program module */
FAR void *mapped; /* Memory-mapped, address space */
+
+#ifdef CONFIG_LIBC_MODLIB
struct module_s mod; /* Module context */
+#endif
+
+#ifdef CONFIG_PIC
FAR void *picbase; /* Position-independent */
+#endif
#ifdef CONFIG_ARCH_ADDRENV
/* Address environment.