Pavel Pisa commented: 
https://gitlab.rtems.org/rtems/rtos/rtems/-/issues/5144#note_114931


My test code with my libdl-riscv.diff builds completely but I have stuck on 
some sane setup of BeagleV-Fire for testing. May it be, I try QEMU the first. 
As for the code, there are warnings and I do not like how  `Elf_Word *where;` 
is assigned `where = (Elf_Addr *)(sect->base + rela->r_offset);` and used in 
the function `rtems_rtl_elf_reloc_rela()`. It would wort to check all 
relocation cases what should be the length of modified address in the binary 
image. I expect that it should be sometimes 32-bit Elf_Word for 32-bit targets 
but 64-bit for 64-bit targets. It should be of native endianning for constants 
acessed by LW but it should be little-endian when code is modified, because 
even big-endian RISC-V reads code in little-endian to allow variable length 
instructions. There rules seems to be mostly followed by the 
`rtl-mdreloc-riscv.c` code but I am not 100% confident and warnings make me 
even more unsure. So it should be check against spec.

-- 
View it on GitLab: 
https://gitlab.rtems.org/rtems/rtos/rtems/-/issues/5144#note_114931
You're receiving this email because of your account on gitlab.rtems.org.


_______________________________________________
bugs mailing list
[email protected]
http://lists.rtems.org/mailman/listinfo/bugs

Reply via email to