nuttx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-nuttx] yamt commented on a change in pull request #447: ESP32 module support
Date Mon, 09 Mar 2020 05:37:59 GMT
yamt commented on a change in pull request #447: ESP32 module support
URL: https://github.com/apache/incubator-nuttx/pull/447#discussion_r389470548
 
 

 ##########
 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:
   i will fix when i push next time

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

Mime
View raw message