HA: HA: [PATCH] D15480: [ELF][MIPS] Handle R_MIPS_HI16/LO16 relocations against _gp_disp symbol

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 25 08:47:07 PST 2015

>On Thu, Dec 24, 2015 at 4:03 PM, George Rimar <grimar at accesssoftek.com> wrote:
>>>In that case we even do not need to pass `A` because addend should be read from the relication location. But we have to pass `nullptr` instead of `Body` in many all cases of the `relicateOne` invocation. That is why I rejected this solution when implement the patch. But if it looks better than current variant, I am ready >>to change it.
>> We could to make Body defaulted to nullptr, since we already have defaulted PairedLoc that should not be a problem I think.
>Here is the patch to move R_MIPS_HI16/LO16 specific code from the the
>`InputSectionBase<ELFT>::relocate` into the
>`MipsTargetInfo<ELFT>::relocateOne` method. As to me I do not see any
>significant benefits because the `InputSectionBase<ELFT>::relocate`
>method still contains MIPS specific code for
>R_MIPS_GPREL16/R_MIPS_GPREL32 relocations. To move this code to the
>`MipsTargetInfo<ELFT>::relocateOne` method we have to add one more
>argument to the `relocateOne` routine. Not sure that adding more and
>more new arguments to the `relocateOne` is a good way. Any other
>Simon Atanasyan

Currently I work on a patch thats also needs Body argument for relocateOne. Probably will upload it in a hour if nothing happens.
So currently it seems for me that Body arg is anyways will be needed.
But even if my patch will not be accepted for me code with your patch looks better even having a cost of one argument.


More information about the llvm-commits mailing list