Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: amodra@bigpond.net.au (Alan Modra)
Cc: binutils@sourceware.org, gdb-patches@sourceware.org
Subject: Re: PR5692
Date: Sat, 16 Feb 2008 16:20:00 -0000	[thread overview]
Message-ID: <200802161619.m1GGJftU003725@d12av02.megacenter.de.ibm.com> (raw)
In-Reply-To: <20080215034748.GA1840@bubble.grove.modra.org> from "Alan Modra" at Feb 15, 2008 02:17:48 PM

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=<value optimized out>, symbols=<value optimized out>, collect=0)
    at /home/uweigand/fsf/gdb-head/bfd/linker.c:1361
#1  0x00000000005ac583 in bfd_simple_get_relocated_section_contents (abfd=0x9e8d20,
    sec=<value optimized out>, outbuf=0x9fedb0 "", symbol_table=0x0)
    at /home/uweigand/fsf/gdb-head/bfd/simple.c:239
#2  0x0000000000509c22 in dwarf2_read_section (objfile=<value optimized out>, 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


       reply	other threads:[~2008-02-16 16:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20080215034748.GA1840@bubble.grove.modra.org>
2008-02-16 16:20 ` Ulrich Weigand [this message]
2008-02-16 23:01   ` PR5692 Alan Modra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200802161619.m1GGJftU003725@d12av02.megacenter.de.ibm.com \
    --to=uweigand@de.ibm.com \
    --cc=amodra@bigpond.net.au \
    --cc=binutils@sourceware.org \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox