[PATCH] PR gold/17640
H.J. Lu
hjl.tools@gmail.com
Fri Mar 13 17:23:00 GMT 2015
On Fri, Mar 13, 2015 at 9:44 AM, Cary Coutant <ccoutant@google.com> wrote:
>> addq _DYNAMIC@GOTPCREL(%rip), %rax
>> ...
>> addl _DYNAMIC@GOT(%ecx), %eax
>> ...
>> Both requires preserve _DYNAMIC GOT entry.
>
> Well, yes, these aren't mov instructions, and we won't optimize them
> because of that. That's the point of this test:
>
> + if (view[reloc.get_r_offset() - 2] == 0x8b)
> + break;
>
> You still haven't explained why we need to look for the symbol
> "_DYNAMIC" and treat it as a special case.
>
This isn't the optimal code. Compiler may generate
movl %eax, %edx
movl _DYNAMIC@GOT(%ecx), %eax
addl %edx, %eax
instead of
addl _DYNAMIC@GOT(%ecx), %eax
I just want to be on the safe side.
--
H.J.
More information about the Binutils
mailing list