<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sun, Nov 22, 2015 at 6:57 AM, Simon Atanasyan <span dir="ltr"><<a href="mailto:simon@atanasyan.com" target="_blank">simon@atanasyan.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Separated from the "[lld] R_MIPS_HI16 / R_MIPS_LO16 calculation" thread.<br>
<br>
On Sat, Nov 21, 2015 at 9:28 AM, Rui Ueyama <<a href="mailto:ruiu@google.com">ruiu@google.com</a>> wrote:<br>
> On Fri, Nov 20, 2015 at 10:13 PM, Simon Atanasyan <<a href="mailto:simon@atanasyan.com">simon@atanasyan.com</a>><br>
> wrote:<br>
>> R_MIPS_HI16 and R_MIPS_LO16 relocations perform a special calculation<br>
>> if a target symbol's name is `_gp_disp` [2]. AFAIK now in the target<br>
>> `relocateOne` method there is no chance to get the traget symbol name.<br>
>> Is it okay to pass the target symbol index and provide<br>
>> `MipsTargetInfo` access to the symbol table of the processing input<br>
>> file?<br>
><br>
><br>
> One way is to add a SymbolBody* field to Out<ELFT> struct, and let it have a<br>
> pointer to _gp_disp symbol. And do pointer comparison to check if a<br>
> relocation target is _gp_disp or not.<br>
<br>
Do you suggest to pass a pointer to SymbolBody to the `relocateOne`<br>
method and compare this pointer with something like<br>
`Out<ELFT>::MipsGpDispSym`?<br></blockquote><div><br></div><div>Ah, I didn't realize that relocateOne doesn't take a symbol.</div><div><br></div><div>I'm not sure what's the simplest way, but you might want to add a new parameter to relocateOne. </div></div><br></div></div>