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 2020/03/06 17:30:02 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #447: ESP32 module support

xiaoxiang781216 commented on a change in pull request #447: ESP32 module support
URL: https://github.com/apache/incubator-nuttx/pull/447#discussion_r389037803
 
 

 ##########
 File path: libs/libc/machine/xtensa/arch_elf.c
 ##########
 @@ -154,6 +161,57 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
 int up_relocateadd(FAR const Elf32_Rela *rel, FAR const Elf32_Sym *sym,
                    uintptr_t addr)
 {
-  berr("ERROR: RELA relocation not supported\n");
-  return -ENOSYS;
+  unsigned int relotype;
+  unsigned char *p;
+  uint32_t value;
+
+  relotype = ELF32_R_TYPE(rel->r_info);
+  value = sym->st_value + rel->r_addend;
+
+  /* Handle the relocation by relocation type */
+
+  switch (relotype)
+    {
+    case R_XTENSA_32:
+      (*(uint32_t *)addr) += value;
 
 Review comment:
   FAR uint32_t *?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services