This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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: RFC: fix latent bug in syms_from_objfile_1


On Wed, 20 Mar 2013 19:22:49 +0100, Tom Tromey wrote:
> --- symfile.c	14 Mar 2013 20:26:19 -0000	1.367
> +++ symfile.c	20 Mar 2013 18:19:42 -0000
> @@ -997,7 +997,7 @@
>  
>       We no longer warn if the lowest section is not a text segment (as
>       happens for the PA64 port.  */
> -  if (addrs && addrs->other[0].name)
> +  if (addrs && addrs->num_sections > 0 && addrs->other[0].name)
>      addr_info_make_relative (addrs, objfile->obfd);
>  
>    /* Initialize symbol reading routines for this objfile, allow complaints to

I find it just fixes a regression introduced by:
	commit 2679ab4be931bedfc7987d215bc336b912364906
	Author: Elena Zannoni <ezannoni@kwikemart.cygnus.com>
	Date:   Fri Jun 27 13:11:17 2003 +0000

And it also matches how addr_info_make_relative and other code handles ADDRS.

The problem is that alloc_section_addr_info sets NUM_SECTIONS while they are
not yet filled in which leads to those ugly "&& ->other[x].name" checks...


Thanks,
Jan


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