casaroli commented on code in PR #19938:
URL: https://github.com/apache/nuttx/pull/19938#discussion_r3841758981
##########
binfmt/elf.c:
##########
@@ -286,6 +290,28 @@ static int elf_loadbinary(FAR struct binary_s *binp,
}
#endif
+#ifdef CONFIG_BINFMT_CONSTRUCTORS
+ /* Run the constructors, as libelf_insert() does for dlopen(). A module
+ * with a PIC base is skipped: this task holds its own base, not the
+ * module's.
+ */
+
+ if (binp->picbase == NULL)
+ {
+ array = (FAR void (**)(void))loadinfo.preiarr;
Review Comment:
I think only ET_EXEC is fully linked with crt0. libelf_insert(), already
runs the arrays for the objects, only exec() does not
--
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]