[PATCH] D100835: [WIP][LLD][RISCV] Linker Relaxation

Chih-Mao Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 26 19:58:28 PDT 2021


PkmX added a comment.

In D100835#2707537 <https://reviews.llvm.org/D100835#2707537>, @MaskRay wrote:

> In D100835#2701062 <https://reviews.llvm.org/D100835#2701062>, @jrtc27 wrote:
>
>> Why write your own deleteRanges? I took great care in writing mine to ensure there were no hidden quadratic complexities, but your simpler version has introduced them. Just take mine, unless there is a problem with it nobody's mentioned. Same goes for mutableData being a less efficient version of mine.
>>
>> I also don't like making this overly target-specific. We should take the time to get the interface right, not just punt on it and shove it all into target-specific code.
>
> +1 for a low time complexity implementation. The quadratic time complexity of the binutils approach may run into scalability problems.
>
> I haven't closely looked into this yet, but it seems that `R_RISCV_GPREL_*` support can be contributed separately.

Do you mean the whole gp-relaxation support? As only implementing relocations for `R_RISCV_GPREL` seems pointless as they are only generated and consumed by the linker.



================
Comment at: lld/ELF/Relocations.cpp:144
 template <RelExpr... Exprs> bool oneof(RelExpr expr) {
-  assert(0 <= expr && (int)expr < 64 &&
-         "RelExpr is too large for 64-bit mask!");
-  return (uint64_t(1) << expr) & RelExprMaskBuilder<Exprs...>::build();
+  assert(0 <= expr && (int)expr < 128 &&
+         "RelExpr is too large for 128-bit mask!");
----------------
arichardson wrote:
> This change should be a separate review. I would very much like support for > 64 RelExpr values to land upstream since we also had to make that change that for our CHERI LLD.
That's okay for me. I will split this out into a new patch.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D100835/new/

https://reviews.llvm.org/D100835



More information about the llvm-commits mailing list