* symfile.c (addr_info_make_relative): Move sect declaration to the
	outer block.  Initialize it to NULL.  Prefer SECT->next more than
	bfd_get_section_by_name.

gdb/testsuite/
	* gdb.base/dup-sect.exp, gdb.base/dup-sect.S: New.
This commit is contained in:
Jan Kratochvil
2010-04-22 23:20:15 +00:00
parent 36e92adfb6
commit 1fdf3e62fa
3 changed files with 25 additions and 1 deletions

View File

@@ -1,3 +1,9 @@
2010-04-22 Jan Kratochvil <jan.kratochvil@redhat.com>
* symfile.c (addr_info_make_relative): Move sect declaration to the
outer block. Initialize it to NULL. Prefer SECT->next more than
bfd_get_section_by_name.
2010-04-08 Sami Wagiaalla <swagiaal@redhat.com>
PR Breakpoints/11408:

View File

@@ -566,6 +566,7 @@ addr_info_make_relative (struct section_addr_info *addrs, bfd *abfd)
asection *lower_sect;
CORE_ADDR lower_offset;
int i;
asection *sect;
/* Find lowest loadable section to be used as starting point for
continguous sections. */
@@ -590,10 +591,23 @@ addr_info_make_relative (struct section_addr_info *addrs, bfd *abfd)
(the loadable section directly below it in memory).
this_offset = lower_offset = lower_addr - lower_orig_addr */
sect = NULL;
for (i = 0; i < addrs->num_sections && addrs->other[i].name; i++)
{
asection *sect = bfd_get_section_by_name (abfd, addrs->other[i].name);
const char *sect_name = addrs->other[i].name;
/* Prefer the next section of that we have found last. The separate
debug info files have either the same section layout or just a few
sections are missing there. On the other hand the section name is not
unique and we could find an inappropraite section by its name. */
if (sect)
sect = sect->next;
if (sect && strcmp (sect_name, bfd_get_section_name (abfd, sect)) != 0)
sect = NULL;
if (sect == NULL)
sect = bfd_get_section_by_name (abfd, sect_name);
if (sect)
{
/* This is the index used by BFD. */

View File

@@ -1,3 +1,7 @@
2010-04-22 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.base/dup-sect.exp, gdb.base/dup-sect.S: New.
2010-04-08 Sami Wagiaalla <swagiaal@redhat.com>
* gdb.cp/gdb2384-base.h: Created 'namespace B'.