bfd *input_bfd;
asection *section, *stub_sec;
Elf_Internal_Shdr *symtab_hdr;
- Elf_Internal_Sym *local_syms, *isym;
+ Elf_Internal_Sym *local_syms, *isym, **all_local_syms;
Elf32_External_Sym *ext_syms, *esym;
- unsigned int bfd_count = 0;
+ unsigned int i, index, bfd_count = 0;
struct elf32_hppa_stub_hash_table *stub_hash_table = 0;
struct elf32_hppa_args_hash_table *args_hash_table = 0;
/* Walk over all the input BFDs adding entries to the args hash table
for all the external functions. */
- for (input_bfd = link_info->input_bfds, i = 0;
+ for (input_bfd = link_info->input_bfds, index = 0;
input_bfd != NULL;
- input_bfd = input_bfd->link_next, i++)
+ input_bfd = input_bfd->link_next, index++)
{
/* We'll need the symbol table in a second. */
symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
{
bfd_set_error (bfd_error_no_memory);
for (i = 0; i < bfd_count; i++)
- if (all_local_symbols[i])
- free (all_local_symbols[i]);
- free (all_local_symbols);
+ if (all_local_syms[i])
+ free (all_local_syms[i]);
+ free (all_local_syms);
goto error_return;
}
- all_local_symbols[i] = local_syms;
+ all_local_syms[index] = local_syms;
ext_syms
= (Elf32_External_Sym *)malloc (symtab_hdr->sh_info
{
bfd_set_error (bfd_error_no_memory);
for (i = 0; i < bfd_count; i++)
- if (all_local_symbols[i])
- free (all_local_symbols[i]);
- free (all_local_symbols);
+ if (all_local_syms[i])
+ free (all_local_syms[i]);
+ free (all_local_syms);
goto error_return;
}
!= (symtab_hdr->sh_info * sizeof (Elf32_External_Sym)))
{
for (i = 0; i < bfd_count; i++)
- if (all_local_symbols[i])
- free (all_local_symbols[i]);
- free (all_local_symbols);
+ if (all_local_syms[i])
+ free (all_local_syms[i]);
+ free (all_local_syms);
free (ext_syms);
goto error_return;
}
local_syms) == false)
{
for (i = 0; i < bfd_count; i++)
- if (all_local_symbols[i])
- free (all_local_symbols[i]);
- free (all_local_symbols);
+ if (all_local_syms[i])
+ free (all_local_syms[i]);
+ free (all_local_syms);
goto error_return;
}
}
if (link_info->relocateable)
{
for (i = 0; i < bfd_count; i++)
- if (all_local_symbols[i])
- free (all_local_symbols[i]);
- free (all_local_symbols);
+ if (all_local_syms[i])
+ free (all_local_syms[i]);
+ free (all_local_syms);
return true;
}
/* Now that we have argument location information for all the global
functions we can start looking for stubs. */
- for (input_bfd = link_info->input_bfds, i = 0;
+ for (input_bfd = link_info->input_bfds, index = 0;
input_bfd != NULL;
- input_bfd = input_bfd->link_next, i++)
+ input_bfd = input_bfd->link_next, index++)
{
- unsigned int i;
-
/* We'll need the symbol table in a second. */
symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
if (symtab_hdr->sh_info == 0)
continue;
- local_syms = all_local_symbols[i];
+ local_syms = all_local_syms[index];
/* Walk over each section attached to the input bfd. */
for (section = input_bfd->sections;
{
bfd_set_error (bfd_error_no_memory);
for (i = 0; i < bfd_count; i++)
- if (all_local_symbols[i])
- free (all_local_symbols[i]);
- free (all_local_symbols);
+ if (all_local_syms[i])
+ free (all_local_syms[i]);
+ free (all_local_syms);
goto error_return;
}
bfd_set_error (bfd_error_no_memory);
free (external_relocs);
for (i = 0; i < bfd_count; i++)
- if (all_local_symbols[i])
- free (all_local_symbols[i]);
- free (all_local_symbols);
+ if (all_local_syms[i])
+ free (all_local_syms[i]);
+ free (all_local_syms);
goto error_return;
}
free (external_relocs);
free (internal_relocs);
for (i = 0; i < bfd_count; i++)
- if (all_local_symbols[i])
- free (all_local_symbols[i]);
- free (all_local_symbols);
+ if (all_local_syms[i])
+ free (all_local_syms[i]);
+ free (all_local_syms);
goto error_return;
}
bfd_set_error (bfd_error_bad_value);
free (internal_relocs);
for (i = 0; i < bfd_count; i++)
- if (all_local_symbols[i])
- free (all_local_symbols[i]);
- free (all_local_symbols);
+ if (all_local_syms[i])
+ free (all_local_syms[i]);
+ free (all_local_syms);
goto error_return;
}
bfd_set_error (bfd_error_bad_value);
free (internal_relocs);
for (i = 0; i < bfd_count; i++)
- if (all_local_symbols[i])
- free (all_local_symbols[i]);
- free (all_local_symbols);
+ if (all_local_syms[i])
+ free (all_local_syms[i]);
+ free (all_local_syms);
goto error_return;
}
sprintf (new_name, "%s_%08x", sym_name, (int)sym_sec);
bfd_set_error (bfd_error_bad_value);
free (internal_relocs);
for (i = 0; i < bfd_count; i++)
- if (all_local_symbols[i])
- free (all_local_symbols[i]);
- free (all_local_symbols);
+ if (all_local_syms[i])
+ free (all_local_syms[i]);
+ free (all_local_syms);
goto error_return;
}
}
free (internal_relocs);
for (i = 0; i < bfd_count; i++)
- if (all_local_symbols[i])
- free (all_local_symbols[i]);
- free (all_local_symbols);
+ if (all_local_syms[i])
+ free (all_local_syms[i]);
+ free (all_local_syms);
goto error_return;
}
elf32_hppa_name_of_stub (caller_args, callee_args,
free (stub_name);
free (internal_relocs);
for (i = 0; i < bfd_count; i++)
- if (all_local_symbols[i])
- free (all_local_symbols[i]);
- free (all_local_symbols);
+ if (all_local_syms[i])
+ free (all_local_syms[i]);
+ free (all_local_syms);
goto error_return;
}
/* We're done with the internal relocs, free them. */
free (internal_relocs);
}
- /* We're done with the local symbols, free them. */
- for (i = 0; i < bfd_count; i++)
- if (all_local_symbols[i])
- free (all_local_symbols[i]);
- free (all_local_symbols);
}
+ /* We're done with the local symbols, free them. */
+ for (i = 0; i < bfd_count; i++)
+ if (all_local_syms[i])
+ free (all_local_syms[i]);
+ free (all_local_syms);
return true;
error_return: