bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: binutils 2.14: elf64-alpha.c, cannot link linux kernel 2.6.1


From: Nick Clifton
Subject: Re: binutils 2.14: elf64-alpha.c, cannot link linux kernel 2.6.1
Date: Mon, 09 Feb 2004 10:30:18 +0000
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.2 (gnu/linux)

Hi Christian,

> when I try to link linux-2.6.1 on alpha64, ld segfaults. I have traced it to
> bfd/elf64-alpha.c, elf64_alpha_calc_got_offsets_for_symbol, there is the case 
> that alpha_elf_tdata (gotent->gotobj)->got == NULL. This is binutils 2.14.
>
> The object files were compiled by a gcc-3.3, which uses as and ld from these 
> binutils (2.14).

Thanks very much for pointing this problem out for us.  If you can
produce a *small* reproducible test case for us we can investigate
further.  (I am sorry, but I do not have the resources available to
attempt to compile a 2.6 kernel for a 64bit alpha).

In the meantime I am going to apply this variant of your patch which
should stop the linker from seg-faulting when it encounters the
problem.

Cheers
        Nick

bfd/ChangeLog
2004-02-09  Christian Vogel <address@hidden>
            Nick Clifton  <address@hidden>

        * elf64-alpha.c (elf64_alpha_calc_got_offsets_for_symbol): Catch
        GOT entries with no associated GOT subsection.

Index: bfd/elf64-alpha.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-alpha.c,v
retrieving revision 1.112
diff -c -3 -p -r1.112 elf64-alpha.c
*** bfd/elf64-alpha.c   4 Dec 2003 03:03:27 -0000       1.112
--- bfd/elf64-alpha.c   9 Feb 2004 10:26:58 -0000
*************** elf64_alpha_calc_got_offsets_for_symbol 
*** 3547,3552 ****
--- 3547,3553 ----
       struct alpha_elf_link_hash_entry *h;
       PTR arg ATTRIBUTE_UNUSED;
  {
+   bfd_boolean result = TRUE;
    struct alpha_elf_got_entry *gotent;
  
    if (h->root.root.type == bfd_link_hash_warning)
*************** elf64_alpha_calc_got_offsets_for_symbol 
*** 3555,3568 ****
    for (gotent = h->got_entries; gotent; gotent = gotent->next)
      if (gotent->use_count > 0)
        {
!       bfd_size_type *plge
!         = &alpha_elf_tdata (gotent->gotobj)->got->_raw_size;
  
        gotent->got_offset = *plge;
        *plge += alpha_got_entry_size (gotent->reloc_type);
        }
  
!   return TRUE;
  }
  
  static void
--- 3556,3578 ----
    for (gotent = h->got_entries; gotent; gotent = gotent->next)
      if (gotent->use_count > 0)
        {
!       struct alpha_elf_obj_tdata *td;
!       bfd_size_type *plge;
  
+       td = alpha_elf_tdata (gotent->gotobj);
+       if (td == NULL)
+         {
+           _bfd_error_handler (_("Symbol %s has no GOT subsection for offset 
0x%x"),
+                               h->root.root.root.string, gotent->got_offset);
+           result = FALSE;
+           continue;
+         }
+       plge = &td->got->_raw_size;
        gotent->got_offset = *plge;
        *plge += alpha_got_entry_size (gotent->reloc_type);
        }
  
!   return result;
  }
  
  static void
                





reply via email to

[Prev in Thread] Current Thread [Next in Thread]