casaroli commented on code in PR #20492:
URL: https://github.com/apache/nuttx/pull/20492#discussion_r4303710760


##########
libs/libc/elf/elf_getsymbol.c:
##########
@@ -73,13 +78,12 @@ FAR const void *libelf_getsymbol(FAR void *handle, FAR 
const char *name)
 
   /* Verify that the module is in the registry */
 
-  libelf_registry_lock();
-  ret = libelf_registry_verify(modp);
+  ret = libelf_registry_verify(registry, modp);

Review Comment:
   Done



##########
libs/libc/elf/elf_symbols.c:
##########
@@ -470,7 +470,9 @@ int libelf_symvalue(FAR struct module_s *modp,
           exportinfo.modp   = modp;
           exportinfo.symbol = NULL;
 
-          ret = libelf_registry_foreach(libelf_symcallback,
+          ret = loadinfo->registry == NULL ? OK :

Review Comment:
   Done: libelf_registry_foreach() accepts a NULL registry.



##########
sched/group/group_leave.c:
##########
@@ -80,6 +81,30 @@ static inline void group_release(FAR struct task_group_s 
*group)
 
   nxrmutex_destroy(&group->tg_mutex);
 
+#if defined(CONFIG_LIBC_ELF) && defined(CONFIG_BUILD_FLAT)
+  /* Close what dlopen() left open.  No thread of the group runs now, so
+   * the lock is not needed.
+   */
+
+  libelf_removeall(&group->tg_info->ta_modules);
+
+#  ifdef CONFIG_BINFMT_LOADABLE
+  /* The rest is used by the program.  Give it back to the program before
+   * the list goes with the task information: binfmt_exit() unloads it.
+   */
+
+  if (group->tg_bininfo != NULL)
+    {
+      FAR struct list_node *node;
+
+      while ((node = list_remove_head(&group->tg_info->ta_modules)) != NULL)
+        {
+          list_add_tail(&group->tg_bininfo->libraries, node);

Review Comment:
   ta_modules is in the task information, which task_uninit_info() frees right 
after this. The program's own libraries are still on it and the program still 
uses them, so they go back to tg_bininfo->libraries, and binfmt_exit() unloads 
them together with the program.



-- 
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]

Reply via email to