[PATCH] D117929: [XRay] Add support for RISCV

Dean Michael Berris via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Feb 13 23:01:16 PST 2022

dberris added a comment.

In D117929#3317813 <https://reviews.llvm.org/D117929#3317813>, @ashwin98 wrote:

> In D117929#3314355 <https://reviews.llvm.org/D117929#3314355>, @ashwin98 wrote:
>> On including RISCV64 to the check, I see new issues while reading the instrumentation map. How do I verify that the instrumentation map is being generated correctly (or if there is a problem with it), and where is the code that is responsible for the generation of the instrumentation map (is it in xray_init.cpp)? I'm not sure if this is a RISCV compatibility issue with the xray tool, or if I've missed something that is causing problems during the instrumentation map initialization.
> I traced the root cause of the issue.  It seems to be stemming from the instrumentation map's relocation handling, specifically, at line 129 of InstrumentationMap.cpp, when we try to extract the load address of the symbol. I believe that part of code was written keeping AArch64 in mind, but I'm not too sure about what changes will need to be made to add RISCV64 compatibility, I'm trying to figure it out.

If you can turn the relocations you're emitting in the assembly to be relative instead of absolute when building the instrumentation map like in other architectures, then the tooling will be able to resolve them. Maybe that helps?



More information about the cfe-commits mailing list