[PATCH] D26029: [LLD][ARM] ARM IRELATIVE relocations are in rel.dyn

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 31 13:43:03 PDT 2016


On 31 October 2016 at 14:14, Peter Smith <peter.smith at linaro.org> wrote:
> peter.smith added a comment.
>
> On reflection I think that it could be possible to clean this up if the rel.dyn and rel.plt OutputSections are rewritten in terms of InputSections. The linker in Relocation.cpp would create the R_<TARGET>_IRELATIVE relocations in an InputSection called .rel.iplt or .rela.iplt. On targets such as AArch64 and X86 rela.iplt would be allocated to the .rela.plt OutputSection, on ARM and PPC (if the PPC lld Target supported it) would go into the .rel.dyn OutputSection.

I like this. It also solves the problem of putting the IRELATIVE
relocations after the other ones.

As for why other targets try to use .rela.plt, it is probably because
.rela.plt is processed lazily and .rela.dyn is not. Do you know if
there  is some ARM/PPC restriction that would force IRELATIVE to be
processed eagerly?

Cheers,
Rafael


More information about the llvm-commits mailing list