[RFC] RISC-V: Check HI20 relocation bounds before instruction access

Dorian Vail snozns@outlook.com
Thu Nov 19 10:50:42 GMT 2026


Hello Binutils maintainers,

I would appreciate feedback on a proposed bounds check for HI20 instruction accesses in the RISC-V ELF backend. The proposal checks that the relocation's complete instruction fits in the section before relaxation or final relocation accesses the contents. The relaxation code should also validate its deletion window before computing the move length.

On the local 2.42 builds, assembler-generated HI20/LO12 inputs linked and ran successfully with both the stock and historical test builds. A master-based patch and regression run are still being prepared. Would you prefer to review the deletion-window check as a follow-up?

Bugzilla #33773 reports a RISC-V relaxation crash. Any guidance on its relationship to this check would be welcome.

Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://sourceware.org/pipermail/binutils/attachments/20261119/4550d360/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: N1-binutils-2.42-local-only.patch
Type: application/octet-stream
Size: 3252 bytes
Desc: N1-binutils-2.42-local-only.patch
URL: <https://sourceware.org/pipermail/binutils/attachments/20261119/4550d360/attachment-0001.obj>


More information about the Binutils mailing list