This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: elf64-x86-64.c compile problem
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Jerker Bäck <jerker dot back at gmail dot com>
- Cc: binutils at sourceware dot org
- Date: Tue, 1 Sep 2009 14:28:20 -0700
- Subject: Re: elf64-x86-64.c compile problem
- References: <4a9d856a.0702d00a.3814.049b@mx.google.com>
On Tue, Sep 1, 2009 at 1:34 PM, Jerker Bäck<jerker.back@gmail.com> wrote:
> My compiler have problems with this
>
> bfd\elf64-x86-64.c(3893)
> --------------------------------------------------------------------
> ?{
> ? ?if (!h->pointer_equality_needed)
> ? ? ?abort();
>
> ? ?/* For non-shared object, we can't use .got.plt, which
> ? ? ? contains the real function addres if we need pointer
> ? ? ? equality. ?We load the GOT entry with the PLT entry. ?*/
> ? ? asection *plt = htab->elf.splt ? htab->elf.splt : htab->elf.iplt;
> ? ? bfd_put_64 (output_bfd, (plt->output_section->vma
> ? ? ? ?+ plt->output_offset
> ? ? ? ?+ h->plt.offset),
> ? ? htab->elf.sgot->contents + h->got.offset);
> ? ? ? ?return TRUE;
> ?}
> --------------------------------------------------------------------
>
> asection *plt should have been declared earlier, right?
>
I checked in this patch.
Thanks.
--
H.J.
---
Index: elf64-x86-64.c
===================================================================
--- elf64-x86-64.c (revision 6668)
+++ elf64-x86-64.c (working copy)
@@ -3883,13 +3883,15 @@ elf64_x86_64_finish_dynamic_symbol (bfd
}
else
{
+ asection *plt;
+
if (!h->pointer_equality_needed)
abort ();
/* For non-shared object, we can't use .got.plt, which
contains the real function addres if we need pointer
equality. We load the GOT entry with the PLT entry. */
- asection *plt = htab->elf.splt ? htab->elf.splt : htab->elf.iplt;
+ plt = htab->elf.splt ? htab->elf.splt : htab->elf.iplt;
bfd_put_64 (output_bfd, (plt->output_section->vma
+ plt->output_offset
+ h->plt.offset),