You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/09/28 01:43:21 UTC

[GitHub] [incubator-nuttx] nealef commented on a diff in pull request #7202: Add support for the loading of ET_DYN objects

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


##########
libs/libc/modlib/modlib_bind.c:
##########
@@ -518,6 +518,228 @@ static int modlib_relocateadd(FAR struct module_s *modp,
   return ret;
 }
 
+/****************************************************************************
+ * Name: modlib_relocatedyn
+ *
+ * Description:
+ *   Perform all relocations associated with a dynamic section.
+ *
+ * Returned Value:
+ *   0 (OK) is returned on success and a negated errno is returned on
+ *   failure.
+ *
+ ****************************************************************************/
+
+static int modlib_relocatedyn(FAR struct module_s *modp,
+                              FAR struct mod_loadinfo_s *loadinfo, int relidx)
+
+{
+  FAR Elf32_Shdr *shdr = &loadinfo->shdr[relidx];
+  FAR Elf32_Shdr *symhdr;
+  FAR Elf32_Dyn  *dyn = NULL;
+  FAR Elf32_Rel  *rels = NULL;
+  FAR Elf32_Rel  *rel;
+  FAR Elf32_Sym  *sym = NULL;
+  uintptr_t       addr;
+  int             ret;
+  int             i, iRel, iSym;
+  struct {
+	int	strOff;		/* Offset to string table */
+	int	symOff;		/* Offset to symbol table */
+	int	lSymTab;	/* Size of symbol table */
+	int	relEntSz;	/* Size of relocation entry */
+  	int	relOff[2];	/* Offset to the relocation section */
+	int	relSz[2];	/* Size of relocation table */
+#define I_REL	0
+#define I_PLT	1
+#define N_RELS	2
+  } relData;

Review Comment:
   Done. However, I kept the define inside the struct and added comments as it provides context for those PP values.



-- 
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-unsubscribe@nuttx.apache.org

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