gdb: add target_ops::supports_displaced_step
[deliverable/binutils-gdb.git] / bfd / ecofflink.c
index 0697d8aa5a7f5f94b9d492521866dbb93486c0aa..e7b35f670db2900240c5df8da2e6f0aff4230d49 100644 (file)
@@ -1,5 +1,5 @@
 /* Routines to link ECOFF debugging information.
-   Copyright (C) 1993-2017 Free Software Foundation, Inc.
+   Copyright (C) 1993-2020 Free Software Foundation, Inc.
    Written by Ian Lance Taylor, Cygnus Support, <ian@cygnus.com>.
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -23,6 +23,7 @@
 #include "bfd.h"
 #include "bfdlink.h"
 #include "libbfd.h"
+#include "ecoff-bfd.h"
 #include "objalloc.h"
 #include "aout/stab_gnu.h"
 #include "coff/internal.h"
@@ -466,7 +467,7 @@ bfd_ecoff_debug_init (bfd *output_bfd ATTRIBUTE_UNUSED,
                      struct bfd_link_info *info)
 {
   struct accumulate *ainfo;
-  bfd_size_type amt = sizeof (struct accumulate);
+  size_t amt = sizeof (struct accumulate);
 
   ainfo = (struct accumulate *) bfd_malloc (amt);
   if (!ainfo)
@@ -1111,7 +1112,7 @@ bfd_ecoff_debug_accumulate_other (void * handle,
   fdr.issBase = output_symhdr->issMax;
   fdr.cbSs = 0;
   fdr.rss = ecoff_add_string (ainfo, info, output_debug, &fdr,
-                             input_bfd->filename);
+                             bfd_get_filename (input_bfd));
   if (fdr.rss == -1)
     return FALSE;
   fdr.isymBase = output_symhdr->isymMax;
@@ -1463,12 +1464,10 @@ ecoff_write_symhdr (bfd *abfd,
       != swap->external_hdr_size)
     goto error_return;
 
-  if (buff != NULL)
-    free (buff);
+  free (buff);
   return TRUE;
  error_return:
-  if (buff != NULL)
-    free (buff);
+  free (buff);
   return FALSE;
 }
 
@@ -1684,13 +1683,11 @@ bfd_ecoff_write_accumulated_debug (void * handle,
   if (bfd_bwrite (debug->external_ext, amt, abfd) != amt)
     goto error_return;
 
-  if (space != NULL)
-    free (space);
+  free (space);
   return TRUE;
 
  error_return:
-  if (space != NULL)
-    free (space);
+  free (space);
   return FALSE;
 }
 \f
@@ -2319,12 +2316,11 @@ lookup_line (bfd *abfd,
 
       if (len != 0)
        {
-         if (line_info->find_buffer != NULL)
-           free (line_info->find_buffer);
+         free (line_info->find_buffer);
          buffer = (char *) bfd_malloc ((bfd_size_type) len);
+         line_info->find_buffer = buffer;
          if (buffer == NULL)
            return FALSE;
-         line_info->find_buffer = buffer;
        }
 
       if (function_name != NULL)
This page took 0.02658 seconds and 4 git commands to generate.