bug-binutils
[Top][All Lists]
Advanced

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

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


From: Christian Vogel
Subject: binutils 2.14: elf64-alpha.c, cannot link linux kernel 2.6.1
Date: Wed, 28 Jan 2004 14:15:06 +0100
User-agent: KMail/1.5.4

Hi,

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

You can get the kernel .config, the object files that show this behaviour and 
the script doit.so (which runs ld with the example files, and segfaults) on 
http://pi2.physik.uni-erlangen.de/~vogel/ld_bug/

If I add this ad-hoc patch appended to the mail, the link seems to succeed, 
but the kernel will not boot (which might be a completely different problem).

        Chris

diff -u -r1.1 elf64-alpha.c
--- elf64-alpha.c       2004/01/28 09:53:22     1.1
+++ elf64-alpha.c       2004/01/28 10:18:58
@@ -3645,8 +3645,20 @@
   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;
+/*
+       bfd_size_type *plge;
+         = & (alpha_elf_tdata (gotent->gotobj)->got->_raw_size);
+*/
+       struct alpha_elf_obj_tdata *td;
+       bfd_size_type *plge;
+
+       td=alpha_elf_tdata (gotent->gotobj);
+       if(!td->got){
+               fprintf(stderr,"GOT==NULL!!!\n");
+               continue;
+       }
+
+       plge=& td->got->_raw_size;

        gotent->got_offset = *plge;
        *plge += alpha_got_entry_size (gotent->reloc_type);






reply via email to

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