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


##########
libs/libc/elf/elf_load.c:
##########
@@ -157,6 +154,19 @@ static void libelf_elfsize(FAR struct mod_loadinfo_s 
*loadinfo, bool alloc)
   size_t datasize = 0;
   int i;
 
+  /* sh_addralign 0 and 1 both mean no alignment (ELF specification).  Use
+   * 1 for 0, so that ALIGN_UP() can take the value here and when the
+   * sections are loaded.
+   */
+
+  for (i = 0; i < loadinfo->ehdr.e_shnum; i++)
+    {
+      if (loadinfo->shdr[i].sh_addralign == 0)
+        {
+          loadinfo->shdr[i].sh_addralign = 1;

Review Comment:
   Done.
   



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