Revert previous patch. Applied an old version by mistake.

This commit is contained in:
Pedro Alves 2009-10-28 19:01:16 +00:00
parent 917bdf821d
commit 1a587334a9
2 changed files with 12 additions and 35 deletions

View File

@ -1,8 +1,3 @@
2009-10-28 Pedro Alves <pedro@codesourcery.com>
* dwarf2-frame.c (dwarf2_build_frame_info): Discard --gc-section
leftover FDEs.
2009-10-28 Pedro Alves <pedro@codesourcery.com> 2009-10-28 Pedro Alves <pedro@codesourcery.com>
* infrun.c (keep_going): Wrap with resume_cleanups. * infrun.c (keep_going): Wrap with resume_cleanups.

View File

@ -2101,8 +2101,7 @@ dwarf2_build_frame_info (struct objfile *objfile)
if (fde_table.num_entries != 0) if (fde_table.num_entries != 0)
{ {
struct dwarf2_fde_table *fde_table2; struct dwarf2_fde_table *fde_table2;
struct dwarf2_fde *fde_prev = NULL; int i, j;
int i;
/* Prepare FDE table for lookups. */ /* Prepare FDE table for lookups. */
qsort (fde_table.entries, fde_table.num_entries, qsort (fde_table.entries, fde_table.num_entries,
@ -2111,39 +2110,22 @@ dwarf2_build_frame_info (struct objfile *objfile)
/* Copy fde_table to obstack: it is needed at runtime. */ /* Copy fde_table to obstack: it is needed at runtime. */
fde_table2 = (struct dwarf2_fde_table *) fde_table2 = (struct dwarf2_fde_table *)
obstack_alloc (&objfile->objfile_obstack, sizeof (*fde_table2)); obstack_alloc (&objfile->objfile_obstack, sizeof (*fde_table2));
fde_table2->num_entries = 0;
/* Since we'll be doing bsearch, squeeze out identical (except for /* Since we'll be doing bsearch, squeeze out identical (except for
eh_frame_p) fde entries so bsearch result is predictable. */ eh_frame_p) fde entries so bsearch result is predictable. */
for (i = 0; i < fde_table.num_entries; i++) for (i = 0, j = 0; j < fde_table.num_entries; ++i)
{ {
struct dwarf2_fde *fde = fde_table.entries[i]; const int k = j;
/* Check for leftovers from --gc-sections. The GNU linker obstack_grow (&objfile->objfile_obstack, &fde_table.entries[j],
sets the relevant symbols to zero, but doesn't zero the sizeof (fde_table.entries[0]));
FDE *end* ranges because there's no relocation there. while (++j < fde_table.num_entries
It's (offset, length), not (start, end). On targets && (fde_table.entries[k]->initial_location
where address zero is just another valid address this can == fde_table.entries[j]->initial_location))
be a problem, since the FDEs appear to be non-empty in /* Skip. */;
the output --- we could pick out the wrong FDE. To work }
around this, when overlaps are detected, we prefer FDEs
that do not start at zero. */
if (fde->initial_location == 0
&& (i + 1) < fde_table.num_entries
&& ((fde_table.entries[i + 1])->initial_location
< fde->initial_location + fde->address_range))
continue;
if (fde_prev != NULL
&& fde_prev->initial_location == fde->initial_location)
continue;
obstack_grow (&objfile->objfile_obstack, &fde_table.entries[i],
sizeof (fde_table.entries[0]));
++fde_table2->num_entries;
fde_prev = fde;
}
fde_table2->entries = obstack_finish (&objfile->objfile_obstack); fde_table2->entries = obstack_finish (&objfile->objfile_obstack);
fde_table2->num_entries = i;
set_objfile_data (objfile, dwarf2_frame_objfile_data, fde_table2); set_objfile_data (objfile, dwarf2_frame_objfile_data, fde_table2);
/* Discard the original fde_table. */ /* Discard the original fde_table. */