You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ar...@apache.org on 2022/09/22 00:29:30 UTC

[incubator-nuttx] branch master updated (3c1c29f2c4 -> 4c44c6f709)

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

archer pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git


    from 3c1c29f2c4 arch: move non arm g_current_regs defintion to common place
     new a7bbd33f1b libc: Remove the reference of _stext/_etext from lib_cxx_initialize.c
     new 4c44c6f709 arch.h: Make _sinit/_einit as an offical interface

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 include/nuttx/arch.h                | 10 ++++++++++
 libs/libc/misc/lib_cxx_initialize.c | 31 +++----------------------------
 2 files changed, 13 insertions(+), 28 deletions(-)


[incubator-nuttx] 01/02: libc: Remove the reference of _stext/_etext from lib_cxx_initialize.c

Posted by ar...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit a7bbd33f1ba3222c5d088e6498707060da1df281
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Wed Sep 21 04:57:15 2022 +0800

    libc: Remove the reference of _stext/_etext from lib_cxx_initialize.c
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 libs/libc/misc/lib_cxx_initialize.c | 16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)

diff --git a/libs/libc/misc/lib_cxx_initialize.c b/libs/libc/misc/lib_cxx_initialize.c
index 898a4efc52..fc4016e214 100644
--- a/libs/libc/misc/lib_cxx_initialize.c
+++ b/libs/libc/misc/lib_cxx_initialize.c
@@ -50,13 +50,6 @@ typedef CODE void (*initializer_t)(void);
 extern initializer_t _sinit;
 extern initializer_t _einit;
 
-/* _stext and _etext are symbols exported by the linker script that mark the
- * beginning and the end of text.
- */
-
-extern uintptr_t _stext;
-extern uintptr_t _etext;
-
 #if defined(CONFIG_ARCH_SIM) && defined(CONFIG_HOST_MACOS)
 extern void macho_call_saved_init_funcs(void);
 #endif
@@ -93,8 +86,7 @@ void lib_cxx_initialize(void)
 #else
       initializer_t *initp;
 
-      sinfo("_sinit: %p _einit: %p _stext: %p _etext: %p\n",
-            &_sinit, &_einit, &_stext, &_etext);
+      sinfo("_sinit: %p _einit: %p\n", &_sinit, &_einit);
 
       /* Visit each entry in the initialization table */
 
@@ -103,13 +95,11 @@ void lib_cxx_initialize(void)
           initializer_t initializer = *initp;
           sinfo("initp: %p initializer: %p\n", initp, initializer);
 
-          /* Make sure that the address is non-NULL and lies in the text
-           * region defined by the linker script.  Some toolchains may put
+          /* Make sure that the address is non-NULL. Some toolchains may put
            * NULL values or counts in the initialization table.
            */
 
-          if ((FAR void *)initializer >= (FAR void *)&_stext &&
-              (FAR void *)initializer < (FAR void *)&_etext)
+          if (initializer)
             {
               sinfo("Calling %p\n", initializer);
               initializer();


[incubator-nuttx] 02/02: arch.h: Make _sinit/_einit as an offical interface

Posted by ar...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 4c44c6f70914471cffa4267c5c67755a37c70fd3
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Wed Sep 21 06:12:43 2022 +0800

    arch.h: Make _sinit/_einit as an offical interface
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 include/nuttx/arch.h                | 10 ++++++++++
 libs/libc/misc/lib_cxx_initialize.c | 15 ---------------
 2 files changed, 10 insertions(+), 15 deletions(-)

diff --git a/include/nuttx/arch.h b/include/nuttx/arch.h
index 467942e4ea..339b891383 100644
--- a/include/nuttx/arch.h
+++ b/include/nuttx/arch.h
@@ -96,6 +96,7 @@
 
 typedef CODE void (*sig_deliver_t)(FAR struct tcb_s *tcb);
 typedef CODE void (*phy_enable_t)(bool enable);
+typedef CODE void (*initializer_t)(void);
 
 /****************************************************************************
  * Public Data
@@ -149,6 +150,15 @@ EXTERN volatile bool g_rtc_enabled;
 
 #endif
 
+#ifdef CONFIG_HAVE_CXXINITIALIZE
+/* _sinit and _einit are symbols exported by the linker script that mark the
+ * beginning and the end of the C++ initialization section.
+ */
+
+extern initializer_t _sinit;
+extern initializer_t _einit;
+#endif
+
 /****************************************************************************
  * Public Function Prototypes
  ****************************************************************************/
diff --git a/libs/libc/misc/lib_cxx_initialize.c b/libs/libc/misc/lib_cxx_initialize.c
index fc4016e214..71f8af9ab2 100644
--- a/libs/libc/misc/lib_cxx_initialize.c
+++ b/libs/libc/misc/lib_cxx_initialize.c
@@ -31,25 +31,10 @@
 
 #include "libc.h"
 
-/****************************************************************************
- * Private Types
- ****************************************************************************/
-
-/* This type defines one entry in initialization array */
-
-typedef CODE void (*initializer_t)(void);
-
 /****************************************************************************
  * External References
  ****************************************************************************/
 
-/* _sinit and _einit are symbols exported by the linker script that mark the
- * beginning and the end of the C++ initialization section.
- */
-
-extern initializer_t _sinit;
-extern initializer_t _einit;
-
 #if defined(CONFIG_ARCH_SIM) && defined(CONFIG_HOST_MACOS)
 extern void macho_call_saved_init_funcs(void);
 #endif