gdb: defer commit resume until all available events are consumed
[deliverable/binutils-gdb.git] / bfd / elfcode.h
index 7745c537658fc41a962cf5d195ac15566adcfec4..2e2c5343f2ce5f1727dc64161f710e47d7296dae 100644 (file)
@@ -987,12 +987,11 @@ elf_write_relocs (bfd *abfd, asection *sec, void *data)
       (*swap_out) (abfd, &src_rela, dst_rela);
     }
 
-  if (bed->write_secondary_relocs != NULL)
-    if (! bed->write_secondary_relocs (abfd, sec))
-      {
-       *failedp = TRUE;
-       return;
-      }
+  if (!bed->write_secondary_relocs (abfd, sec))
+    {
+      *failedp = TRUE;
+      return;
+    }
 }
 
 /* Write out the program headers.  */
@@ -1145,8 +1144,7 @@ elf_checksum_contents (bfd *abfd,
       if (contents != NULL)
        {
          (*process) (contents, i_shdr.sh_size, arg);
-         if (free_contents != NULL)
-           free (free_contents);
+         free (free_contents);
        }
     }
 
@@ -1403,16 +1401,14 @@ elf_slurp_symbol_table (bfd *abfd, asymbol **symptrs, bfd_boolean dynamic)
       *symptrs = 0;            /* Final null pointer */
     }
 
-  if (xverbuf != NULL)
-    free (xverbuf);
-  if (isymbuf != NULL && hdr->contents != (unsigned char *) isymbuf)
+  free (xverbuf);
+  if (hdr->contents != (unsigned char *) isymbuf)
     free (isymbuf);
   return symcount;
 
  error_return:
-  if (xverbuf != NULL)
-    free (xverbuf);
-  if (isymbuf != NULL && hdr->contents != (unsigned char *) isymbuf)
+  free (xverbuf);
+  if (hdr->contents != (unsigned char *) isymbuf)
     free (isymbuf);
   return -1;
 }
@@ -1510,13 +1506,11 @@ elf_slurp_reloc_table_from_section (bfd *abfd,
        goto error_return;
     }
 
-  if (allocated != NULL)
-    free (allocated);
+  free (allocated);
   return TRUE;
 
  error_return:
-  if (allocated != NULL)
-    free (allocated);
+  free (allocated);
   return FALSE;
 }
 
@@ -1596,8 +1590,7 @@ elf_slurp_reloc_table (bfd *abfd,
                                              symbols, dynamic))
     return FALSE;
 
-  if (bed->slurp_secondary_relocs != NULL
-      && ! bed->slurp_secondary_relocs (abfd, asect, symbols))
+  if (!bed->slurp_secondary_relocs (abfd, asect, symbols))
     return FALSE;
 
   asect->relocation = relents;
@@ -1682,7 +1675,6 @@ NAME(_bfd_elf,bfd_from_remote_memory)
   bfd_vma high_offset;
   bfd_vma shdr_end;
   bfd_vma loadbase;  /* Bytes.  */
-  char *filename;
   size_t amt;
   unsigned int opb = bfd_octets_per_byte (templ, NULL);
 
@@ -1896,22 +1888,14 @@ NAME(_bfd_elf,bfd_from_remote_memory)
       free (contents);
       return NULL;
     }
-  filename = bfd_strdup ("<in-memory>");
-  if (filename == NULL)
-    {
-      free (bim);
-      free (contents);
-      return NULL;
-    }
   nbfd = _bfd_new_bfd ();
-  if (nbfd == NULL)
+  if (nbfd == NULL
+      || !bfd_set_filename (nbfd, "<in-memory>"))
     {
-      free (filename);
       free (bim);
       free (contents);
       return NULL;
     }
-  nbfd->filename = filename;
   nbfd->xvec = templ->xvec;
   bim->size = high_offset;
   bim->buffer = contents;
This page took 0.023978 seconds and 4 git commands to generate.