ppc32 merging of e_flags from dynamic objects
[deliverable/binutils-gdb.git] / bfd / elf-strtab.c
index d3e50c76cf82597ded0c345c3d397949df56a024..35b821953df67cc503ccb349c054be1afecf6095 100644 (file)
@@ -245,13 +245,16 @@ _bfd_elf_strtab_save (struct elf_strtab_hash *tab)
 void
 _bfd_elf_strtab_restore (struct elf_strtab_hash *tab, void *buf)
 {
-  size_t idx, curr_size = tab->size;
+  size_t idx, curr_size = tab->size, save_size;
   struct strtab_save *save = (struct strtab_save *) buf;
 
   BFD_ASSERT (tab->sec_size == 0);
-  BFD_ASSERT (save->size <= curr_size);
-  tab->size = save->size;
-  for (idx = 1; idx < save->size; ++idx)
+  save_size = 1;
+  if (save != NULL)
+    save_size = save->size;
+  BFD_ASSERT (save_size <= curr_size);
+  tab->size = save_size;
+  for (idx = 1; idx < save_size; ++idx)
     tab->array[idx]->refcount = save->refcount[idx];
 
   for (; idx < curr_size; ++idx)
@@ -439,7 +442,7 @@ _bfd_elf_strtab_finalize (struct elf_strtab_hash *tab)
        }
     }
 
-alloc_failure:
+ alloc_failure:
   if (array)
     free (array);
 
This page took 0.030878 seconds and 4 git commands to generate.