This is the mail archive of the binutils@sources.redhat.com 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: ld segfault while compiling Linux/alpha 2.6 with CVS trunk


On Wed, Sep 10, 2003 at 08:09:30PM +0100, James Troup wrote:
> Hi,
> 
> As reported in http://bugs.debian.org/204615/, ld segfaults while
> trying to link a Linux 2.6.0-test<n> kernel for Alpha.  I've
> reproduced this segfault with binutils CVS trunk (as of tonight
> (2003-09-10)).  Backtrace is below.  The files mentioned in the
> command line are available from:
> 
> http://people.debian.org/~troup/binutils/files.tar.gz
> 
> -- 
> James
> 
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> 
> Starting program: /home/troup/binutils/src/ld/ld-new -static -N  -T arch/alpha/kernel/vmlinux.lds.s arch/alpha/kernel/head.o   init/built-in.o --start-group  usr/built-in.o  arch/alpha/kernel/built-in.o  arch/alpha/mm/built-in.o  arch/alpha/math-emu/built-in.o  kernel/built-in.o  mm/built-in.o  fs/built-in.o  ipc/built-in.o  security/built-in.o  crypto/built-in.o  lib/lib.a  arch/alpha/lib/lib.a  lib/built-in.o  arch/alpha/lib/built-in.o  drivers/built-in.o  sound/built-in.o  net/built-in.o --end-group  -o .tmp_vmlinux1
> 
> Program received signal SIGSEGV, Segmentation fault.
> elf64_alpha_calc_got_offsets_for_symbol (h=0x120616258, arg=0x0) at elf64-alpha.c:3620
> 3620            *plge += alpha_got_entry_size (gotent->reloc_type);
> (gdb) bt
> #0  elf64_alpha_calc_got_offsets_for_symbol (h=0x120616258, arg=0x0) at elf64-alpha.c:3620


Some details:

The GOT entry is created with gotobj of net/built-in.o.  But the symbol
is defined in mm/built-in.o.  So when we walk the list of global
symbols in net/built-in.o in elf64_alpha_merge_gots, we don't find it.

We then merge net/built-in.o's .got into head.o's, but this gotent
still has gotobj pointing at net/build-in.o.

I can't see how this is supposed to work for any global symbol defined
and referenced in separate objects :(  Oh, probably it does if we merge
the objects which reference and define.

> #1  0x000000012002e660 in bfd_hash_traverse (table=0x12010d8e0, func=0x12003f5a0 <elf64_alpha_calc_got_offsets_for_symbol>, info=0x0) at hash.c:493
> #2  0x000000012002eef8 in bfd_link_hash_traverse (table=0x120616258, func=0, info=0x0) at linker.c:606
> #3  0x000000012003f670 in elf64_alpha_calc_got_offsets (info=0x120616258) at elf64-alpha.c:3640
> #4  0x000000012003f7e0 in elf64_alpha_size_got_sections (info=0x1200fd140) at elf64-alpha.c:3743
> #5  0x000000012003fb64 in elf64_alpha_always_size_sections (output_bfd=0x120616258, info=0x1200fd140) at elf64-alpha.c:3842
> #6  0x000000012004ac5c in bfd_elf64_size_dynamic_sections (output_bfd=0x12010b7d0, soname=0x0, rpath=0x0, filter_shlib=0x0, auxiliary_filters=0x0, 
>     info=0x1200fd140, sinterpptr=0x11ffff930, verdefs=0x0) at elflink.h:1988
> #7  0x0000000120020974 in gldelf64alpha_before_allocation () at eelf64alpha.c:779
> #8  0x000000012001b684 in ldemul_before_allocation () at ldemul.c:79
> #9  0x0000000120011f44 in lang_process () at ldlang.c:4081
> #10 0x0000000120015b14 in main (argc=28, argv=0x11ffffa58) at ldmain.c:465
> (gdb) 
> 
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> 
> Other info as suggested by the documentation:
> 
> $ uname -a 
> Linux escher 2.4.22 #2 Sat Sep 6 18:23:54 CEST 2003 alpha GNU/Linux
> $ cat /proc/cpuinfo 
> cpu                     : Alpha
> cpu model               : PCA56
> cpu variation           : 7
> cpu revision            : 0
> cpu serial number       : 
> system type             : EB164
> system variation        : SX164
> system revision         : 0
> system serial number    : 
> cycle frequency [Hz]    : 533333333 
> timer frequency [Hz]    : 1024.00
> page size [bytes]       : 8192
> phys. address bits      : 40
> max. addr. space #      : 127
> BogoMIPS                : 1057.24
> kernel unaligned acc    : 0 (pc=0,va=0)
> user unaligned acc      : 0 (pc=0,va=0)
> platform string         : Digital AlphaPC 164SX 533 MHz
> cpus detected           : 1
> $ gcc --version
> gcc (GCC) 3.3.2 20030908 (Debian prerelease)
> $ ~/binutils/src/ld/ld-new  --version
> GNU ld version 2.14.90 20030910
> 
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> 

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


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