[PATCH] D61973: [AArch64] Support .reloc *, R_AARCH64_NONE, *

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 16 06:41:07 PDT 2019


peter.smith added a comment.

I think the ld -r failure with arm is due to InputSection::copyRelocations(uint8_t *Buf, ArrayRef<RelTy> Rels)  in particular:

  if (RelTy::IsRela)
          P->r_addend = Sym.getVA(Addend) - Section->getOutputSection()->Addr;
        else if (Config->Relocatable)
          Sec->Relocations.push_back({R_ABS, Type, Rel.r_offset, Addend, &Sym});

If we add a R_ABS with Type R_ARM_NONE then relocateOne will try to evaluate it and hence we get the unrecognized reloc error. My intuition is to skip adding the R_ABS when the relocation is the None relocation. I'm not going to get a chance to send a patch to fix it today though.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D61973





More information about the llvm-commits mailing list