X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=bfd%2Fecoff.c;h=dcded6f4a7e6bf384f311232958b7fbe74ecd11c;hb=refs%2Fheads%2Fconcurrent-displaced-stepping-2020-04-01;hp=50a133b7bac30d0ecdfa48e3390cff61c62b8bde;hpb=cf28cfef6006c41b74af126bc6ef26590d7bd1b9;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/ecoff.c b/bfd/ecoff.c index 50a133b7ba..dcded6f4a7 100644 --- a/bfd/ecoff.c +++ b/bfd/ecoff.c @@ -488,12 +488,10 @@ ecoff_slurp_symbolic_header (bfd *abfd) /* Now we can get the correct number of symbols. */ abfd->symcount = internal_symhdr->isymMax + internal_symhdr->iextMax; - if (raw != NULL) - free (raw); + free (raw); return TRUE; error_return: - if (raw != NULL) - free (raw); + free (raw); return FALSE; } @@ -1626,7 +1624,7 @@ ecoff_slurp_reloc_table (bfd *abfd, amt = external_reloc_size * section->reloc_count; if (bfd_seek (abfd, section->rel_filepos, SEEK_SET) != 0) return FALSE; - external_relocs = _bfd_alloc_and_read (abfd, amt, amt); + external_relocs = _bfd_malloc_and_read (abfd, amt, amt); if (external_relocs == NULL) return FALSE; @@ -1635,7 +1633,7 @@ ecoff_slurp_reloc_table (bfd *abfd, internal_relocs = (arelent *) bfd_alloc (abfd, amt); if (internal_relocs == NULL) { - bfd_release (abfd, external_relocs); + free (external_relocs); return FALSE; } @@ -1703,7 +1701,7 @@ ecoff_slurp_reloc_table (bfd *abfd, (*backend->adjust_reloc_in) (abfd, &intern, rptr); } - bfd_release (abfd, external_relocs); + free (external_relocs); section->relocation = internal_relocs; @@ -2797,14 +2795,12 @@ _bfd_ecoff_write_object_contents (bfd *abfd) if (reloc_buff != NULL) bfd_release (abfd, reloc_buff); - if (buff != NULL) - free (buff); + free (buff); return TRUE; error_return: if (reloc_buff != NULL) bfd_release (abfd, reloc_buff); - if (buff != NULL) - free (buff); + free (buff); return FALSE; } @@ -3106,7 +3102,7 @@ _bfd_ecoff_write_armap (bfd *abfd, complain that the index is out of date. Actually, the Ultrix linker just checks the archive name; the GNU linker may check the date. */ - stat (abfd->filename, &statbuf); + stat (bfd_get_filename (abfd), &statbuf); _bfd_ar_spacepad (hdr.ar_date, sizeof (hdr.ar_date), "%ld", (long) (statbuf.st_mtime + 60)); @@ -3528,17 +3524,13 @@ ecoff_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) result = ecoff_link_add_externals (abfd, info, external_ext, ssext); - if (ssext != NULL) - free (ssext); - if (external_ext != NULL) - free (external_ext); + free (ssext); + free (external_ext); return result; error_return: - if (ssext != NULL) - free (ssext); - if (external_ext != NULL) - free (external_ext); + free (ssext); + free (external_ext); return FALSE; } @@ -3820,24 +3812,15 @@ ecoff_final_link_debug_accumulate (bfd *output_bfd, return_something: if (ecoff_data (input_bfd)->raw_syments == NULL) { - if (debug->line != NULL) - free (debug->line); - if (debug->external_dnr != NULL) - free (debug->external_dnr); - if (debug->external_pdr != NULL) - free (debug->external_pdr); - if (debug->external_sym != NULL) - free (debug->external_sym); - if (debug->external_opt != NULL) - free (debug->external_opt); - if (debug->external_aux != NULL) - free (debug->external_aux); - if (debug->ss != NULL) - free (debug->ss); - if (debug->external_fdr != NULL) - free (debug->external_fdr); - if (debug->external_rfd != NULL) - free (debug->external_rfd); + free (debug->line); + free (debug->external_dnr); + free (debug->external_pdr); + free (debug->external_sym); + free (debug->external_opt); + free (debug->external_aux); + free (debug->ss); + free (debug->external_fdr); + free (debug->external_rfd); /* Make sure we don't accidentally follow one of these pointers into freed memory. */ @@ -3926,17 +3909,13 @@ ecoff_indirect_link_order (bfd *output_bfd, output_section->reloc_count += input_section->reloc_count; } - if (contents != NULL) - free (contents); - if (external_relocs != NULL) - free (external_relocs); + free (contents); + free (external_relocs); return TRUE; error_return: - if (contents != NULL) - free (contents); - if (external_relocs != NULL) - free (external_relocs); + free (contents); + free (external_relocs); return FALSE; }