nealef commented on code in PR #7202:
URL: https://github.com/apache/incubator-nuttx/pull/7202#discussion_r981864164


##########
libs/libc/modlib/modlib_bind.c:
##########
@@ -577,24 +799,38 @@ int modlib_bind(FAR struct module_s *modp,
           continue;
         }
 
-      /* Make sure that the section is allocated.  We can't relocate
-       * sections that were not loaded into memory.
-       */
-
-      if ((loadinfo->shdr[infosec].sh_flags & SHF_ALLOC) == 0)
+      if (loadinfo->ehdr.e_type == ET_DYN) 
         {
-          continue;
-        }
+          switch (loadinfo->shdr[i].sh_type) 
+            {
+              case SHT_DYNAMIC :
+                  ret = modlib_relocatedyn(modp, loadinfo, i);
+                  break;
+              case SHT_DYNSYM :
+                  loadinfo->dsymtabidx = i;
+                  break;
+            }
+        } 
+      else
+        {
+          /* Make sure that the section is allocated.  We can't relocate
+           * sections that were not loaded into memory.
+           */
 
-      /* Process the relocations by type */
+          if ((loadinfo->shdr[i].sh_flags & SHF_ALLOC) == 0)
+                continue;

Review Comment:
   Fixed



-- 
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: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to