[llvm] [LoongArch] Add relax feature and keep relocations (PR #72191)

Jinyang He via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 15 01:02:47 PST 2023


MQ-mengqing wrote:

> This is what happened to RISC-V's assembler support, and I finally fixed them after https://reviews.llvm.org/D153097 https://reviews.llvm.org/D155357 . At the very least, this patch needs more tests, like the tests I improved when improving the two tests.

Thank you for the linker relaxation works on RISCV. This allows me to have a reference when I port it  on LoongArch. I noticed these fixes. I think commit [1] relies on both of them. When I supported DwarfLine and DwarfCFA, I found that DwarfCFA did not generate ADD/SUB relocations. Luckily you fixed it for RISCV before.
The current commit is simply to provide relax feature because it will be required for subsequent patches. So it does simple test to see
  a), the symbol is converted to the symbol name instead of section plus offset,
  b), the relocations B16, B21, and B26 are preserved.
Would it be more appropriate to add more tests in later patches?
The smaller connection between patches allows me to submit multiple single-function patches at the same time. If this current commit is merged, I might be able to create PR separately for [1][2][3].

[1] https://github.com/MQ-mengqing/llvm-project/commit/bdcea9b9fe499d9c45e5b8d136b910a6b36aa568
[2] https://github.com/MQ-mengqing/llvm-project/commit/f949e5a3ee6357f35c3a8ea145305f73759f4b74
[3] https://github.com/MQ-mengqing/llvm-project/commit/f6874438ecb8de7c2717518dd2aa7a04f9a1e296


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


More information about the llvm-commits mailing list