This is an archive of the discontinued LLVM Phabricator instance.

[RelocationResolver] Add R_RISCV_SET8
ClosedPublic

Authored by liaolucy on Sep 19 2022, 12:15 AM.

Diff Detail

Event Timeline

liaolucy created this revision.Sep 19 2022, 12:15 AM
liaolucy requested review of this revision.Sep 19 2022, 12:15 AM
tschuett added inline comments.
llvm/lib/Object/RelocationResolver.cpp
468

Is the 0x00 a typo or for symmetry?

liaolucy updated this revision to Diff 461202.Sep 19 2022, 7:29 AM
liaolucy marked an inline comment as done.

update

Is there a test using this relocation type? We don't add unneeded ones.

llvm/lib/Object/RelocationResolver.cpp
468

& 0xff is needed

liaolucy updated this revision to Diff 461780.Sep 20 2022, 8:17 PM

reserve 0xff.

Is there a test using this relocation type? We don't add unneeded ones.

Sorry, I can't find a .ll file to emit R_RISCV_SET8. Any suggestions?

https://github.com/llvm/llvm-project/blob/main/llvm/test/DebugInfo/RISCV/relax-debug-frame.ll emits R_RISCV_SET6, If R_RISCV_SET6 is not included in RelocationResolver.cpp, llvm-dwarfdump has the following error. I guess R_RISCV_SET8 may have a similar error.

warning: failed to compute relocation: R_RISCV_SET6, Invalid data was encountered while parsing the file

In addition, this question comes from Julia(like: https://github.com/JuliaLang/julia/issues/35460) @alexfanqi is helping to find testcases.

llvm/lib/Object/RelocationResolver.cpp
468

Thanks, updated

liaolucy planned changes to this revision.Sep 21 2022, 6:56 AM
liaolucy updated this revision to Diff 461892.Sep 21 2022, 7:32 AM

add testcase

MaskRay accepted this revision.Sep 21 2022, 1:09 PM
MaskRay added inline comments.
llvm/test/MC/RISCV/cfi-advance.s
7

ditto nearby

8

The negative pattern is not needed. The no-error state is implied by llvm-dwarfdump rather than not llvm-dwarfdump

You may change llvm-dwarfdump --debug-info --debug-line to test some properties to best leverage the test (https://maskray.me/blog/2021-08-08-toolchain-testing "A regression test which simply runs the compiler and expects it not to crash has low utilization. It is often better to additionally test some properties of the produced object file.")

This revision is now accepted and ready to land.Sep 21 2022, 1:09 PM
liaolucy updated this revision to Diff 462069.Sep 21 2022, 7:30 PM

address comments.

This revision was landed with ongoing or failed builds.Sep 21 2022, 8:49 PM
This revision was automatically updated to reflect the committed changes.