This is the mail archive of the 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] PR gold/17640

On Fri, Mar 13, 2015 at 12:11 PM, Cary Coutant <> wrote:
>> LEA gives you the value after the program has bee loaded
>> to memory at run-time.  But in before it has bootstrapped itself
>> movl _DYNAMIC@GOT(%ecx), %eax
>> gives you the link-time address, which what wants to bootstrap
>> itself.
> So are you saying that, when linking, you don't want to convert
> that particular mov to an lea? If that's what you're saying, then this
> patch isn't going to accomplish that. Remember back when I asked why
> you were special-casing the name in Scan::global, but not in
> Relocate::relocate? You said that you wanted to keep the GOT entry,
> but didn't need to check when doing the conversion. As it stands,
> you'll generate the GOT entry in Scan::global, but you'll still
> convert the mov to an lea in Relocate::relocate, so the converted code
> won't actually use the GOT entry, and you'll get the run-time address.

It should be fixed.  Ilya, please properly check  i386_mov_to_lea3.s test.
I got

0000013c <bar>:
 13c: 8d 81 7c ff ff ff     lea    -0x84(%ecx),%eax

with gold.


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