X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=bfd%2Felf32-cr16.c;h=62906c83a500821dcedbcf367d0338ede5e47146;hb=refs%2Fheads%2Fconcurrent-displaced-stepping-2020-04-01;hp=cefd69ed3a2876e13b38e9cf81a713e0acea02a5;hpb=b3adc24a0713411ab38a21dc894dd40dbc5c8f4f;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/elf32-cr16.c b/bfd/elf32-cr16.c index cefd69ed3a..62906c83a5 100644 --- a/bfd/elf32-cr16.c +++ b/bfd/elf32-cr16.c @@ -824,10 +824,9 @@ cr16_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec, } } - result = TRUE; - fail: - if (isymbuf != NULL) - free (isymbuf); + result = TRUE; + fail: + free (isymbuf); return result; } @@ -1572,10 +1571,8 @@ elf32_cr16_get_relocated_section_contents (bfd *output_bfd, isymbuf, sections)) goto error_return; - if (sections != NULL) - free (sections); - if (isymbuf != NULL - && symtab_hdr->contents != (unsigned char *) isymbuf) + free (sections); + if (symtab_hdr->contents != (unsigned char *) isymbuf) free (isymbuf); if (elf_section_data (input_section)->relocs != internal_relocs) free (internal_relocs); @@ -1584,13 +1581,10 @@ elf32_cr16_get_relocated_section_contents (bfd *output_bfd, return data; error_return: - if (sections != NULL) - free (sections); - if (isymbuf != NULL - && symtab_hdr->contents != (unsigned char *) isymbuf) + free (sections); + if (symtab_hdr->contents != (unsigned char *) isymbuf) free (isymbuf); - if (internal_relocs != NULL - && elf_section_data (input_section)->relocs != internal_relocs) + if (elf_section_data (input_section)->relocs != internal_relocs) free (internal_relocs); return NULL; } @@ -1641,7 +1635,7 @@ static struct bfd_link_hash_table * elf32_cr16_link_hash_table_create (bfd *abfd) { struct elf_link_hash_table *ret; - bfd_size_type amt = sizeof (struct elf_link_hash_table); + size_t amt = sizeof (struct elf_link_hash_table); ret = (struct elf_link_hash_table *) bfd_zmalloc (amt); if (ret == (struct elf_link_hash_table *) NULL) @@ -2174,21 +2168,17 @@ elf32_cr16_relax_section (bfd *abfd, asection *sec, } - if (internal_relocs != NULL - && elf_section_data (sec)->relocs != internal_relocs) + if (elf_section_data (sec)->relocs != internal_relocs) free (internal_relocs); return TRUE; error_return: - if (isymbuf != NULL - && symtab_hdr->contents != (unsigned char *) isymbuf) + if (symtab_hdr->contents != (unsigned char *) isymbuf) free (isymbuf); - if (contents != NULL - && elf_section_data (sec)->this_hdr.contents != contents) + if (elf_section_data (sec)->this_hdr.contents != contents) free (contents); - if (internal_relocs != NULL - && elf_section_data (sec)->relocs != internal_relocs) + if (elf_section_data (sec)->relocs != internal_relocs) free (internal_relocs); return FALSE; @@ -2847,18 +2837,16 @@ bfd_cr16_elf32_create_embedded_relocs (bfd *abfd, strncpy ((char *) p + 4, targetsec->output_section->name, 4); } - if (isymbuf != NULL && symtab_hdr->contents != (unsigned char *) isymbuf) + if (symtab_hdr->contents != (unsigned char *) isymbuf) free (isymbuf); - if (internal_relocs != NULL - && elf_section_data (datasec)->relocs != internal_relocs) + if (elf_section_data (datasec)->relocs != internal_relocs) free (internal_relocs); return TRUE; -error_return: - if (isymbuf != NULL && symtab_hdr->contents != (unsigned char *) isymbuf) + error_return: + if (symtab_hdr->contents != (unsigned char *) isymbuf) free (isymbuf); - if (internal_relocs != NULL - && elf_section_data (datasec)->relocs != internal_relocs) + if (elf_section_data (datasec)->relocs != internal_relocs) free (internal_relocs); return FALSE; }