[PowerPC] Fix indentation in arch/ppc-linux-common.c
[deliverable/binutils-gdb.git] / gdb / objfiles.c
index df28da59cb0a59e0872b710b5d9d087f4675954f..a9b8fa7c582f74d2548dc84d4b642afb726dd770 100644 (file)
@@ -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;
@@ -831,6 +828,14 @@ objfile_relocate1 (struct objfile *objfile,
          BLOCK_START (b) += ANOFFSET (delta, block_line_section);
          BLOCK_END (b) += ANOFFSET (delta, block_line_section);
 
+         if (BLOCK_RANGES (b) != nullptr)
+           for (int j = 0; j < BLOCK_NRANGES (b); j++)
+             {
+               BLOCK_RANGE_START (b, j)
+                 += ANOFFSET (delta, block_line_section);
+               BLOCK_RANGE_END (b, j) += ANOFFSET (delta, block_line_section);
+             }
+
          /* We only want to iterate over the local symbols, not any
             symbols in included symtabs.  */
          ALL_DICT_SYMBOLS (BLOCK_DICT (b), iter, sym)
@@ -864,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;
This page took 0.025678 seconds and 4 git commands to generate.