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: linker seg fault


Thanks guys, managed to get gdb on it. Have got the following stack trace + gdb output:

Program received signal SIGSEGV, Segmentation fault.
0x0809d8c0 in elf_gc_propagate_vtable_entries_used (h=0x8283058,
okp=0x8283820)
    at /home/leok/src/binutils-2.16.1/bfd/elflink.c:8923
8923          h->vtable->used = h->vtable->parent->vtable->used;
(gdb) bt
#0  0x0809d8c0 in elf_gc_propagate_vtable_entries_used (h=0x8283058,
okp=0x8283820)
    at /home/leok/src/binutils-2.16.1/bfd/elflink.c:8923
#1  0x08074eba in bfd_hash_traverse (table=0x8118338,
    func=0x809d860 <elf_gc_propagate_vtable_entries_used>,
info=0xbffff2c8)
    at /home/leok/src/binutils-2.16.1/bfd/hash.c:498
#2  0x0809db83 in bfd_elf_gc_sections (abfd=0x81162b0, info=0x8109d60)
    at /home/leok/src/binutils-2.16.1/bfd/elflink.c:9046
#3  0x0805725d in lang_gc_sections ()
    at /home/leok/src/binutils-2.16.1/ld/ldlang.c:4721
#4  0x0805730a in lang_process () at
/home/leok/src/binutils-2.16.1/ld/ldlang.c:4769
#5  0x0805aae3 in main (argc=32, argv=0xbffff424)
    at /home/leok/src/binutils-2.16.1/ld/ldmain.c:458


(gdb) p *h $2 = {root = {root = {next = 0x0, string = 0x8281fd1 "_ZTV15fatal_exception", hash = 99830972}, type = bfd_link_hash_defweak, u = {undef = {next = 0x0, abfd = 0x827c9a4, weak = 0x0}, def = {next = 0x0, section = 0x827c9a4, value = 0}, i = {next = 0x0, link = 0x827c9a4, warning = 0x0}, c = { next = 0x0, p = 0x827c9a4, size = 0}}}, indx = -1, dynindx = -1, got = { refcount = 0, offset = 0, glist = 0x0, plist = 0x0}, plt = {refcount = 8, offset = 8, glist = 0x8, plist = 0x8}, size = 20, type = 1, other = 0, ref_regular = 0, def_regular = 1, ref_dynamic = 0, def_dynamic = 0, ref_regular_nonweak = 0, dynamic_adjusted = 0, needs_copy = 0, needs_plt = 0, non_elf = 0, hidden = 0, forced_local = 0, mark = 0, non_got_ref = 1, dynamic_def = 0, dynamic_weak = 0, pointer_equality_needed = 0, dynstr_index = 0, u = {weakdef = 0x0, elf_hash_value = 0}, verinfo = {verdef = 0x0, vertree = 0x0}, vtable = 0x828b634} (gdb) p *h->vtable->parent $4 = {root = {root = {next = 0x0, string = 0x828247b "_ZTVSt11logic_error", hash = 347382632}, type = bfd_link_hash_defweak, u = {undef = {next = 0x0, abfd = 0x90723b0, weak = 0x0}, def = {next = 0x0, section = 0x90723b0, value = 0}, i = {next = 0x0, link = 0x90723b0, warning = 0x0}, c = { next = 0x0, p = 0x90723b0, size = 0}}}, indx = -1, dynindx = -1, got = { refcount = 0, offset = 0, glist = 0x0, plist = 0x0}, plt = {refcount = 3, offset = 3, glist = 0x3, plist = 0x3}, size = 20, type = 1, other = 0, ref_regular = 1, def_regular = 1, ref_dynamic = 0, def_dynamic = 0, ref_regular_nonweak = 0, dynamic_adjusted = 0, needs_copy = 0, needs_plt = 0, non_elf = 0, hidden = 0, forced_local = 0, mark = 0, non_got_ref = 1, dynamic_def = 0, dynamic_weak = 0, pointer_equality_needed = 0, dynstr_index = 0, u = {weakdef = 0x0, elf_hash_value = 0}, verinfo = {verdef = 0x0, vertree = 0x0}, vtable = 0x0} (gdb)

Think I understand my error now but does appear to be a bug in ld causing it to seg fault. My guess is that I am managing to link my code with rtti on and am linking to libstdc++ without it. Class that goes wrong has virtual funcs and derives from std::logic_exception.

Does this sound correct?

Any help much appreciated.

Will Wagner




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