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] PR gold/17640


On 12 Mar 16:37, H.J. Lu wrote:
> On Thu, Mar 12, 2015 at 3:08 PM, Cary Coutant <ccoutant@google.com> wrote:
> > + // If we convert this from
> > + // mov foo@GOT(%reg), %reg
> > + // to
> > + // lea foo@GOTOFF(%reg), %reg
> > + // in Relocate::relocate, then there is nothing to do here.
> > + // Avoid converting _DYNAMIC, because its address may be used.
> >
> > I'm sorry, but I still don't understand the rationale for treating
> > _DYNAMIC specially. If you convert all of the references to @GOTOFF,
> > what's the point of having the GOT entry? If the loader is going to
> > use it, how does it find it?

I was trying to mirror behavior of bfd linker.

> 
> It is related to
> 
> https://sourceware.org/bugzilla/show_bug.cgi?id=14538
> 
> With the old x86-64 elf_machine_dynamic, we generate
> 
>        addq    _DYNAMIC@GOTPCREL(%rip), %rdx
> 
> We need to keep _DYNAMIC GOT entry.
>

Than why does 32-bit bfd linker also avoids optimizing _DYNAMIC?


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