aboutsummaryrefslogtreecommitdiff
path: root/gdb/objfiles.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/objfiles.c')
-rw-r--r--gdb/objfiles.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/gdb/objfiles.c b/gdb/objfiles.c
index 4bffd20..a9b8fa7 100644
--- a/gdb/objfiles.c
+++ b/gdb/objfiles.c
@@ -773,15 +773,13 @@ static int
objfile_relocate1 (struct objfile *objfile,
const struct section_offsets *new_offsets)
{
- struct obj_section *s;
struct section_offsets *delta =
((struct section_offsets *)
alloca (SIZEOF_N_SECTION_OFFSETS (objfile->num_sections)));
- int i;
int something_changed = 0;
- for (i = 0; i < objfile->num_sections; ++i)
+ for (int i = 0; i < objfile->num_sections; ++i)
{
delta->offsets[i] =
ANOFFSET (new_offsets, i) - ANOFFSET (objfile->section_offsets, i);
@@ -799,13 +797,12 @@ objfile_relocate1 (struct objfile *objfile,
ALL_OBJFILE_FILETABS (objfile, cust, s)
{
struct linetable *l;
- int i;
/* First the line table. */
l = SYMTAB_LINETABLE (s);
if (l)
{
- for (i = 0; i < l->nitems; ++i)
+ for (int i = 0; i < l->nitems; ++i)
l->item[i].pc += ANOFFSET (delta,
COMPUNIT_BLOCK_LINE_SECTION
(cust));
@@ -821,7 +818,7 @@ objfile_relocate1 (struct objfile *objfile,
addrmap_relocate (BLOCKVECTOR_MAP (bv),
ANOFFSET (delta, block_line_section));
- for (i = 0; i < BLOCKVECTOR_NBLOCKS (bv); ++i)
+ for (int i = 0; i < BLOCKVECTOR_NBLOCKS (bv); ++i)
{
struct block *b;
struct symbol *sym;
@@ -872,6 +869,7 @@ objfile_relocate1 (struct objfile *objfile,
get_objfile_pspace_data (objfile->pspace)->section_map_dirty = 1;
/* Update the table in exec_ops, used to read memory. */
+ struct obj_section *s;
ALL_OBJFILE_OSECTIONS (objfile, s)
{
int idx = s - objfile->sections;