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

Simon Atanasyan via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 25 08:02:00 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mips-hilo.patch
Type: application/octet-stream
Size: 7878 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151225/e05e90a5/attachment.obj>

More information about the llvm-commits mailing list