From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2934 invoked by alias); 16 Feb 2008 16:20:08 -0000 Received: (qmail 2917 invoked by uid 22791); 16 Feb 2008 16:20:07 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate2.de.ibm.com (HELO mtagate2.de.ibm.com) (195.212.29.151) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 16 Feb 2008 16:19:45 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate2.de.ibm.com (8.13.8/8.13.8) with ESMTP id m1GGJfNa167918; Sat, 16 Feb 2008 16:19:41 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v8.7) with ESMTP id m1GGJf191544326; Sat, 16 Feb 2008 17:19:41 +0100 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m1GGJfbn003728; Sat, 16 Feb 2008 16:19:41 GMT Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with SMTP id m1GGJftU003725; Sat, 16 Feb 2008 16:19:41 GMT Message-Id: <200802161619.m1GGJftU003725@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Sat, 16 Feb 2008 17:19:41 +0100 Subject: Re: PR5692 To: amodra@bigpond.net.au (Alan Modra) Date: Sat, 16 Feb 2008 16:20:00 -0000 From: "Ulrich Weigand" Cc: binutils@sourceware.org, gdb-patches@sourceware.org In-Reply-To: <20080215034748.GA1840@bubble.grove.modra.org> from "Alan Modra" at Feb 15, 2008 02:17:48 PM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-02/txt/msg00273.txt.bz2 Alan Modra wrote: > * elflink.c: Replace all accesses to hash->creator field with > output_bfd->xvec. > * cofflink.c: Likewise. > * coff-h8300.c: Likewise. > * ecoff.c: Likewise. > * elf32-m68hc1x.c: Likewise. > * elf32-ppc.c: Likewise. > * elf64-alpha.c: Likewise. > * elf64-ppc.c: Likewise. > * elf64-sparc.c: Likewise. > * elfxx-mips.c: Likewise. > * i386linux.c: Likewise. > * m68klinux.c: Likewise. > * sparclinux.c: Likewise. > * sunos.c: Likewise. > * xcofflink.c: Likewise. > * linker.c: Likewise. This change causes GDB to crash in generic_link_add_symbol_list when called from bfd_simple_get_relocated_section_contents because of a NULL output_bfd field: #0 0x0000000000616dd8 in generic_link_add_symbol_list (abfd=0x9e8d20, info=0x7fffd952d4d0, symbol_count=, symbols=, collect=0) at /home/uweigand/fsf/gdb-head/bfd/linker.c:1361 #1 0x00000000005ac583 in bfd_simple_get_relocated_section_contents (abfd=0x9e8d20, sec=, outbuf=0x9fedb0 "", symbol_table=0x0) at /home/uweigand/fsf/gdb-head/bfd/simple.c:239 #2 0x0000000000509c22 in dwarf2_read_section (objfile=, sectp=0x9eb508) at /home/uweigand/fsf/gdb-head/gdb/dwarf2read.c:5250 This appears to fix the crash: diff -c -p -r1.29 simple.c *** simple.c 10 Jul 2007 13:49:04 -0000 1.29 --- simple.c 16 Feb 2008 16:17:50 -0000 *************** bfd_simple_get_relocated_section_content *** 188,193 **** --- 188,194 ---- memset (&link_info, 0, sizeof (link_info)); link_info.input_bfds = abfd; link_info.input_bfds_tail = &abfd->link_next; + link_info.output_bfd = abfd; link_info.hash = _bfd_generic_link_hash_table_create (abfd); link_info.callbacks = &callbacks; However, I'm not sure this is really the right thing to do here ... Bye, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com