X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=bfd%2Fecofflink.c;h=e7b35f670db2900240c5df8da2e6f0aff4230d49;hb=abebb03c3af215d7542f5e6b71d78823b15220d5;hp=6e25ed03060b6f85943da4d6dc40a0891b66782b;hpb=219d1afa89d0d53ca93a684cac341f16470f3ca0;p=binutils-gdb.git diff --git a/bfd/ecofflink.c b/bfd/ecofflink.c index 6e25ed03060..e7b35f670db 100644 --- a/bfd/ecofflink.c +++ b/bfd/ecofflink.c @@ -1,5 +1,5 @@ /* Routines to link ECOFF debugging information. - Copyright (C) 1993-2018 Free Software Foundation, Inc. + Copyright (C) 1993-2020 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support, . 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; } @@ -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)