[llvm] [LoongArch] Support R_LARCH_{ADD, SUB}_ULEB128 for .uleb128 and force relocs when sym is not in section (PR #76433)

Jinyang He via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 3 23:14:51 PST 2024


MQ-mengqing wrote:

> Ah, it's only explaining that zero-padding should be done on LoongArch. But I'm not sure if @MaskRay was asking for the reason behind the difference, i.e. the design considerations behind the decision.

I just followed psABI in this pr. My idea is that {ADD,SUB}_ULEB128 follows the other ADD and SUB relocation types. There is no order between ADD and SUB, while SET needs to be executed before SUB. However, in the object file, the initial value is more helpful for debug information to print, otherwise we need to relocate and fix them. For example the resolveLoongArch fixes ADD and SUB to display the debug information of object file normally. Both of them has its own advantages I think.


https://github.com/llvm/llvm-project/pull/76433


More information about the llvm-commits mailing list