[lld] [lld][LoongArch] Relax R_LARCH_PCALA_HI20 and R_LARCH_PCALA_LO12 (PR #112696)
Jessica Clarke via llvm-commits
llvm-commits at lists.llvm.org
Sun Nov 17 22:10:14 PST 2024
================
@@ -737,6 +737,17 @@ uint64_t InputSectionBase::getRelocTargetVA(Ctx &ctx, const Relocation &r,
int64_t a = r.addend;
switch (r.expr) {
case R_ABS:
+ // pcalau12i,addi.[wd] => pcaddi
+ // With relaxation applied, the relocation type of the third
+ // reloc entry which corresponds to the addi.[wd] insn is converted
+ // from R_LARCH_PCALA_LO12 to R_LARCH_PCREL20_S2.
+ if (r.type == R_LARCH_PCREL20_S2) {
----------------
jrtc27 wrote:
Not just overhead, it's not checking e_machine so is true for any target that happens to have an absolute relocation with encoding 103. None exist in-tree, but this is still broken code.
https://github.com/llvm/llvm-project/pull/112696
More information about the llvm-commits
mailing list