Bug 558576 - More relocation type for RISC-V need to support
Summary: More relocation type for RISC-V need to support
Status: RESOLVED FIXED
Alias: None
Product: TCF
Classification: Tools
Component: Agent (show other bugs)
Version: unspecified   Edit
Hardware: PC All
: P3 major (vote)
Target Milestone: 1.7   Edit
Assignee: Project Inbox CLA
QA Contact: Eugene Tarassov CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-12-22 20:38 EST by wenyan xin CLA
Modified: 2021-06-25 16:23 EDT (History)
0 users

See Also:


Attachments
the binary file generated by ccriscv. (12.09 KB, application/octet-stream)
2019-12-22 20:38 EST, wenyan xin CLA
no flags Details
a c language sample (49 bytes, application/octet-stream)
2019-12-22 20:40 EST, wenyan xin CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description wenyan xin CLA 2019-12-22 20:38:52 EST
Created attachment 281308 [details]
the binary file generated by ccriscv.

The attached file dkm.c is a c language sample for RISC-V.

And the other attached file r64_dkm.out is generated from ccriscv (the c language compile in gnu-8.3.0.1 for riscv).

When we loaded to run the r64_dkm.out file, TCF raised a exception about "Unsupported relocation type".

We checked and found the exception is generated from at line 56 in dwarfreloc-mdep.h file. It seems both R_RISCV_ADD64 and R_RISCV_SUB64  types does not support by TCF now.

--------------------------------------
readelfriscv -r r64_dkm.out

Relocation section '.rela.debug_info' at offset 0x1ec0 contains 60 entries:
  Offset          Info           Type           Sym. Value    Sym. Name + Addend
000000000019  001b00000002 R_RISCV_64        0000000000000000 .Ltext0 + 0
000000000021  001c00000024 R_RISCV_ADD64     0000000000000084 .Letext0 + 0
000000000021  001b00000028 R_RISCV_SUB64     0000000000000000 .Ltext0 + 0
000000000029  001d00000001 R_RISCV_32        0000000000000000 .Ldebug_line0 + 0
00000000002e  001e00000001 R_RISCV_32        000000000000006e .LASF12 + 0
Comment 1 wenyan xin CLA 2019-12-22 20:40:05 EST
Created attachment 281309 [details]
a c language sample
Comment 2 Eugene Tarassov CLA 2019-12-23 22:54:03 EST
Fixed.
Thanks!