Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Re: PR5692
       [not found] <20080215034748.GA1840@bubble.grove.modra.org>
@ 2008-02-16 16:20 ` Ulrich Weigand
  2008-02-16 23:01   ` PR5692 Alan Modra
  0 siblings, 1 reply; 2+ messages in thread
From: Ulrich Weigand @ 2008-02-16 16:20 UTC (permalink / raw)
  To: Alan Modra; +Cc: binutils, gdb-patches

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: PR5692
  2008-02-16 16:20 ` PR5692 Ulrich Weigand
@ 2008-02-16 23:01   ` Alan Modra
  0 siblings, 0 replies; 2+ messages in thread
From: Alan Modra @ 2008-02-16 23:01 UTC (permalink / raw)
  To: Ulrich Weigand; +Cc: binutils, gdb-patches

On Sat, Feb 16, 2008 at 05:19:41PM +0100, Ulrich Weigand wrote:
> 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 ...

It is.  I have installed your fix.  Thanks!

-- 
Alan Modra
Australia Development Lab, IBM


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-02-16 23:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20080215034748.GA1840@bubble.grove.modra.org>
2008-02-16 16:20 ` PR5692 Ulrich Weigand
2008-02-16 23:01   ` PR5692 Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox