ld segfault when using gcc 3.3.3

llewelly@xmission.com llewelly@xmission.com
Fri Mar 26 12:41:00 GMT 2004


droopycom <droopycom_gcc_help@yahoo.com> writes:
[snip]
> I recompiled binutils 2.14 and gcc 3.3.3 for arm-elf.
> Gcc works fine but the link fail with a segfault.
> I traced the segfault and it happens in malloc inside
> glibc. When i compile C only programs theres no
> problem.
[snip]
> Here is the gdb backtrace of the crash: 
> $ gdb arm-elf-ld
> 
> (gdb) run  -o main.elf main.o
> Starting program: /users/fg/galahad/usr/bin/arm-elf-ld
> -o main.elf main.o
>  
> Program received signal SIGSEGV, Segmentation fault.
> 0xb75177fd in _int_malloc () from /lib/tls/libc.so.6
> (gdb) bt
> #0  0xb75177fd in _int_malloc () from
> /lib/tls/libc.so.6
> #1  0xb7516b0d in malloc () from /lib/tls/libc.so.6
> #2  0x0809490c in _objalloc_alloc (o=0xb75db720,
> len=3076370008) at
> /users/fg/srcs/binutils-2.14/libiberty/objalloc.c:140
> #3  0x08061536 in bfd_alloc (abfd=0x1, size=3612) at
> /users/fg/srcs/binutils-2.14/bfd/opncls.c:676
> #4  0x08072677 in _bfd_elf32_link_read_relocs
> (abfd=0x80d4c68, o=0x80e10cc, external_relocs=0x0,
> internal_relocs=0x0, keep_memory=1) at elflink.h:2857
> #5  0x08070b59 in elf_link_add_object_symbols
> (abfd=0x80d4c68, info=0x80c3ca0) at elflink.h:2478
> #6  0x0804fc3d in load_symbols (entry=0x80c481c,
> place=0x0) at
> /users/fg/srcs/binutils-2.14/ld/ldlang.c:1646
> #7  0x08050522 in open_input_bfds (s=0x80c481c,
> force=0) at
> /users/fg/srcs/binutils-2.14/ld/ldlang.c:2050
> #8  0x08052c45 in lang_process () at
> /users/fg/srcs/binutils-2.14/ld/ldlang.c:4291
> #9  0x08055319 in main (argc=1, argv=0xbfffce74) at
> /users/fg/srcs/binutils-2.14/ld/ldmain.c:469
> (gdb)

Please report a bug to bug-binutils at gnu.org mailing list. See
    http://mail.gnu.org/mailman/listinfo/bug-binutils

It could be (as you say) that gcc is generating bad input for ld, but
    in that case ld should not crash, but should generate an error
    message. 



More information about the Gcc-help mailing list