[PATCH] [JITLink][RISCV] Use hashmap to find PCREL_HI20 edge (#78849)
authorJonas Hahnfeld <hahnjo@hahnjo.de>
Mon, 12 Feb 2024 18:45:52 +0000 (19:45 +0100)
committerSylvestre Ledru <sylvestre@debian.org>
Mon, 23 Sep 2024 11:23:31 +0000 (13:23 +0200)
commit9d17496375fd3484bd5368c24147cab2af6a5261
tree2286bb4ad922e800e9529ec0133f187d68265770
parent530bc22f00f3d116120e76f9026f409ec12a5524
[PATCH] [JITLink][RISCV] Use hashmap to find PCREL_HI20 edge (#78849)

As noted in issues #68594 and #73935, `JITLink/RISCV/ELF_ehframe.s`
fails with libstdc++'s expensive checks because `getRISCVPCRelHi20`
calls `std::equal_range` on the edges which may not be ordered by their
offset. Instead let `ELFJITLinker_riscv` build a hashmap of all edges
with type `R_RISCV_PCREL_HI20` that can be looked up in constant time.

Bugs: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1080435

Closes #73935

Gbp-Pq: Name rv64-fix-PCREL_HI20-issue.diff
llvm/lib/ExecutionEngine/JITLink/ELF_riscv.cpp