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: elf64-x86-64.c compile problem


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),


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