This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 0/5] Add support for R_386_GOT32X/R_X86_64_[REX_]GOTPCRELX


On Mon, Jan 18, 2016 at 8:44 AM, Rafael EspÃndola
<rafael.espindola@gmail.com> wrote:
>>> Sorry if I missed this somewhere else, but could you explain why we
>>> need these new relocations? Is it just to move work from the linker to
>>> the assembler or there was some correctness issue optimizing a plain
>>> R_X86_64_GOTPCREL?
>>>
>>
>> They are used to convert memory operand of test and binop into
>> immediate operand, where binop is one of adc, add, and, cmp, or,
>> sbb, sub, xor instructions, when position-independent code is disabled.
>> The new relocation tells linker that it should try such optimization
>> since binop is one of mentioned above.
>
> But why not check the instruction in the linker? There is precedent,
> since the mov to lea transformation is done for R_X86_64_GOTPCREL.
>

Since for some binop, linker needs to rewrite the REX byte, it needs
to know if instruction has a REX byte.  R_X86_64_GOTPCREL doesn't
have such information


-- 
H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]