* aoutx.h: Replace "if (x) free (x)" with "free (x)" throughout.
* archive.c, * bfd.c, * bfdio.c, * coff-alpha.c, * coff-ppc.c,
* coff-sh.c, * coff-stgo32.c, * coffcode.h, * coffgen.c,
* cofflink.c, * cpu-arm.c, * doc/chew.c, * dwarf2.c, * ecoff.c,
* ecofflink.c, * elf-eh-frame.c, * elf-m10200.c, * elf-m10300.c,
* elf-strtab.c, * elf.c, * elf32-arc.c, * elf32-arm.c,
* elf32-avr.c, * elf32-bfin.c, * elf32-cr16.c, * elf32-crx.c,
* elf32-epiphany.c, * elf32-ft32.c, * elf32-h8300.c,
* elf32-ip2k.c, * elf32-m32c.c, * elf32-m68hc11.c,
* elf32-m68k.c, * elf32-microblaze.c, * elf32-msp430.c,
* elf32-nds32.c, * elf32-nios2.c, * elf32-ppc.c, * elf32-pru.c,
* elf32-rl78.c, * elf32-rx.c, * elf32-sh.c, * elf32-spu.c,
* elf32-v850.c, * elf32-xtensa.c, * elf64-alpha.c,
* elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c
* elf64-mmix.c, * elf64-ppc.c, * elf64-sparc.c, * elfcode.h,
* elflink.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-mips.c,
* elfxx-x86.c, * format.c, * ihex.c, * libbfd.c, * linker.c,
* mmo.c, * opncls.c, * pdp11.c, * peXXigen.c, * pef.c,
* peicode.h, * simple.c, * som.c, * srec.c, * stabs.c, * syms.c,
* targets.c, * vms-lib.c, * xcofflink.c, * xtensa-isa.c: Likewise.
+2020-05-21 Alan Modra <amodra@gmail.com>
+
+ * aoutx.h: Replace "if (x) free (x)" with "free (x)" throughout.
+ * archive.c, * bfd.c, * bfdio.c, * coff-alpha.c, * coff-ppc.c,
+ * coff-sh.c, * coff-stgo32.c, * coffcode.h, * coffgen.c,
+ * cofflink.c, * cpu-arm.c, * doc/chew.c, * dwarf2.c, * ecoff.c,
+ * ecofflink.c, * elf-eh-frame.c, * elf-m10200.c, * elf-m10300.c,
+ * elf-strtab.c, * elf.c, * elf32-arc.c, * elf32-arm.c,
+ * elf32-avr.c, * elf32-bfin.c, * elf32-cr16.c, * elf32-crx.c,
+ * elf32-epiphany.c, * elf32-ft32.c, * elf32-h8300.c,
+ * elf32-ip2k.c, * elf32-m32c.c, * elf32-m68hc11.c,
+ * elf32-m68k.c, * elf32-microblaze.c, * elf32-msp430.c,
+ * elf32-nds32.c, * elf32-nios2.c, * elf32-ppc.c, * elf32-pru.c,
+ * elf32-rl78.c, * elf32-rx.c, * elf32-sh.c, * elf32-spu.c,
+ * elf32-v850.c, * elf32-xtensa.c, * elf64-alpha.c,
+ * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c
+ * elf64-mmix.c, * elf64-ppc.c, * elf64-sparc.c, * elfcode.h,
+ * elflink.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-mips.c,
+ * elfxx-x86.c, * format.c, * ihex.c, * libbfd.c, * linker.c,
+ * mmo.c, * opncls.c, * pdp11.c, * peXXigen.c, * pef.c,
+ * peicode.h, * simple.c, * som.c, * srec.c, * stabs.c, * syms.c,
+ * targets.c, * vms-lib.c, * xcofflink.c, * xtensa-isa.c: Likewise.
+
2020-05-20 Nelson Chu <nelson.chu@sifive.com>
* elfxx-riscv.h (riscv_parse_subset_t): Add new callback function
else
funclen = strlen (bfd_asymbol_name (func));
- if (adata (abfd).line_buf != NULL)
- free (adata (abfd).line_buf);
+ free (adata (abfd).line_buf);
if (filelen + funclen == 0)
adata (abfd).line_buf = buf = NULL;
|| abfd->tdata.aout_data == NULL)
return TRUE;
-#define BFCI_FREE(x) if (x != NULL) { free (x); x = NULL; }
+#define BFCI_FREE(x) do { free (x); x = NULL; } while (0)
BFCI_FREE (obj_aout_symbols (abfd));
#ifdef USE_MMAP
obj_aout_external_syms (abfd) = 0;
}
}
- if (aout_info.contents != NULL)
- {
- free (aout_info.contents);
- aout_info.contents = NULL;
- }
- if (aout_info.relocs != NULL)
- {
- free (aout_info.relocs);
- aout_info.relocs = NULL;
- }
- if (aout_info.symbol_map != NULL)
- {
- free (aout_info.symbol_map);
- aout_info.symbol_map = NULL;
- }
- if (aout_info.output_syms != NULL)
- {
- free (aout_info.output_syms);
- aout_info.output_syms = NULL;
- }
+ free (aout_info.contents);
+ aout_info.contents = NULL;
+ free (aout_info.relocs);
+ aout_info.relocs = NULL;
+ free (aout_info.symbol_map);
+ aout_info.symbol_map = NULL;
+ free (aout_info.output_syms);
+ aout_info.output_syms = NULL;
+
if (includes_hash_initialized)
{
bfd_hash_table_free (&aout_info.includes.root);
return TRUE;
error_return:
- if (aout_info.contents != NULL)
- free (aout_info.contents);
- if (aout_info.relocs != NULL)
- free (aout_info.relocs);
- if (aout_info.symbol_map != NULL)
- free (aout_info.symbol_map);
- if (aout_info.output_syms != NULL)
- free (aout_info.output_syms);
+ free (aout_info.contents);
+ free (aout_info.relocs);
+ free (aout_info.symbol_map);
+ free (aout_info.output_syms);
if (includes_hash_initialized)
bfd_hash_table_free (&aout_info.includes.root);
return FALSE;
if (len > pathbuf_len)
{
- if (pathbuf != NULL)
- free (pathbuf);
+ free (pathbuf);
pathbuf_len = 0;
pathbuf = (char *) bfd_malloc (len);
if (pathbuf == NULL)
{
if (storage > syms_max)
{
- if (syms_max > 0)
- free (syms);
+ free (syms);
syms_max = storage;
syms = (asymbol **) bfd_malloc (syms_max);
if (syms == NULL)
ret = BFD_SEND (arch, write_armap,
(arch, elength, map, orl_count, stridx));
- if (syms_max > 0)
- free (syms);
- if (map != NULL)
- free (map);
+ free (syms);
+ free (map);
if (first_name != NULL)
bfd_release (arch, first_name);
return ret;
error_return:
- if (syms_max > 0)
- free (syms);
- if (map != NULL)
- free (map);
+ free (syms);
+ free (map);
if (first_name != NULL)
bfd_release (arch, first_name);
res = cplus_demangle (name, options);
- if (alloc != NULL)
- free (alloc);
+ free (alloc);
if (res == NULL)
{
{
struct bfd_in_memory *bim = (struct bfd_in_memory *) abfd->iostream;
- if (bim->buffer != NULL)
- free (bim->buffer);
+ free (bim->buffer);
free (bim);
abfd->iostream = NULL;
abort ();
successful_return:
- if (reloc_vector != NULL)
- free (reloc_vector);
+ free (reloc_vector);
return data;
error_return:
- if (reloc_vector != NULL)
- free (reloc_vector);
+ free (reloc_vector);
return NULL;
}
return nbfd;
error_return:
- if (buf != NULL)
- free (buf);
+ free (buf);
if (nbfd != NULL)
bfd_close (nbfd);
return NULL;
coff_debug_merge_hash_table_free (&flaginfo.debug_merge);
debug_merge_allocated = FALSE;
- if (flaginfo.internal_syms != NULL)
- {
- free (flaginfo.internal_syms);
- flaginfo.internal_syms = NULL;
- }
- if (flaginfo.sec_ptrs != NULL)
- {
- free (flaginfo.sec_ptrs);
- flaginfo.sec_ptrs = NULL;
- }
- if (flaginfo.sym_indices != NULL)
- {
- free (flaginfo.sym_indices);
- flaginfo.sym_indices = NULL;
- }
- if (flaginfo.linenos != NULL)
- {
- free (flaginfo.linenos);
- flaginfo.linenos = NULL;
- }
- if (flaginfo.contents != NULL)
- {
- free (flaginfo.contents);
- flaginfo.contents = NULL;
- }
- if (flaginfo.external_relocs != NULL)
- {
- free (flaginfo.external_relocs);
- flaginfo.external_relocs = NULL;
- }
- if (flaginfo.internal_relocs != NULL)
- {
- free (flaginfo.internal_relocs);
- flaginfo.internal_relocs = NULL;
- }
+ free (flaginfo.internal_syms);
+ flaginfo.internal_syms = NULL;
+ free (flaginfo.sec_ptrs);
+ flaginfo.sec_ptrs = NULL;
+ free (flaginfo.sym_indices);
+ flaginfo.sym_indices = NULL;
+ free (flaginfo.linenos);
+ flaginfo.linenos = NULL;
+ free (flaginfo.contents);
+ flaginfo.contents = NULL;
+ free (flaginfo.external_relocs);
+ flaginfo.external_relocs = NULL;
+ free (flaginfo.internal_relocs);
+ flaginfo.internal_relocs = NULL;
/* The value of the last C_FILE symbol is supposed to be the symbol
index of the first external symbol. Write it out again if
goto error_return;
/* The outsyms buffer is used by _bfd_coff_write_global_sym. */
- if (flaginfo.outsyms != NULL)
- {
- free (flaginfo.outsyms);
- flaginfo.outsyms = NULL;
- }
+ free (flaginfo.outsyms);
+ flaginfo.outsyms = NULL;
if (bfd_link_relocatable (info))
{
for (i = 0; i < abfd->section_count; i++)
{
- if (flaginfo.section_info[i].relocs != NULL)
- free (flaginfo.section_info[i].relocs);
- if (flaginfo.section_info[i].rel_hashes != NULL)
- free (flaginfo.section_info[i].rel_hashes);
+ free (flaginfo.section_info[i].relocs);
+ free (flaginfo.section_info[i].rel_hashes);
}
free (flaginfo.section_info);
flaginfo.section_info = NULL;
for (i = 0; i < abfd->section_count; i++)
{
- if (flaginfo.section_info[i].relocs != NULL)
- free (flaginfo.section_info[i].relocs);
- if (flaginfo.section_info[i].rel_hashes != NULL)
- free (flaginfo.section_info[i].rel_hashes);
+ free (flaginfo.section_info[i].relocs);
+ free (flaginfo.section_info[i].rel_hashes);
}
free (flaginfo.section_info);
}
- if (flaginfo.internal_syms != NULL)
- free (flaginfo.internal_syms);
- if (flaginfo.sec_ptrs != NULL)
- free (flaginfo.sec_ptrs);
- if (flaginfo.sym_indices != NULL)
- free (flaginfo.sym_indices);
- if (flaginfo.outsyms != NULL)
- free (flaginfo.outsyms);
- if (flaginfo.linenos != NULL)
- free (flaginfo.linenos);
- if (flaginfo.contents != NULL)
- free (flaginfo.contents);
- if (flaginfo.external_relocs != NULL)
- free (flaginfo.external_relocs);
- if (flaginfo.internal_relocs != NULL)
- free (flaginfo.internal_relocs);
- if (external_relocs != NULL)
- free (external_relocs);
+ free (flaginfo.internal_syms);
+ free (flaginfo.sec_ptrs);
+ free (flaginfo.sym_indices);
+ free (flaginfo.outsyms);
+ free (flaginfo.linenos);
+ free (flaginfo.contents);
+ free (flaginfo.external_relocs);
+ free (flaginfo.internal_relocs);
+ free (external_relocs);
return FALSE;
}
#endif
return TRUE;
error_return:
- if (internal_relocs != NULL
- && internal_relocs != coff_section_data (abfd, sec)->relocs)
+ if (internal_relocs != coff_section_data (abfd, sec)->relocs)
free (internal_relocs);
- if (contents != NULL && contents != coff_section_data (abfd, sec)->contents)
+ if (contents != coff_section_data (abfd, sec)->contents)
free (contents);
return FALSE;
}
return TRUE;
error_return:
- if (labels != NULL)
- free (labels);
+ free (labels);
return FALSE;
}
\f
return data;
error_return:
- if (internal_relocs != NULL)
- free (internal_relocs);
- if (internal_syms != NULL)
- free (internal_syms);
- if (sections != NULL)
- free (sections);
+ free (internal_relocs);
+ free (internal_syms);
+ free (sections);
return NULL;
}
{
abfd->origin = 0;
- if (go32exe_temp_stub != NULL)
- free (go32exe_temp_stub);
+ free (go32exe_temp_stub);
go32exe_temp_stub = NULL;
go32exe_temp_stub_size = 0;
}
}
#ifdef TARG_AUX
- if (p != NULL)
- free (p);
+ free (p);
#endif
}
for (; erel < erel_end; erel += relsz, irel++)
bfd_coff_swap_reloc_in (abfd, (void *) erel, (void *) irel);
- if (free_external != NULL)
- {
- free (free_external);
- free_external = NULL;
- }
+ free (free_external);
+ free_external = NULL;
if (cache && free_internal != NULL)
{
return internal_relocs;
error_return:
- if (free_external != NULL)
- free (free_external);
- if (free_internal != NULL)
- free (free_internal);
+ free (free_external);
+ free (free_internal);
return NULL;
}
coff_debug_merge_hash_table_free (&flaginfo.debug_merge);
debug_merge_allocated = FALSE;
- if (flaginfo.internal_syms != NULL)
- {
- free (flaginfo.internal_syms);
- flaginfo.internal_syms = NULL;
- }
- if (flaginfo.sec_ptrs != NULL)
- {
- free (flaginfo.sec_ptrs);
- flaginfo.sec_ptrs = NULL;
- }
- if (flaginfo.sym_indices != NULL)
- {
- free (flaginfo.sym_indices);
- flaginfo.sym_indices = NULL;
- }
- if (flaginfo.linenos != NULL)
- {
- free (flaginfo.linenos);
- flaginfo.linenos = NULL;
- }
- if (flaginfo.contents != NULL)
- {
- free (flaginfo.contents);
- flaginfo.contents = NULL;
- }
- if (flaginfo.external_relocs != NULL)
- {
- free (flaginfo.external_relocs);
- flaginfo.external_relocs = NULL;
- }
- if (flaginfo.internal_relocs != NULL)
- {
- free (flaginfo.internal_relocs);
- flaginfo.internal_relocs = NULL;
- }
+ free (flaginfo.internal_syms);
+ flaginfo.internal_syms = NULL;
+ free (flaginfo.sec_ptrs);
+ flaginfo.sec_ptrs = NULL;
+ free (flaginfo.sym_indices);
+ flaginfo.sym_indices = NULL;
+ free (flaginfo.linenos);
+ flaginfo.linenos = NULL;
+ free (flaginfo.contents);
+ flaginfo.contents = NULL;
+ free (flaginfo.external_relocs);
+ flaginfo.external_relocs = NULL;
+ free (flaginfo.internal_relocs);
+ flaginfo.internal_relocs = NULL;
/* The value of the last C_FILE symbol is supposed to be the symbol
index of the first external symbol. Write it out again if
goto error_return;
/* The outsyms buffer is used by _bfd_coff_write_global_sym. */
- if (flaginfo.outsyms != NULL)
- {
- free (flaginfo.outsyms);
- flaginfo.outsyms = NULL;
- }
+ free (flaginfo.outsyms);
+ flaginfo.outsyms = NULL;
if (bfd_link_relocatable (info) && max_output_reloc_count > 0)
{
for (i = 0; i < abfd->section_count; i++)
{
- if (flaginfo.section_info[i].relocs != NULL)
- free (flaginfo.section_info[i].relocs);
- if (flaginfo.section_info[i].rel_hashes != NULL)
- free (flaginfo.section_info[i].rel_hashes);
+ free (flaginfo.section_info[i].relocs);
+ free (flaginfo.section_info[i].rel_hashes);
}
free (flaginfo.section_info);
flaginfo.section_info = NULL;
for (i = 0; i < abfd->section_count; i++)
{
- if (flaginfo.section_info[i].relocs != NULL)
- free (flaginfo.section_info[i].relocs);
- if (flaginfo.section_info[i].rel_hashes != NULL)
- free (flaginfo.section_info[i].rel_hashes);
+ free (flaginfo.section_info[i].relocs);
+ free (flaginfo.section_info[i].rel_hashes);
}
free (flaginfo.section_info);
}
- if (flaginfo.internal_syms != NULL)
- free (flaginfo.internal_syms);
- if (flaginfo.sec_ptrs != NULL)
- free (flaginfo.sec_ptrs);
- if (flaginfo.sym_indices != NULL)
- free (flaginfo.sym_indices);
- if (flaginfo.outsyms != NULL)
- free (flaginfo.outsyms);
- if (flaginfo.linenos != NULL)
- free (flaginfo.linenos);
- if (flaginfo.contents != NULL)
- free (flaginfo.contents);
- if (flaginfo.external_relocs != NULL)
- free (flaginfo.external_relocs);
- if (flaginfo.internal_relocs != NULL)
- free (flaginfo.internal_relocs);
- if (external_relocs != NULL)
- free (external_relocs);
+ free (flaginfo.internal_syms);
+ free (flaginfo.sec_ptrs);
+ free (flaginfo.sym_indices);
+ free (flaginfo.outsyms);
+ free (flaginfo.linenos);
+ free (flaginfo.contents);
+ free (flaginfo.external_relocs);
+ free (flaginfo.internal_relocs);
+ free (external_relocs);
return FALSE;
}
if (!bfd_malloc_and_get_section (abfd, sec, ©))
{
- if (copy != NULL)
- free (copy);
+ free (copy);
return 0;
}
e = (char *) copy + sec->size;
return TRUE;
FAIL:
- if (buffer != NULL)
- free (buffer);
+ free (buffer);
return FALSE;
}
}
FAIL:
- if (buffer != NULL)
- free (buffer);
+ free (buffer);
return bfd_mach_arm_unknown;
}
delete_string (buffer)
string_type *buffer;
{
- if (buffer->ptr)
- free (buffer->ptr);
+ free (buffer->ptr);
buffer->ptr = NULL;
}
{
dict_type *next;
- if (ptr->word)
- free (ptr->word);
+ free (ptr->word);
if (ptr->code)
{
int i;
fprintf (stderr, "syntax error at %s\n", string - 1);
}
}
- if (word)
- free (word);
+ free (word);
}
static void
(_("DWARF error: mangled line number section"));
bfd_set_error (bfd_error_bad_value);
line_fail:
- if (filename != NULL)
- free (filename);
+ free (filename);
goto fail;
}
break;
filenum = _bfd_safe_read_leb128 (abfd, line_ptr, &bytes_read,
FALSE, line_end);
line_ptr += bytes_read;
- if (filename)
- free (filename);
+ free (filename);
filename = concat_filename (table, filenum);
break;
}
}
}
- if (filename)
- free (filename);
+ free (filename);
}
if (unit->line_offset == 0)
table->sequences = table->sequences->prev_sequence;
free (seq);
}
- if (table->files != NULL)
- free (table->files);
- if (table->dirs != NULL)
- free (table->dirs);
+ free (table->files);
+ free (table->dirs);
return NULL;
}
free (each->line_table->dirs);
}
- if (each->lookup_funcinfo_table)
- {
- free (each->lookup_funcinfo_table);
- each->lookup_funcinfo_table = NULL;
- }
+ free (each->lookup_funcinfo_table);
+ each->lookup_funcinfo_table = NULL;
while (function_table)
{
- if (function_table->file)
- {
- free (function_table->file);
- function_table->file = NULL;
- }
- if (function_table->caller_file)
- {
- free (function_table->caller_file);
- function_table->caller_file = NULL;
- }
+ free (function_table->file);
+ function_table->file = NULL;
+ free (function_table->caller_file);
+ function_table->caller_file = NULL;
function_table = function_table->prev_func;
}
while (variable_table)
{
- if (variable_table->file)
- {
- free (variable_table->file);
- variable_table->file = NULL;
- }
+ free (variable_table->file);
+ variable_table->file = NULL;
variable_table = variable_table->prev_var;
}
}
/* 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;
}
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;
}
\f
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;
}
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. */
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;
}
!= 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;
}
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
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)
(_("error in %pB(%pA); no .eh_frame_hdr table will be created"),
abfd, sec);
hdr_info->u.dwarf.table = FALSE;
- if (sec_info)
- free (sec_info);
+ free (sec_info);
success:
- if (ehbuf)
- free (ehbuf);
- if (local_cies)
- free (local_cies);
+ free (ehbuf);
+ free (local_cies);
#undef REQUIRE
}
}
}
- if (sec_info->cies)
- {
- free (sec_info->cies);
- sec_info->cies = NULL;
- }
+ free (sec_info->cies);
+ sec_info->cies = NULL;
/* It may be that some .eh_frame input section has greater alignment
than other .eh_frame sections. In that case we run the risk of
retval = FALSE;
free (contents);
- if (hdr_info->u.dwarf.array != NULL)
- free (hdr_info->u.dwarf.array);
+ free (hdr_info->u.dwarf.array);
return retval;
}
}
}
- 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;
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);
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;
}
result = TRUE;
fail:
- if (isymbuf != NULL && symtab_hdr->contents != (unsigned char *) isymbuf)
+ if (symtab_hdr->contents != (unsigned char *) isymbuf)
free (isymbuf);
return result;
}
/* Cache or free any memory we allocated for the relocs. */
- if (internal_relocs != NULL
- && elf_section_data (section)->relocs != internal_relocs)
+ if (elf_section_data (section)->relocs != internal_relocs)
free (internal_relocs);
internal_relocs = NULL;
}
/* Cache or free any memory we allocated for the relocs. */
- if (internal_relocs != NULL
- && elf_section_data (section)->relocs != internal_relocs)
+ if (elf_section_data (section)->relocs != internal_relocs)
free (internal_relocs);
internal_relocs = NULL;
}
}
- 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 (section)->this_hdr.contents != contents)
+ if (elf_section_data (section)->this_hdr.contents != contents)
free (contents);
- if (internal_relocs != NULL
- && elf_section_data (section)->relocs != internal_relocs)
+ if (elf_section_data (section)->relocs != internal_relocs)
free (internal_relocs);
return FALSE;
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 (internal_relocs != elf_section_data (input_section)->relocs)
free (internal_relocs);
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
- && internal_relocs != elf_section_data (input_section)->relocs)
+ if (internal_relocs != elf_section_data (input_section)->relocs)
free (internal_relocs);
return NULL;
}
}
alloc_failure:
- if (array)
- free (array);
+ free (array);
/* Assign positions to the strings we want to keep. */
sec_size = 1;
_bfd_error_handler (_("%pB symbol number %lu references"
" nonexistent SHT_SYMTAB_SHNDX section"),
ibfd, (unsigned long) symoffset);
- if (alloc_intsym != NULL)
- free (alloc_intsym);
+ free (alloc_intsym);
intsym_buf = NULL;
goto out;
}
out:
- if (alloc_ext != NULL)
- free (alloc_ext);
- if (alloc_extshndx != NULL)
- free (alloc_extshndx);
+ free (alloc_ext);
+ free (alloc_extshndx);
return intsym_buf;
}
return TRUE;
error_return:
- if (dynbuf != NULL)
- free (dynbuf);
+ free (dynbuf);
return FALSE;
}
return TRUE;
error_return:
- if (sections != NULL)
- free (sections);
+ free (sections);
return FALSE;
}
return TRUE;
error_return:
- if (contents != NULL)
- free (contents);
+ free (contents);
return FALSE;
}
\f
elf_section_data (sec)->this_hdr.contents = contents;
}
- 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;
free (internal_relocs);
/* Fall through. */
error_ret_free_local:
- if (local_syms != NULL
- && (symtab_hdr->contents
- != (unsigned char *) local_syms))
+ if (symtab_hdr->contents != (unsigned char *) local_syms)
free (local_syms);
return FALSE;
}
}
}
- if (contents != NULL
- && elf_section_data (sec)->this_hdr.contents != contents)
+ if (elf_section_data (sec)->this_hdr.contents != contents)
free (contents);
contents = NULL;
- if (internal_relocs != NULL
- && elf_section_data (sec)->relocs != internal_relocs)
+ if (elf_section_data (sec)->relocs != internal_relocs)
free (internal_relocs);
internal_relocs = NULL;
}
return TRUE;
error_return:
- 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;
}
}
- if (contents != NULL
- && elf_section_data (sec)->this_hdr.contents != contents)
+ if (elf_section_data (sec)->this_hdr.contents != contents)
free (contents);
contents = NULL;
}
return TRUE;
error_return:
- if (contents != NULL
- && elf_section_data (sec)->this_hdr.contents != contents)
+ if (elf_section_data (sec)->this_hdr.contents != contents)
free (contents);
return FALSE;
}
}
- if (contents != NULL
- && elf_section_data (sec)->this_hdr.contents != contents)
+ if (elf_section_data (sec)->this_hdr.contents != contents)
free (contents);
contents = NULL;
}
return TRUE;
error_return:
- if (contents != NULL
- && elf_section_data (sec)->this_hdr.contents != contents)
+ if (elf_section_data (sec)->this_hdr.contents != contents)
free (contents);
return FALSE;
= (struct elf32_avr_link_hash_table *) obfd->link.hash;
/* Free the address mapping table. */
- if (htab->amt_stub_offsets != NULL)
- free (htab->amt_stub_offsets);
- if (htab->amt_destination_addr != NULL)
- free (htab->amt_destination_addr);
+ free (htab->amt_stub_offsets);
+ free (htab->amt_destination_addr);
bfd_hash_table_free (&htab->bstab);
_bfd_elf_link_hash_table_free (obfd);
}
}
- 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;
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);
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;
}
strncpy ((char *) p + 4, targetsec->output_section->name, 8);
}
- 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)
+ 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;
}
}
}
- result = TRUE;
- fail:
- if (isymbuf != NULL)
- free (isymbuf);
+ result = TRUE;
+ fail:
+ free (isymbuf);
return result;
}
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);
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;
}
}
- 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;
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)
+ 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;
}
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);
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;
}
}
}
- 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;
}
}
- 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;
}
}
- 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 (free_relocs != NULL)
- free (free_relocs);
+ free (free_relocs);
return TRUE;
}
}
}
- 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;
}
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);
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;
}
{
if (!bfd_malloc_and_get_section (abfd, stab, &stabcontents))
{
- if (stabcontents != NULL)
- free (stabcontents);
+ free (stabcontents);
return;
}
}
}
- 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;
}
} /* next relocation */
- if (free_relocs != NULL)
- {
- free (free_relocs);
- free_relocs = NULL;
- }
+ free (free_relocs);
+ free_relocs = NULL;
if (free_contents != NULL)
{
/* Cache the symbols for elf_link_input_bfd. */
else
{
- symtab_hdr->contents = NULL /* (unsigned char *) intsyms*/;
+ symtab_hdr->contents = NULL /* (unsigned char *) intsyms*/;
}
free_intsyms = NULL;
return TRUE;
error_return:
- if (free_relocs != NULL)
- free (free_relocs);
- if (free_contents != NULL)
- free (free_contents);
+ free (free_relocs);
+ free (free_contents);
if (shndx_buf != NULL)
{
shndx_hdr->contents = NULL;
free (shndx_buf);
}
- if (free_intsyms != NULL)
- free (free_intsyms);
+ free (free_intsyms);
return FALSE;
}
prev_insn_group = 0;
}
- if (free_relocs != NULL)
- {
- free (free_relocs);
- free_relocs = NULL;
- }
+ free (free_relocs);
+ free_relocs = NULL;
if (free_contents != NULL)
{
return TRUE;
error_return:
- if (free_relocs != NULL)
- free (free_relocs);
- if (free_contents != NULL)
- free (free_contents);
- if (free_extsyms != NULL)
- free (free_extsyms);
+ free (free_relocs);
+ free (free_contents);
+ free (free_extsyms);
return FALSE;
}
strncpy ((char *) p + 4, targetsec->output_section->name, 8);
}
- 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)
+ 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;
}
symtab_hdr->contents = (bfd_byte *) isymbuf;
}
- if (free_relocs != NULL)
- {
- free (free_relocs);
- free_relocs = NULL;
- }
+ free (free_relocs);
+ free_relocs = NULL;
if (free_contents != NULL)
{
return TRUE;
error_return:
- if (free_relocs != NULL)
- free (free_relocs);
- if (free_contents != NULL)
- free (free_contents);
- if (sec->relax != NULL)
- {
- free (sec->relax);
- sec->relax = NULL;
- sec->relax_count = 0;
- }
+ free (free_relocs);
+ free (free_contents);
+ free (sec->relax);
+ sec->relax = NULL;
+ sec->relax_count = 0;
return FALSE;
}
}
}
- 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;
}
finish:
- if (internal_relocs != NULL
- && elf_section_data (sec)->relocs != internal_relocs)
+ if (elf_section_data (sec)->relocs != internal_relocs)
free (internal_relocs);
- if (contents != NULL
- && elf_section_data (sec)->this_hdr.contents != contents)
+ if (elf_section_data (sec)->this_hdr.contents != contents)
free (contents);
- if (isymbuf != NULL && symtab_hdr->contents != (bfd_byte *) isymbuf)
+ if (symtab_hdr->contents != (bfd_byte *) isymbuf)
free (isymbuf);
return result;
}
while (FALSE);
- if ((relocs != NULL) && (elf_section_data (asec)->relocs != relocs))
+ if (elf_section_data (asec)->relocs != relocs)
free (relocs);
if ((min_id != relax_group_ptr->min_id)
}
while (FALSE);
- if (relocs != NULL && elf_section_data (asec)->relocs != relocs)
+ if (elf_section_data (asec)->relocs != relocs)
free (relocs);
return result;
if (incontents)
contents = NULL;
- if (internal_relocs != NULL
- && elf_section_data (insec)->relocs != internal_relocs)
+ if (elf_section_data (insec)->relocs != internal_relocs)
free (internal_relocs);
- if (contents != NULL
- && elf_section_data (insec)->this_hdr.contents != contents)
+ if (elf_section_data (insec)->this_hdr.contents != contents)
free (contents);
- if (local_syms != NULL && symtab_hdr->contents != (bfd_byte *) local_syms)
+ if (symtab_hdr->contents != (bfd_byte *) local_syms)
free (local_syms);
if (chain.next)
{
(*info->callbacks->warning) (info, msg, name, input_bfd,
input_section, rel->r_offset);
- if (msgbuf)
- free (msgbuf);
+ free (msgbuf);
return FALSE;
}
}
apuinfo_set = TRUE;
if (largest_input_size < asec->size)
{
- if (buffer)
- free (buffer);
+ free (buffer);
largest_input_size = asec->size;
buffer = bfd_malloc (largest_input_size);
if (!buffer)
}
fail:
- if (buffer)
- free (buffer);
+ free (buffer);
if (error_message)
_bfd_error_handler (error_message, APUINFO_SECTION_NAME, ibfd);
{
if (elf_section_data (sec)->relocs != relstart)
free (relstart);
- if (local_syms != NULL
- && symtab_hdr->contents != (unsigned char *) local_syms)
+ if (symtab_hdr->contents != (unsigned char *) local_syms)
free (local_syms);
return FALSE;
}
rel_hdr = _bfd_elf_single_rel_hdr (isec);
rel_hdr->sh_size += changes * rel_hdr->sh_entsize;
}
- else if (internal_relocs != NULL
- && elf_section_data (isec)->relocs != internal_relocs)
+ else if (elf_section_data (isec)->relocs != internal_relocs)
free (internal_relocs);
*again = changes != 0 || workaround_change;
branch_fixups = branch_fixups->next;
free (f);
}
- if (isymbuf != NULL && (unsigned char *) isymbuf != symtab_hdr->contents)
+ if ((unsigned char *) isymbuf != symtab_hdr->contents)
free (isymbuf);
- if (contents != NULL
- && elf_section_data (isec)->this_hdr.contents != contents)
+ if (elf_section_data (isec)->this_hdr.contents != contents)
free (contents);
- if (internal_relocs != NULL
- && elf_section_data (isec)->relocs != internal_relocs)
+ if (elf_section_data (isec)->relocs != internal_relocs)
free (internal_relocs);
return FALSE;
}
if (!get_sym_h (NULL, &sym, &sym_sec, NULL, &local_syms,
lplt - local_plt, ibfd))
{
- if (local_syms != NULL
- && symtab_hdr->contents != (unsigned char *) local_syms)
+ if (symtab_hdr->contents != (unsigned char *) local_syms)
free (local_syms);
return FALSE;
}
}
}
- 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;
return TRUE;
error_return:
- if (free_relocs != NULL)
- free (free_relocs);
-
- if (free_contents != NULL)
- free (free_contents);
+ free (free_relocs);
+ free (free_contents);
if (shndx_buf != NULL)
{
free (shndx_buf);
}
- if (free_intsyms != NULL)
- free (free_intsyms);
+ free (free_intsyms);
return TRUE;
}
return TRUE;
error_return:
- if (free_contents != NULL)
- free (free_contents);
+ free (free_contents);
if (shndx_buf != NULL)
{
free (shndx_buf);
}
- if (free_intsyms != NULL)
- free (free_intsyms);
+ free (free_intsyms);
return FALSE;
}
if (!bfd_malloc_and_get_section (input_bfd, symbol_section,
&contents))
{
- if (contents != NULL)
- free (contents);
+ free (contents);
return bfd_reloc_outofrange;
}
}
end = start0;
}
- if (contents != NULL
- && elf_section_data (symbol_section)->this_hdr.contents != contents)
+ if (elf_section_data (symbol_section)->this_hdr.contents != contents)
free (contents);
insn = bfd_get_16 (input_bfd, contents + addr);
}
}
- 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;
when we leave sh_coff_relax_section. */
if (!bfd_malloc_and_get_section (abfd, o, &ocontents))
{
- if (ocontents != NULL)
- free (ocontents);
+ free (ocontents);
return FALSE;
}
when we leave sh_coff_relax_section. */
if (!bfd_malloc_and_get_section (abfd, o, &ocontents))
{
- if (ocontents != NULL)
- free (ocontents);
+ free (ocontents);
return FALSE;
}
return TRUE;
error_return:
- if (labels != NULL)
- free (labels);
+ free (labels);
return FALSE;
}
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);
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;
}
if (elf_section_data (isec)->relocs != internal_relocs)
free (internal_relocs);
error_ret_free_local:
- if (local_syms != NULL
- && (symtab_hdr->contents
- != (unsigned char *) local_syms))
+ if (symtab_hdr->contents != (unsigned char *) local_syms)
free (local_syms);
return FALSE;
}
continue;
}
- if (symtab_hdr->contents != NULL)
- {
- /* Don't use cached symbols since the generic ELF linker
- code only reads local symbols, and we need globals too. */
- free (symtab_hdr->contents);
- symtab_hdr->contents = NULL;
- }
+ /* Don't use cached symbols since the generic ELF linker
+ code only reads local symbols, and we need globals too. */
+ free (symtab_hdr->contents);
+ symtab_hdr->contents = NULL;
syms = bfd_elf_get_elf_syms (ibfd, symtab_hdr, symcount, 0,
NULL, NULL, NULL);
symtab_hdr->contents = (void *) syms;
}
finish:
- if (internal_relocs != NULL
- && elf_section_data (sec)->relocs != internal_relocs)
+ if (elf_section_data (sec)->relocs != internal_relocs)
free (internal_relocs);
- if (contents != NULL
- && elf_section_data (sec)->this_hdr.contents != (unsigned char *) contents)
+ if (elf_section_data (sec)->this_hdr.contents != (unsigned char *) contents)
free (contents);
- if (isymbuf != NULL
- && symtab_hdr->contents != (bfd_byte *) isymbuf)
+ if (symtab_hdr->contents != (bfd_byte *) isymbuf)
free (isymbuf);
return result;
}
}
- if (lit_table)
- free (lit_table);
-
+ free (lit_table);
input_section->reloc_done = TRUE;
return TRUE;
if (!bfd_malloc_and_get_section (output_bfd, sxtlit, &contents))
{
- if (contents != 0)
- free (contents);
+ free (contents);
free (table);
return -1;
}
{
release_contents (sec_cache->sec, sec_cache->contents);
release_internal_relocs (sec_cache->sec, sec_cache->relocs);
- if (sec_cache->ptbl)
- free (sec_cache->ptbl);
+ free (sec_cache->ptbl);
}
}
err:
release_contents (sec, contents);
release_internal_relocs (sec, internal_relocs);
- if (prop_table)
- free (prop_table);
+ free (prop_table);
return FALSE;
}
static void
free_ebb_constraint (ebb_constraint *c)
{
- if (c->actions)
- free (c->actions);
+ free (c->actions);
}
for (i = 0; i < c->action_count; i++)
new_actions[i] = c->actions[i];
- if (c->actions)
- free (c->actions);
+ free (c->actions);
c->actions = new_actions;
c->action_allocated = new_allocated;
}
static void
release_internal_relocs (asection *sec, Elf_Internal_Rela *internal_relocs)
{
- if (internal_relocs
- && elf_section_data (sec)->relocs != internal_relocs)
+ if (elf_section_data (sec)->relocs != internal_relocs)
free (internal_relocs);
}
{
if (!bfd_malloc_and_get_section (abfd, sec, &contents))
{
- if (contents)
- free (contents);
+ free (contents);
return NULL;
}
if (keep_memory)
static void
release_contents (asection *sec, bfd_byte *contents)
{
- if (contents && elf_section_data (sec)->this_hdr.contents != contents)
+ if (elf_section_data (sec)->this_hdr.contents != contents)
free (contents);
}
error_return:
release_contents (sec, contents);
release_internal_relocs (sec, internal_relocs);
- if (prop_table)
- free (prop_table);
- if (reloc_opcodes)
- free (reloc_opcodes);
+ free (prop_table);
+ free (reloc_opcodes);
return ok;
}
static void
free_xlate_map (xlate_map_t *map)
{
- if (map && map->entry)
- free (map->entry);
if (map)
- free (map);
+ {
+ free (map->entry);
+ free (map);
+ }
}
}
}
- if (xmap)
- free_xlate_map (xmap);
+ free_xlate_map (xmap);
return ok;
}
#endif /* DEBUG */
error_return:
- if (prop_table)
- free (prop_table);
+ free (prop_table);
free_section_cache (&target_sec_cache);
release_contents (sec, contents);
return TRUE;
error_return:
- if (ext_hdr != NULL)
- free (ext_hdr);
- 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->ssext != NULL)
- free (debug->ssext);
- if (debug->external_fdr != NULL)
- free (debug->external_fdr);
- if (debug->external_rfd != NULL)
- free (debug->external_rfd);
- if (debug->external_ext != NULL)
- free (debug->external_ext);
+ free (ext_hdr);
+ 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->ssext);
+ free (debug->external_fdr);
+ free (debug->external_rfd);
+ free (debug->external_ext);
return FALSE;
}
if (!gpdisp || gpdisp->r_addend != 4)
{
- if (tsec_free)
- free (tsec_free);
+ free (tsec_free);
return 0;
}
- if (tsec_free)
- free (tsec_free);
+ free (tsec_free);
}
/* We've now determined that we can skip an initial gp load. Verify
return TRUE;
error_return:
- if (isymbuf != NULL
- && symtab_hdr->contents != (unsigned char *) isymbuf)
+ if (symtab_hdr->contents != (unsigned char *) isymbuf)
free (isymbuf);
- if (info.contents != NULL
- && elf_section_data (sec)->this_hdr.contents != info.contents)
+ if (elf_section_data (sec)->this_hdr.contents != info.contents)
free (info.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;
}
?!? Note we leak the last section_syms array. Presumably we
could free it in one of the later routines in this file. */
- if (hppa_info->section_syms)
- free (hppa_info->section_syms);
+ free (hppa_info->section_syms);
/* Read this BFD's local symbols. */
if (symtab_hdr->sh_info != 0)
return TRUE;
error_return:
- if (isymbuf != NULL && (unsigned char *) isymbuf != symtab_hdr->contents)
+ if ((unsigned char *) isymbuf != symtab_hdr->contents)
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;
}
if (entry->root.root.type == bfd_link_hash_warning)
entry = (struct elf64_ia64_link_hash_entry *) entry->root.root.u.i.link;
- if (entry->info)
- {
- free (entry->info);
- entry->info = NULL;
- entry->count = 0;
- entry->sorted_count = 0;
- entry->size = 0;
- }
+ free (entry->info);
+ entry->info = NULL;
+ entry->count = 0;
+ entry->sorted_count = 0;
+ entry->size = 0;
return TRUE;
}
struct elf64_ia64_local_hash_entry *entry
= (struct elf64_ia64_local_hash_entry *) *slot;
- if (entry->info)
- {
- free (entry->info);
- entry->info = NULL;
- entry->count = 0;
- entry->sorted_count = 0;
- entry->size = 0;
- }
+ free (entry->info);
+ entry->info = NULL;
+ entry->count = 0;
+ entry->sorted_count = 0;
+ entry->size = 0;
return TRUE;
}
}
}
- if (isymbuf != NULL)
- {
- free (isymbuf);
- isymbuf = NULL;
- }
+ free (isymbuf);
+ isymbuf = NULL;
/* If this object is the same format as the output object, and it is
not a shared library, then let the backend look through the
error_free_vers:
error_free_sym:
- if (isymbuf != NULL)
- free (isymbuf);
+ free (isymbuf);
error_return:
return FALSE;
}
}
}
- if (allocated != NULL)
- free (allocated);
-
+ free (allocated);
return TRUE;
error_return:
- if (allocated != NULL)
- free (allocated);
+ free (allocated);
return FALSE;
}
BFD_ASSERT(pjsno == mmix_elf_section_data (sec)->pjs.n_pushj_relocs);
- if (internal_relocs != NULL
- && elf_section_data (sec)->relocs != internal_relocs)
+ if (elf_section_data (sec)->relocs != internal_relocs)
free (internal_relocs);
if (sec->size < size + mmix_elf_section_data (sec)->pjs.stubs_size_sum)
return TRUE;
error_return:
- if (isymbuf != NULL && (unsigned char *) isymbuf != symtab_hdr->contents)
+ if ((unsigned char *) isymbuf != symtab_hdr->contents)
free (isymbuf);
- if (internal_relocs != NULL
- && elf_section_data (sec)->relocs != internal_relocs)
+ if (elf_section_data (sec)->relocs != internal_relocs)
free (internal_relocs);
return FALSE;
}
free_contents_and_exit_err:
count = -1;
free_contents_and_exit:
- if (contents)
- free (contents);
+ free (contents);
goto done;
}
bfd_byte *loc;
if (!bfd_malloc_and_get_section (ibfd, sec, &loc))
{
- if (loc != NULL)
- free (loc);
+ free (loc);
error_ret:
- if (local_syms != NULL
- && symtab_hdr->contents != (unsigned char *) local_syms)
+ if (symtab_hdr->contents != (unsigned char *) local_syms)
free (local_syms);
if (elf_section_data (sec)->relocs != relstart)
free (relstart);
{
if (elf_section_data (sec)->relocs != relstart)
free (relstart);
- if (local_syms != NULL
- && symtab_hdr->contents != (bfd_byte *) local_syms)
+ if (symtab_hdr->contents != (bfd_byte *) local_syms)
free (local_syms);
return FALSE;
}
err_free_rel:
if (elf_section_data (sec)->relocs != relstart)
free (relstart);
- if (toc_ref != NULL)
- free (toc_ref);
- if (locsyms != NULL
- && (elf_symtab_hdr (ibfd).contents
- != (unsigned char *) locsyms))
+ free (toc_ref);
+ if (elf_symtab_hdr (ibfd).contents
+ != (unsigned char *) locsyms)
free (locsyms);
return ret;
}
}
}
- if (toc_ref != NULL)
- free (toc_ref);
+ free (toc_ref);
htab->do_tls_opt = 1;
return TRUE;
}
if (used == NULL)
{
error_ret:
- if (local_syms != NULL
- && symtab_hdr->contents != (unsigned char *) local_syms)
+ if (symtab_hdr->contents != (unsigned char *) local_syms)
free (local_syms);
if (sec != NULL
- && relstart != NULL
&& elf_section_data (sec)->relocs != relstart)
free (relstart);
- if (toc_relocs != NULL
- && elf_section_data (toc)->relocs != toc_relocs)
+ if (elf_section_data (toc)->relocs != toc_relocs)
free (toc_relocs);
- if (skip != NULL)
- free (skip);
+ free (skip);
return FALSE;
}
rel_hdr->sh_size = toc->reloc_count * sz;
}
}
- else if (toc_relocs != NULL
- && elf_section_data (toc)->relocs != toc_relocs)
+ else if (elf_section_data (toc)->relocs != toc_relocs)
free (toc_relocs);
if (local_syms != NULL
if (relstart == NULL)
{
got_error_ret:
- if (local_syms != NULL
- && symtab_hdr->contents != (unsigned char *) local_syms)
+ if (symtab_hdr->contents != (unsigned char *) local_syms)
free (local_syms);
if (sec != NULL
- && relstart != NULL
&& elf_section_data (sec)->relocs != relstart)
free (relstart);
return FALSE;
}
}
- if (local_syms != NULL
- && (elf_symtab_hdr (isec->owner).contents
- != (unsigned char *) local_syms))
+ if (elf_symtab_hdr (isec->owner).contents
+ != (unsigned char *) local_syms)
free (local_syms);
if (elf_section_data (isec)->relocs != relstart)
free (relstart);
if (elf_section_data (section)->relocs == NULL)
free (internal_relocs);
error_ret_free_local:
- if (local_syms != NULL
- && (symtab_hdr->contents
- != (unsigned char *) local_syms))
+ if (symtab_hdr->contents
+ != (unsigned char *) local_syms)
free (local_syms);
return FALSE;
}
if (!get_sym_h (NULL, &sym, &sym_sec, NULL, &local_syms,
lplt - local_plt, ibfd))
{
- if (local_syms != NULL
- && symtab_hdr->contents != (unsigned char *) local_syms)
+ if (symtab_hdr->contents != (unsigned char *) local_syms)
free (local_syms);
return FALSE;
}
reloc_name, sym_name, (int) r);
ret = FALSE;
}
- if (more_info != NULL)
- free (more_info);
+ free (more_info);
}
copy_reloc:
if (wrel != rel)
canon_reloc_count (asect) += relent - relents;
- if (allocated != NULL)
- free (allocated);
-
+ free (allocated);
return TRUE;
error_return:
- if (allocated != NULL)
- free (allocated);
+ free (allocated);
return FALSE;
}
if (contents != NULL)
{
(*process) (contents, i_shdr.sh_size, arg);
- if (free_contents != NULL)
- free (free_contents);
+ free (free_contents);
}
}
*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;
}
goto error_return;
}
- if (allocated != NULL)
- free (allocated);
+ free (allocated);
return TRUE;
error_return:
- if (allocated != NULL)
- free (allocated);
+ free (allocated);
return FALSE;
}
if (keep_memory)
esdo->relocs = internal_relocs;
- if (alloc1 != NULL)
- free (alloc1);
+ free (alloc1);
/* Don't free alloc2, since if it was allocated we are passing it
back (under the name of internal_relocs). */
return internal_relocs;
error_return:
- if (alloc1 != NULL)
- free (alloc1);
+ free (alloc1);
if (alloc2 != NULL)
{
if (keep_memory)
}
}
- if (extversym != NULL)
- {
- free (extversym);
- extversym = NULL;
- }
-
- if (isymbuf != NULL)
- {
- free (isymbuf);
- isymbuf = NULL;
- }
+ free (extversym);
+ extversym = NULL;
+ free (isymbuf);
+ isymbuf = NULL;
if ((elf_dyn_lib_class (abfd) & DYN_AS_NEEDED) != 0)
{
free (old_tab);
objalloc_free_block ((struct objalloc *) htab->root.table.memory,
alloc_mark);
- if (nondeflt_vers != NULL)
- free (nondeflt_vers);
+ free (nondeflt_vers);
return TRUE;
}
return TRUE;
error_free_vers:
- if (old_tab != NULL)
- free (old_tab);
- if (old_strtab != NULL)
- free (old_strtab);
- if (nondeflt_vers != NULL)
- free (nondeflt_vers);
- if (extversym != NULL)
- free (extversym);
+ free (old_tab);
+ free (old_strtab);
+ free (nondeflt_vers);
+ free (extversym);
error_free_sym:
- if (isymbuf != NULL)
- free (isymbuf);
+ free (isymbuf);
error_return:
return FALSE;
}
while (loop);
free (included);
-
return TRUE;
error_return:
- if (included != NULL)
- free (included);
+ free (included);
return FALSE;
}
later. */
h->u.elf_hash_value = ha;
- if (alc != NULL)
- free (alc);
-
+ free (alc);
return TRUE;
}
if (s->min_dynindx < 0 || s->min_dynindx > h->dynindx)
s->min_dynindx = h->dynindx;
- if (alc != NULL)
- free (alc);
-
+ free (alc);
return TRUE;
}
return TRUE;
error_return:
- if (dynbuf != NULL)
- free (dynbuf);
+ free (dynbuf);
return FALSE;
}
result = TRUE;
done:
- if (symtable1)
- free (symtable1);
- if (symtable2)
- free (symtable2);
- if (isymbuf1)
- free (isymbuf1);
- if (isymbuf2)
- free (isymbuf2);
+ free (symtable1);
+ free (symtable2);
+ free (isymbuf1);
+ free (isymbuf2);
return result;
}
if (flinfo->symstrtab != NULL)
_bfd_elf_strtab_free (flinfo->symstrtab);
- if (flinfo->contents != NULL)
- free (flinfo->contents);
- if (flinfo->external_relocs != NULL)
- free (flinfo->external_relocs);
- if (flinfo->internal_relocs != NULL)
- free (flinfo->internal_relocs);
- if (flinfo->external_syms != NULL)
- free (flinfo->external_syms);
- if (flinfo->locsym_shndx != NULL)
- free (flinfo->locsym_shndx);
- if (flinfo->internal_syms != NULL)
- free (flinfo->internal_syms);
- if (flinfo->indices != NULL)
- free (flinfo->indices);
- if (flinfo->sections != NULL)
- free (flinfo->sections);
- if (flinfo->symshndxbuf != NULL
- && flinfo->symshndxbuf != (Elf_External_Sym_Shndx *) -1)
+ free (flinfo->contents);
+ free (flinfo->external_relocs);
+ free (flinfo->internal_relocs);
+ free (flinfo->external_syms);
+ free (flinfo->locsym_shndx);
+ free (flinfo->internal_syms);
+ free (flinfo->indices);
+ free (flinfo->sections);
+ if (flinfo->symshndxbuf != (Elf_External_Sym_Shndx *) -1)
free (flinfo->symshndxbuf);
for (o = obfd->sections; o != NULL; o = o->next)
{
struct bfd_elf_section_data *esdo = elf_section_data (o);
- if ((o->flags & SEC_RELOC) != 0 && esdo->rel.hashes != NULL)
- free (esdo->rel.hashes);
- if ((o->flags & SEC_RELOC) != 0 && esdo->rela.hashes != NULL)
- free (esdo->rela.hashes);
+ free (esdo->rel.hashes);
+ free (esdo->rela.hashes);
}
}
if (!info->reduce_memory_overheads)
{
for (sub = info->input_bfds; sub != NULL; sub = sub->link.next)
- if (bfd_get_flavour (sub) == bfd_target_elf_flavour
- && elf_tdata (sub)->symbuf)
+ if (bfd_get_flavour (sub) == bfd_target_elf_flavour)
{
free (elf_tdata (sub)->symbuf);
elf_tdata (sub)->symbuf = NULL;
Elf_Internal_Shdr *symtab_hdr;
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
- if (cookie->locsyms != NULL
- && symtab_hdr->contents != (unsigned char *) cookie->locsyms)
+ if (symtab_hdr->contents != (unsigned char *) cookie->locsyms)
free (cookie->locsyms);
}
fini_reloc_cookie_rels (struct elf_reloc_cookie *cookie,
asection *sec)
{
- if (cookie->rels && elf_section_data (sec)->relocs != cookie->rels)
+ if (elf_section_data (sec)->relocs != cookie->rels)
free (cookie->rels);
}
return TRUE;
error_return:
- if (isymbuf != NULL && (unsigned char *) isymbuf != symtab_hdr->contents)
+ if ((unsigned char *) isymbuf != symtab_hdr->contents)
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;
}
struct elfNN_ia64_dyn_sym_info *dyn_i;
unsigned int count;
- if (dir->info)
- free (dir->info);
+ free (dir->info);
dir->info = ind->info;
dir->count = ind->count;
struct elfNN_ia64_link_hash_entry *entry
= (struct elfNN_ia64_link_hash_entry *) xentry;
- if (entry->info)
- {
- free (entry->info);
- entry->info = NULL;
- entry->count = 0;
- entry->sorted_count = 0;
- entry->size = 0;
- }
+ free (entry->info);
+ entry->info = NULL;
+ entry->count = 0;
+ entry->sorted_count = 0;
+ entry->size = 0;
return TRUE;
}
struct elfNN_ia64_local_hash_entry *entry
= (struct elfNN_ia64_local_hash_entry *) *slot;
- if (entry->info)
- {
- free (entry->info);
- entry->info = NULL;
- entry->count = 0;
- entry->sorted_count = 0;
- entry->size = 0;
- }
+ free (entry->info);
+ entry->info = NULL;
+ entry->count = 0;
+ entry->sorted_count = 0;
+ entry->size = 0;
return TRUE;
}
if (msg && r != bfd_reloc_dangerous)
info->callbacks->einfo (msg);
- /* Free the unused `msg_buf` if needed. */
- if (msg_buf)
- free (msg_buf);
+ /* Free the unused `msg_buf`. */
+ free (msg_buf);
/* We already reported the error via a callback, so don't try to report
it again by returning false. That leads to spurious errors. */
return TRUE;
error_return:
- if (ext_hdr != NULL)
- free (ext_hdr);
- 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->ssext != NULL)
- free (debug->ssext);
- if (debug->external_fdr != NULL)
- free (debug->external_fdr);
- if (debug->external_rfd != NULL)
- free (debug->external_rfd);
- if (debug->external_ext != NULL)
- free (debug->external_ext);
+ free (ext_hdr);
+ 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->ssext);
+ free (debug->external_fdr);
+ free (debug->external_rfd);
+ free (debug->external_ext);
return FALSE;
}
\f
matters, but someday it might). */
s->map_head.link_order = NULL;
- if (epdr != NULL)
- free (epdr);
- if (rpdr != NULL)
- free (rpdr);
- if (esym != NULL)
- free (esym);
- if (ss != NULL)
- free (ss);
- if (sv != NULL)
- free (sv);
-
+ free (epdr);
+ free (rpdr);
+ free (esym);
+ free (ss);
+ free (sv);
return TRUE;
error_return:
- if (epdr != NULL)
- free (epdr);
- if (rpdr != NULL)
- free (rpdr);
- if (esym != NULL)
- free (esym);
- if (ss != NULL)
- free (ss);
- if (sv != NULL)
- free (sv);
+ free (epdr);
+ free (rpdr);
+ free (esym);
+ free (ss);
+ free (sv);
return FALSE;
}
\f
}
}
}
- if (reloc_vector != NULL)
- free (reloc_vector);
+ free (reloc_vector);
return data;
error_return:
- if (reloc_vector != NULL)
- free (reloc_vector);
+ free (reloc_vector);
return NULL;
}
\f
}
}
- 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;
count = n;
for (j = 0; plts[j].name != NULL; j++)
- if (plts[j].contents != NULL)
- free (plts[j].contents);
+ free (plts[j].contents);
free (dynrelbuf);
if (abfd->direction == both_direction)
abfd->output_has_begun = TRUE;
- if (matching_vector)
- free (matching_vector);
+ free (matching_vector);
if (preserve_match.marker != NULL)
bfd_preserve_finish (abfd, &preserve_match);
bfd_preserve_finish (abfd, &preserve);
cleanup (abfd);
abfd->xvec = save_targ;
abfd->format = bfd_unknown;
- if (matching_vector)
- free (matching_vector);
+ free (matching_vector);
if (preserve_match.marker != NULL)
bfd_preserve_finish (abfd, &preserve_match);
bfd_preserve_restore (abfd, &preserve);
*(const char **) &matching_vector[match_count] = name;
}
}
- else if (matching_vector)
+ else
free (matching_vector);
if (cleanup)
cleanup (abfd);
/* An end record. */
if (abfd->start_address == 0)
abfd->start_address = addr;
- if (buf != NULL)
- free (buf);
+ free (buf);
return TRUE;
case 2:
if (error)
goto error_return;
- if (buf != NULL)
- free (buf);
-
+ free (buf);
return TRUE;
error_return:
- if (buf != NULL)
- free (buf);
+ free (buf);
return FALSE;
}
if ((bfd_size_type) (p - contents) >= section->size)
{
/* We've read everything in the section. */
- if (buf != NULL)
- free (buf);
+ free (buf);
return TRUE;
}
goto error_return;
}
- if (buf != NULL)
- free (buf);
-
+ free (buf);
return TRUE;
error_return:
- if (buf != NULL)
- free (buf);
+ free (buf);
return FALSE;
}
{
void *ret = bfd_realloc (ptr, size);
- if (ret == NULL && ptr != NULL)
+ if (ret == NULL)
free (ptr);
return ret;
new_contents, loc, input_section->size))
goto error_return;
- if (contents != NULL)
- free (contents);
+ free (contents);
return TRUE;
error_return:
- if (contents != NULL)
- free (contents);
+ free (contents);
return FALSE;
}
(_("%pB: duplicate section `%pA' has different contents\n"),
sec->owner, sec);
- if (sec_contents)
- free (sec_contents);
- if (l_sec_contents)
- free (l_sec_contents);
+ free (sec_contents);
+ free (l_sec_contents);
}
break;
}
/* Free whatever resources we took. */
for (i = 0; i < sizeof (file_names) / sizeof (file_names[0]); i++)
- if (file_names[i])
- free (file_names[i]);
+ free (file_names[i]);
return ! error;
}
if (!bfd_malloc_and_get_section (abfd, sect, &contents))
{
- if (contents != NULL)
- free (contents);
+ free (contents);
return NULL;
}
if (!bfd_malloc_and_get_section (abfd, sect, & contents))
{
- if (contents != NULL)
- free (contents);
+ free (contents);
return NULL;
}
if (!bfd_malloc_and_get_section (abfd, sect, & contents))
{
- if (contents != NULL)
- free (contents);
+ free (contents);
return NULL;
}
else
funclen = strlen (bfd_asymbol_name (func));
- if (adata (abfd).line_buf != NULL)
- free (adata (abfd).line_buf);
+ free (adata (abfd).line_buf);
if (filelen + funclen == 0)
adata (abfd).line_buf = buf = NULL;
else
if (bfd_get_format (abfd) != bfd_object)
return TRUE;
-#define BFCI_FREE(x) if (x != NULL) { free (x); x = NULL; }
+#define BFCI_FREE(x) do { free (x); x = NULL; } while (0)
BFCI_FREE (obj_aout_symbols (abfd));
#ifdef USE_MMAP
}
}
- if (aout_info.contents != NULL)
- {
- free (aout_info.contents);
- aout_info.contents = NULL;
- }
- if (aout_info.relocs != NULL)
- {
- free (aout_info.relocs);
- aout_info.relocs = NULL;
- }
- if (aout_info.symbol_map != NULL)
- {
- free (aout_info.symbol_map);
- aout_info.symbol_map = NULL;
- }
- if (aout_info.output_syms != NULL)
- {
- free (aout_info.output_syms);
- aout_info.output_syms = NULL;
- }
+ free (aout_info.contents);
+ aout_info.contents = NULL;
+ free (aout_info.relocs);
+ aout_info.relocs = NULL;
+ free (aout_info.symbol_map);
+ aout_info.symbol_map = NULL;
+ free (aout_info.output_syms);
+ aout_info.output_syms = NULL;
if (includes_hash_initialized)
{
bfd_hash_table_free (&aout_info.includes.root);
return TRUE;
error_return:
- if (aout_info.contents != NULL)
- free (aout_info.contents);
- if (aout_info.relocs != NULL)
- free (aout_info.relocs);
- if (aout_info.symbol_map != NULL)
- free (aout_info.symbol_map);
- if (aout_info.output_syms != NULL)
- free (aout_info.output_syms);
+ free (aout_info.contents);
+ free (aout_info.relocs);
+ free (aout_info.symbol_map);
+ free (aout_info.output_syms);
if (includes_hash_initialized)
bfd_hash_table_free (&aout_info.includes.root);
return FALSE;
if (!bfd_malloc_and_get_section (abfd, rel_section, &data))
{
- if (data != NULL)
- free (data);
+ free (data);
return FALSE;
}
if (offset >= rel_section->size || offset + 8 > rel_section->size)
{
- if (data != NULL)
- free (data);
+ free (data);
return FALSE;
}
/* xgettext:c-format */
_("\tcode-base %08lx toc (loadable/actual) %08lx/%08lx\n"),
start_address, loadable_toc_address, toc_address);
- if (data != NULL)
- free (data);
+ free (data);
}
else
{
/* Read the whole section. Some of the fields might be before dataoff. */
if (!bfd_malloc_and_get_section (abfd, section, &data))
{
- if (data != NULL)
- free (data);
+ free (data);
return FALSE;
}
if (! bfd_malloc_and_get_section (abfd, section, &data))
{
- if (data != NULL)
- free (data);
+ free (data);
return FALSE;
}
if (! bfd_malloc_and_get_section (abfd, section, &data))
{
- if (data != NULL)
- free (data);
+ free (data);
return FALSE;
}
if (! bfd_malloc_and_get_section (abfd, section, &data))
{
- if (data != NULL)
- free (data);
+ free (data);
return FALSE;
}
if (! bfd_malloc_and_get_section (abfd, section, & data))
{
- if (data != NULL)
- free (data);
+ free (data);
return FALSE;
}
/* Read the whole section. */
if (!bfd_malloc_and_get_section (abfd, section, &data))
{
- if (data != NULL)
- free (data);
+ free (data);
return FALSE;
}
if (!bfd_malloc_and_get_section (abfd, section, &data))
{
- if (data != NULL)
- free (data);
+ free (data);
return FALSE;
}
abfd->start_address = section->vma + header.main_offset;
end:
- if (loaderbuf != NULL)
- free (loaderbuf);
+ free (loaderbuf);
return 0;
error:
- if (loaderbuf != NULL)
- free (loaderbuf);
+ free (loaderbuf);
return -1;
}
goto end;
end:
- if (libraries != NULL)
- free (libraries);
- if (imports != NULL)
- free (imports);
+ free (libraries);
+ free (imports);
*nsym = count;
return 0;
error:
- if (libraries != NULL)
- free (libraries);
- if (imports != NULL)
- free (imports);
+ free (libraries);
+ free (imports);
*nsym = count;
return -1;
}
csym[count] = NULL;
end:
- if (codebuf != NULL)
- free (codebuf);
-
- if (loaderbuf != NULL)
- free (loaderbuf);
-
+ free (codebuf);
+ free (loaderbuf);
return count;
}
return TRUE;
error_return:
- if (vars.bim->buffer != NULL)
- free (vars.bim->buffer);
+ free (vars.bim->buffer);
free (vars.bim);
return FALSE;
}
/* Read the whole section. */
if (!bfd_malloc_and_get_section (abfd, section, &data))
{
- if (data != NULL)
- free (data);
+ free (data);
return;
}
* saved_offsets.section_count);
if (saved_offsets.sections == NULL)
{
- if (data)
- free (data);
+ free (data);
_bfd_generic_link_hash_table_free (abfd);
abfd->link.next = link_next;
return NULL;
outbuf,
0,
symbol_table);
- if (contents == NULL && data != NULL)
+ if (contents == NULL)
free (data);
bfd_map_over_sections (abfd, simple_restore_output_info, &saved_offsets);
for (i = 0; i < total_subspaces; i++)
subspace_sections[i]->target_index = i;
- if (space_strings != NULL)
- free (space_strings);
-
- if (subspace_sections != NULL)
- free (subspace_sections);
-
+ free (space_strings);
+ free (subspace_sections);
return TRUE;
error_return:
- if (space_strings != NULL)
- free (space_strings);
-
- if (subspace_sections != NULL)
- free (subspace_sections);
+ free (space_strings);
+ free (subspace_sections);
return FALSE;
}
if (bfd_bwrite ((void *) som_symtab, symtab_size, abfd) != symtab_size)
goto error_return;
- if (som_symtab != NULL)
- free (som_symtab);
+ free (som_symtab);
return TRUE;
+
error_return:
- if (som_symtab != NULL)
- free (som_symtab);
+ free (som_symtab);
return FALSE;
}
/* Save our results and return success. */
obj_som_symtab (abfd) = symbase;
successful_return:
- if (buf != NULL)
- free (buf);
+ free (buf);
return (TRUE);
error_return:
- if (symbase != NULL)
- free (symbase);
- if (buf != NULL)
- free (buf);
+ free (symbase);
+ free (buf);
return FALSE;
}
if (!bfd_malloc_and_get_section (section->owner, section,
&contents))
{
- if (contents != NULL)
- free (contents);
+ free (contents);
return (unsigned) -1;
}
section->contents = contents;
(*count)++;
}
}
- if (hash_table != NULL)
- free (hash_table);
+ free (hash_table);
return TRUE;
error_return:
- if (hash_table != NULL)
- free (hash_table);
+ free (hash_table);
return FALSE;
}
}
/* If we haven't died by now, then we successfully read the entire
archive symbol table. */
- if (hash_table != NULL)
- free (hash_table);
- if (som_dict != NULL)
- free (som_dict);
+ free (hash_table);
+ free (som_dict);
return TRUE;
error_return:
- if (hash_table != NULL)
- free (hash_table);
- if (som_dict != NULL)
- free (som_dict);
+ free (hash_table);
+ free (som_dict);
return FALSE;
}
if (bfd_bwrite ((void *) strings, amt, abfd) != amt)
goto error_return;
- if (hash_table != NULL)
- free (hash_table);
- if (som_dict != NULL)
- free (som_dict);
- if (last_hash_entry != NULL)
- free (last_hash_entry);
- if (lst_syms != NULL)
- free (lst_syms);
- if (strings != NULL)
- free (strings);
+ free (hash_table);
+ free (som_dict);
+ free (last_hash_entry);
+ free (lst_syms);
+ free (strings);
return TRUE;
error_return:
- if (hash_table != NULL)
- free (hash_table);
- if (som_dict != NULL)
- free (som_dict);
- if (last_hash_entry != NULL)
- free (last_hash_entry);
- if (lst_syms != NULL)
- free (lst_syms);
- if (strings != NULL)
- free (strings);
+ free (hash_table);
+ free (som_dict);
+ free (last_hash_entry);
+ free (lst_syms);
+ free (strings);
return FALSE;
}
{
asection *o;
-#define FREE(x) if (x != NULL) { free (x); x = NULL; }
+#define FREE(x) do { free (x); x = NULL; } while (0)
/* Free the native string and symbol tables. */
FREE (obj_som_symtab (abfd));
FREE (obj_som_stringtab (abfd));
if (bytes * 2 > bufsize)
{
- if (buf != NULL)
- free (buf);
+ free (buf);
buf = (bfd_byte *) bfd_malloc ((bfd_size_type) bytes * 2);
if (buf == NULL)
goto error_return;
goto error_return;
}
- if (buf != NULL)
- free (buf);
-
+ free (buf);
return TRUE;
}
}
if (error)
goto error_return;
- if (buf != NULL)
- free (buf);
-
+ free (buf);
return TRUE;
error_return:
- if (symbuf != NULL)
- free (symbuf);
- if (buf != NULL)
- free (buf);
+ free (symbuf);
+ free (buf);
return FALSE;
}
if (bytes * 2 > bufsize)
{
- if (buf != NULL)
- free (buf);
+ free (buf);
buf = (bfd_byte *) bfd_malloc ((bfd_size_type) bytes * 2);
if (buf == NULL)
goto error_return;
{
default:
BFD_ASSERT (sofar == section->size);
- if (buf != NULL)
- free (buf);
+ free (buf);
return TRUE;
case '3':
{
/* We've come to the end of this section. */
BFD_ASSERT (sofar == section->size);
- if (buf != NULL)
- free (buf);
+ free (buf);
return TRUE;
}
BFD_ASSERT (sofar == section->size);
- if (buf != NULL)
- free (buf);
-
+ free (buf);
return TRUE;
error_return:
- if (buf != NULL)
- free (buf);
+ free (buf);
return FALSE;
}
return TRUE;
error_return:
- if (stabbuf != NULL)
- free (stabbuf);
- if (stabstrbuf != NULL)
- free (stabstrbuf);
+ free (stabbuf);
+ free (stabstrbuf);
return FALSE;
}
\f
return skip > 0;
error_return:
- if (stabbuf != NULL)
- free (stabbuf);
+ free (stabbuf);
return FALSE;
}
error_return:
bfd_set_error (bfd_error_no_symbols);
- if (syms != NULL)
- free (syms);
+ free (syms);
return -1;
}
symbols);
if (reloc_count < 0)
{
- if (reloc_vector != NULL)
- free (reloc_vector);
+ free (reloc_vector);
return FALSE;
}
if (reloc_count > 0)
_bfd_error_handler
(_("unsupported .stab relocation"));
bfd_set_error (bfd_error_invalid_operation);
- if (reloc_vector != NULL)
- free (reloc_vector);
+ free (reloc_vector);
return FALSE;
}
}
}
- if (reloc_vector != NULL)
- free (reloc_vector);
+ free (reloc_vector);
/* First time through this function, build a table matching
function VM addresses to stabs, then sort based on starting
_bfd_find_arch_match (tname, arches, def_target_arch);
}
- if (arches)
- free (arches);
+ free (arches);
}
return target_vec;
}
{
if (storage > syms_max)
{
- if (syms_max > 0)
- free (syms);
+ free (syms);
syms_max = storage;
syms = (asymbol **) bfd_malloc (syms_max);
if (syms == NULL)
return TRUE;
error_return:
- if (syms_max > 0)
- free (syms);
- if (map != NULL)
- free (map);
+ free (syms);
+ free (map);
return FALSE;
}
if (! bfd_malloc_and_get_section (abfd, sec, &contents))
{
- if (contents != NULL)
- free (contents);
+ free (contents);
return FALSE;
}
coff_section_data (abfd, sec)->contents = contents;
/* If we are not keeping memory, free the reloc information. */
if (! info->keep_memory
&& coff_section_data (abfd, o) != NULL
- && coff_section_data (abfd, o)->relocs != NULL
&& ! coff_section_data (abfd, o)->keep_relocs)
{
free (coff_section_data (abfd, o)->relocs);
/* Free up the line numbers. FIXME: We could cache these
somewhere for the final link, to avoid reading them again. */
- if (reloc_info[o->target_index].linenos != NULL)
- {
- free (reloc_info[o->target_index].linenos);
- reloc_info[o->target_index].linenos = NULL;
- }
+ free (reloc_info[o->target_index].linenos);
+ reloc_info[o->target_index].linenos = NULL;
}
free (reloc_info);
{
for (o = abfd->sections; o != NULL; o = o->next)
{
- if (reloc_info[o->target_index].csects != NULL)
- free (reloc_info[o->target_index].csects);
- if (reloc_info[o->target_index].linenos != NULL)
- free (reloc_info[o->target_index].linenos);
+ free (reloc_info[o->target_index].csects);
+ free (reloc_info[o->target_index].linenos);
}
free (reloc_info);
}
if (! info->keep_memory
&& coff_section_data (sec->owner, sec) != NULL
- && coff_section_data (sec->owner, sec)->relocs != NULL
&& ! coff_section_data (sec->owner, sec)->keep_relocs)
{
free (coff_section_data (sec->owner, sec)->relocs);
return TRUE;
error_return:
- if (ldinfo.strings != NULL)
- free (ldinfo.strings);
- if (debug_contents != NULL)
- free (debug_contents);
+ free (ldinfo.strings);
+ free (debug_contents);
return FALSE;
}
}
/* Free up the buffers used by xcoff_link_input_bfd. */
- if (flinfo.internal_syms != NULL)
- {
- free (flinfo.internal_syms);
- flinfo.internal_syms = NULL;
- }
- if (flinfo.sym_indices != NULL)
- {
- free (flinfo.sym_indices);
- flinfo.sym_indices = NULL;
- }
- if (flinfo.linenos != NULL)
- {
- free (flinfo.linenos);
- flinfo.linenos = NULL;
- }
- if (flinfo.contents != NULL)
- {
- free (flinfo.contents);
- flinfo.contents = NULL;
- }
- if (flinfo.external_relocs != NULL)
- {
- free (flinfo.external_relocs);
- flinfo.external_relocs = NULL;
- }
+ free (flinfo.internal_syms);
+ flinfo.internal_syms = NULL;
+ free (flinfo.sym_indices);
+ flinfo.sym_indices = NULL;
+ free (flinfo.linenos);
+ flinfo.linenos = NULL;
+ free (flinfo.contents);
+ flinfo.contents = NULL;
+ free (flinfo.external_relocs);
+ flinfo.external_relocs = NULL;
/* The value of the last C_FILE symbol is supposed to be -1. Write
it out again. */
input files. */
bfd_hash_traverse (&info->hash->table, xcoff_write_global_symbol, &flinfo);
- if (flinfo.outsyms != NULL)
- {
- free (flinfo.outsyms);
- flinfo.outsyms = NULL;
- }
+ free (flinfo.outsyms);
+ flinfo.outsyms = NULL;
/* Now that we have written out all the global symbols, we know the
symbol indices to use for relocs against them, and we can finally
goto error_return;
}
- if (external_relocs != NULL)
- {
- free (external_relocs);
- external_relocs = NULL;
- }
+ free (external_relocs);
+ external_relocs = NULL;
/* Free up the section information. */
if (flinfo.section_info != NULL)
for (i = 0; i < abfd->section_count; i++)
{
- if (flinfo.section_info[i].relocs != NULL)
- free (flinfo.section_info[i].relocs);
- if (flinfo.section_info[i].rel_hashes != NULL)
- free (flinfo.section_info[i].rel_hashes);
+ free (flinfo.section_info[i].relocs);
+ free (flinfo.section_info[i].rel_hashes);
}
free (flinfo.section_info);
flinfo.section_info = NULL;
for (i = 0; i < abfd->section_count; i++)
{
- if (flinfo.section_info[i].relocs != NULL)
- free (flinfo.section_info[i].relocs);
- if (flinfo.section_info[i].rel_hashes != NULL)
- free (flinfo.section_info[i].rel_hashes);
+ free (flinfo.section_info[i].relocs);
+ free (flinfo.section_info[i].rel_hashes);
}
free (flinfo.section_info);
}
- if (flinfo.internal_syms != NULL)
- free (flinfo.internal_syms);
- if (flinfo.sym_indices != NULL)
- free (flinfo.sym_indices);
- if (flinfo.outsyms != NULL)
- free (flinfo.outsyms);
- if (flinfo.linenos != NULL)
- free (flinfo.linenos);
- if (flinfo.contents != NULL)
- free (flinfo.contents);
- if (flinfo.external_relocs != NULL)
- free (flinfo.external_relocs);
- if (external_relocs != NULL)
- free (external_relocs);
+ free (flinfo.internal_syms);
+ free (flinfo.sym_indices);
+ free (flinfo.outsyms);
+ free (flinfo.linenos);
+ free (flinfo.contents);
+ free (flinfo.external_relocs);
+ free (external_relocs);
return FALSE;
}
the memory allocated by xtensa_isa_init and restore the xtensa_isa
structure to its initial state. */
- if (intisa->opname_lookup_table)
- {
- free (intisa->opname_lookup_table);
- intisa->opname_lookup_table = 0;
- }
+ free (intisa->opname_lookup_table);
+ intisa->opname_lookup_table = 0;
- if (intisa->state_lookup_table)
- {
- free (intisa->state_lookup_table);
- intisa->state_lookup_table = 0;
- }
+ free (intisa->state_lookup_table);
+ intisa->state_lookup_table = 0;
+
+ free (intisa->sysreg_lookup_table);
+ intisa->sysreg_lookup_table = 0;
- if (intisa->sysreg_lookup_table)
- {
- free (intisa->sysreg_lookup_table);
- intisa->sysreg_lookup_table = 0;
- }
for (n = 0; n < 2; n++)
{
- if (intisa->sysreg_table[n])
- {
- free (intisa->sysreg_table[n]);
- intisa->sysreg_table[n] = 0;
- }
+ free (intisa->sysreg_table[n]);
+ intisa->sysreg_table[n] = 0;
}
- if (intisa->interface_lookup_table)
- {
- free (intisa->interface_lookup_table);
- intisa->interface_lookup_table = 0;
- }
+ free (intisa->interface_lookup_table);
+ intisa->interface_lookup_table = 0;
- if (intisa->funcUnit_lookup_table)
- {
- free (intisa->funcUnit_lookup_table);
- intisa->funcUnit_lookup_table = 0;
- }
+ free (intisa->funcUnit_lookup_table);
+ intisa->funcUnit_lookup_table = 0;
}