g2gps commented on PR #8762:
URL: https://github.com/apache/nuttx/pull/8762#issuecomment-1473228232

   In regards to the elf address locations. I still have two which I have 
stubbed out, like this:
   ```
   diff --git a/libs/libc/machine/risc-v/arch_elf.c 
b/libs/libc/machine/risc-v/arch_elf.c
   index 9efa483722..cc5c5579c3 100644
   --- a/libs/libc/machine/risc-v/arch_elf.c
   +++ b/libs/libc/machine/risc-v/arch_elf.c
   @@ -413,7 +413,7 @@ int up_relocateadd(const Elf_Rela *rel, const Elf_Sym 
*sym,
              offset = (long)sym->st_value + (long)rel->r_addend - (long)addr;
              uint32_t val = _get_val((uint16_t *)addr) & 0xfffff000;
    
   -          ASSERT(offset && val);
   +          // ASSERT(offset && val);
    
              /* NOTE: we assume that a compiler adds an immediate value */
    
   @@ -584,6 +584,10 @@ int up_relocateadd(const Elf_Rela *rel, const Elf_Sym 
*sym,
              *(uint16_t *)addr = (uint16_t)(sym->st_value + rel->r_addend);
            }
            break;
   +      case R_RISCV_GOT_HI20:
   +        {
   +        }
   +        break;
          default:
            berr("ERROR: Unsupported relocation: %ld\n",
                 ARCH_ELF_RELTYPE(rel->r_info));
   ```
   This currently 'works', at least I can load and run the applications I'm 
building. Although, it's not an ideal solution. Previously I've been using this 
[documentation](https://github.com/riscv-non-isa/riscv-elf-psabi-doc), but I'm 
unsure of the correct way to implement `R_RISCV_GOT_HI20`. Perhaps someone 
could provide some guidance?


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