This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] PR gold/17640
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Cary Coutant <ccoutant at google dot com>
- Cc: Ilya Tocar <tocarip dot intel at gmail dot com>, Binutils <binutils at sourceware dot org>
- Date: Fri, 13 Mar 2015 12:22:37 -0700
- Subject: Re: [PATCH] PR gold/17640
- Authentication-results: sourceware.org; auth=none
- References: <CAMe9rOq-uSd64h6eeogR3SywtQipMupN9Ng9-EvPLF+3bp7Exw at mail dot gmail dot com> <20150305104052 dot GA16361 at msticlxl7 dot ims dot intel dot com> <CAMe9rOqRQ+HMS12+hn9Nz0pnb95tUDmbAU2QjK9G1Rc-q=woCA at mail dot gmail dot com> <20150310112745 dot GA104717 at msticlxl7 dot ims dot intel dot com> <CAMe9rOoG6NOVLYxZBJ5KRuS9_47=ptsd=Ft9iA9HfN2Asw0UeQ at mail dot gmail dot com> <20150312143236 dot GA95320 at msticlxl7 dot ims dot intel dot com> <CAMe9rOpn0uGDm1qbwgL-7CiYKjQeSHMHX6WzsnZ6eyfcp2MBAw at mail dot gmail dot com> <20150312145732 dot GB95320 at msticlxl7 dot ims dot intel dot com> <CAHACq4qF26jr8QYR_V55oVewLyHpgD2g7TrxDmgye0_S4pdroQ at mail dot gmail dot com> <CAMe9rOrMMxkR4bnoomCdW2P6TQtExMyMeC1oBHXNE3vXEEawLw at mail dot gmail dot com> <20150313112631 dot GA72598 at msticlxl7 dot ims dot intel dot com> <CAMe9rOqs=QROJZexdXKebsKrLrNat4mg=vgzuUrUpH1skpdTTQ at mail dot gmail dot com> <CAHACq4q761ontKOo3cr46hbo5dgi7A892GMB8rBBYuYwgY8ZKA at mail dot gmail dot com> <CAMe9rOq+MfTXB5k+8jgAxX+TMs=A-n4Fbu7hBG21kX9Wg7=7uA at mail dot gmail dot com> <CAHACq4p_351zLvX5dXjjxEjizTppm6sEgsCBCSiWdhntqpRx1w at mail dot gmail dot com> <CAMe9rOraxhCaDFTdEX5zEhQzKSgAf1-DYcWigpep1jiFnMsVPg at mail dot gmail dot com> <CAHACq4pbA9_PDD6qOL4VOFD2+-c0RNdH=h_27U51a4rWXGiJDg at mail dot gmail dot com>
On Fri, Mar 13, 2015 at 12:11 PM, Cary Coutant <ccoutant@google.com> wrote:
>> LEA gives you the value after the program has bee loaded
>> to memory at run-time. But in ld.so before it has bootstrapped itself
>>
>> movl _DYNAMIC@GOT(%ecx), %eax
>>
>> gives you the link-time address, which what ld.so wants to bootstrap
>> itself.
>
> So are you saying that, when linking ld.so, 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.
--
H.J.