casaroli commented on code in PR #19940:
URL: https://github.com/apache/nuttx/pull/19940#discussion_r3916110979
##########
arch/arm/src/common/Toolchain.defs:
##########
@@ -633,6 +633,14 @@ CELFFLAGS = $(filter-out --fixed-r9,$(CFLAGS))
-fvisibility=hidden \
CXXELFFLAGS = $(filter-out --fixed-r9,$(CXXFLAGS)) -fvisibility=hidden \
-mlong-calls
+# -fno-use-cxa-atexit, because the default registers each static object's
+# destructor with __cxa_atexit(dtor, obj, &__dso_handle), and __dso_handle
+# comes from crtbegin, which a module does not link. Turning it off also
+# puts the destructors in .fini_array, which is where the loader looks for
+# them when the module is unloaded.
+
+CXXELFFLAGS += -fno-use-cxa-atexit
Review Comment:
I will split into another PR
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]