Don't use bfd_get_* macro to set bfd fields
* aoutx.h (slurp_symbol_table): Don't set symcount using bfd_get macros. * pdp11.c (slurp_symbol_table): Likewise. * som.c (som_slurp_symbol_table): Likewise. * coff-ppc.c (ppc_bfd_coff_final_link): Likewise. * coffcode.h (coff_slurp_symbol_table): Likewise. * cofflink.c (_bfd_coff_final_link): Likewise. * ecoff.c (ecoff_slurp_symbolic_header): Likewise. (_bfd_ecoff_slurp_symbolic_info): Likewise. (_bfd_ecoff_slurp_symbol_table): Likewise. (_bfd_ecoff_bfd_final_link): Likewise. * elf.c (_bfd_elf_canonicalize_symtab): Likewise. * elflink.c (elf_link_output_symstrtab): Likewise. (bfd_elf_final_link): Likewise. * peicode.h (pe_ILF_build_a_bfd): Likewise. * xcofflink.c (_bfd_xcoff_bfd_final_link): Likewise. * aoutx.h (some_aout_object_p, slurp_symbol_table): Don't set start_address or symcount using bfd_get macros. * coffgen.c (coff_real_object_p): Likewise. * pdp11.c (some_aout_object_p, slurp_symbol_table): Likewise. * som.c (som_object_setup, som_slurp_symbol_table): Likewise. * elfcore.h (elf_core_file_p): Don't set start_address using bfd_get macro. * elf.c (_bfd_elf_canonicalize_dynamic_symtab): Don't set dynsymcount using bfd_get macro. * bfd.c (bfd_set_file_flags): Don't set flags using bfd_get macro. * linker.c (bfd_generic_link_read_symbols): Don't set outsymbols or symcount using bfd_get macros. (_bfd_generic_final_link, generic_add_output_symbol): Likewise. * syms.c (bfd_set_symtab): Likewise. * vms-alpha.c (alpha_vms_bfd_final_link): Likewise. * archive.c (do_slurp_bsd_armap): Don't set has_armap using bfd_has_map macro. (do_slurp_coff_armap, bfd_slurp_armap): Likewise. * archive64.c (_bfd_archive_64_bit_slurp_armap): Likewise. * coff-rs6000.c (_bfd_xcoff_slurp_armap): Likewise. * coff64-rs6000.c (xcoff64_slurp_armap): Likewise. * ecoff.c (_bfd_ecoff_slurp_armap): Likewise. * som.c (som_slurp_armap): Likewise.
This commit is contained in:
parent
01c2b26160
commit
ed48ec2e6e
22 changed files with 103 additions and 63 deletions
|
@ -1,3 +1,45 @@
|
||||||
|
2019-09-18 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
|
* aoutx.h (slurp_symbol_table): Don't set symcount using bfd_get
|
||||||
|
macros.
|
||||||
|
* pdp11.c (slurp_symbol_table): Likewise.
|
||||||
|
* som.c (som_slurp_symbol_table): Likewise.
|
||||||
|
* coff-ppc.c (ppc_bfd_coff_final_link): Likewise.
|
||||||
|
* coffcode.h (coff_slurp_symbol_table): Likewise.
|
||||||
|
* cofflink.c (_bfd_coff_final_link): Likewise.
|
||||||
|
* ecoff.c (ecoff_slurp_symbolic_header): Likewise.
|
||||||
|
(_bfd_ecoff_slurp_symbolic_info): Likewise.
|
||||||
|
(_bfd_ecoff_slurp_symbol_table): Likewise.
|
||||||
|
(_bfd_ecoff_bfd_final_link): Likewise.
|
||||||
|
* elf.c (_bfd_elf_canonicalize_symtab): Likewise.
|
||||||
|
* elflink.c (elf_link_output_symstrtab): Likewise.
|
||||||
|
(bfd_elf_final_link): Likewise.
|
||||||
|
* peicode.h (pe_ILF_build_a_bfd): Likewise.
|
||||||
|
* xcofflink.c (_bfd_xcoff_bfd_final_link): Likewise.
|
||||||
|
* aoutx.h (some_aout_object_p, slurp_symbol_table): Don't set
|
||||||
|
start_address or symcount using bfd_get macros.
|
||||||
|
* coffgen.c (coff_real_object_p): Likewise.
|
||||||
|
* pdp11.c (some_aout_object_p, slurp_symbol_table): Likewise.
|
||||||
|
* som.c (som_object_setup, som_slurp_symbol_table): Likewise.
|
||||||
|
* elfcore.h (elf_core_file_p): Don't set start_address using
|
||||||
|
bfd_get macro.
|
||||||
|
* elf.c (_bfd_elf_canonicalize_dynamic_symtab): Don't set dynsymcount
|
||||||
|
using bfd_get macro.
|
||||||
|
* bfd.c (bfd_set_file_flags): Don't set flags using bfd_get macro.
|
||||||
|
* linker.c (bfd_generic_link_read_symbols): Don't set outsymbols
|
||||||
|
or symcount using bfd_get macros.
|
||||||
|
(_bfd_generic_final_link, generic_add_output_symbol): Likewise.
|
||||||
|
* syms.c (bfd_set_symtab): Likewise.
|
||||||
|
* vms-alpha.c (alpha_vms_bfd_final_link): Likewise.
|
||||||
|
* archive.c (do_slurp_bsd_armap): Don't set has_armap using
|
||||||
|
bfd_has_map macro.
|
||||||
|
(do_slurp_coff_armap, bfd_slurp_armap): Likewise.
|
||||||
|
* archive64.c (_bfd_archive_64_bit_slurp_armap): Likewise.
|
||||||
|
* coff-rs6000.c (_bfd_xcoff_slurp_armap): Likewise.
|
||||||
|
* coff64-rs6000.c (xcoff64_slurp_armap): Likewise.
|
||||||
|
* ecoff.c (_bfd_ecoff_slurp_armap): Likewise.
|
||||||
|
* som.c (som_slurp_armap): Likewise.
|
||||||
|
|
||||||
2019-09-18 Alan Modra <amodra@gmail.com>
|
2019-09-18 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
* archures.c (bfd_get_arch): Make param const.
|
* archures.c (bfd_get_arch): Make param const.
|
||||||
|
|
|
@ -511,10 +511,10 @@ NAME (aout, some_aout_object_p) (bfd *abfd,
|
||||||
was called. */
|
was called. */
|
||||||
abort ();
|
abort ();
|
||||||
|
|
||||||
bfd_get_start_address (abfd) = execp->a_entry;
|
abfd->start_address = execp->a_entry;
|
||||||
|
|
||||||
obj_aout_symbols (abfd) = NULL;
|
obj_aout_symbols (abfd) = NULL;
|
||||||
bfd_get_symcount (abfd) = execp->a_syms / sizeof (struct external_nlist);
|
abfd->symcount = execp->a_syms / sizeof (struct external_nlist);
|
||||||
|
|
||||||
/* The default relocation entry size is that of traditional V7 Unix. */
|
/* The default relocation entry size is that of traditional V7 Unix. */
|
||||||
obj_reloc_entry_size (abfd) = RELOC_STD_SIZE;
|
obj_reloc_entry_size (abfd) = RELOC_STD_SIZE;
|
||||||
|
@ -1782,7 +1782,7 @@ NAME (aout, slurp_symbol_table) (bfd *abfd)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bfd_get_symcount (abfd) = obj_aout_external_sym_count (abfd);
|
abfd->symcount = obj_aout_external_sym_count (abfd);
|
||||||
|
|
||||||
obj_aout_symbols (abfd) = cached;
|
obj_aout_symbols (abfd) = cached;
|
||||||
|
|
||||||
|
|
|
@ -1013,7 +1013,7 @@ do_slurp_bsd_armap (bfd *abfd)
|
||||||
/* FIXME, we should provide some way to free raw_ardata when
|
/* FIXME, we should provide some way to free raw_ardata when
|
||||||
we are done using the strings from it. For now, it seems
|
we are done using the strings from it. For now, it seems
|
||||||
to be allocated on an objalloc anyway... */
|
to be allocated on an objalloc anyway... */
|
||||||
bfd_has_map (abfd) = TRUE;
|
abfd->has_armap = TRUE;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1105,7 +1105,7 @@ do_slurp_coff_armap (bfd *abfd)
|
||||||
/* Pad to an even boundary if you have to. */
|
/* Pad to an even boundary if you have to. */
|
||||||
ardata->first_file_filepos += (ardata->first_file_filepos) % 2;
|
ardata->first_file_filepos += (ardata->first_file_filepos) % 2;
|
||||||
|
|
||||||
bfd_has_map (abfd) = TRUE;
|
abfd->has_armap = TRUE;
|
||||||
bfd_release (abfd, raw_armap);
|
bfd_release (abfd, raw_armap);
|
||||||
|
|
||||||
/* Check for a second archive header (as used by PE). */
|
/* Check for a second archive header (as used by PE). */
|
||||||
|
@ -1188,7 +1188,7 @@ bfd_slurp_armap (bfd *abfd)
|
||||||
return do_slurp_bsd_armap (abfd);
|
return do_slurp_bsd_armap (abfd);
|
||||||
}
|
}
|
||||||
|
|
||||||
bfd_has_map (abfd) = FALSE;
|
abfd->has_armap = FALSE;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,7 @@ _bfd_archive_64_bit_slurp_armap (bfd *abfd)
|
||||||
|
|
||||||
if (! CONST_STRNEQ (nextname, "/SYM64/ "))
|
if (! CONST_STRNEQ (nextname, "/SYM64/ "))
|
||||||
{
|
{
|
||||||
bfd_has_map (abfd) = FALSE;
|
abfd->has_armap = FALSE;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -137,7 +137,7 @@ _bfd_archive_64_bit_slurp_armap (bfd *abfd)
|
||||||
/* Pad to an even boundary if you have to. */
|
/* Pad to an even boundary if you have to. */
|
||||||
ardata->first_file_filepos += (ardata->first_file_filepos) % 2;
|
ardata->first_file_filepos += (ardata->first_file_filepos) % 2;
|
||||||
|
|
||||||
bfd_has_map (abfd) = TRUE;
|
abfd->has_armap = TRUE;
|
||||||
bfd_release (abfd, raw_armap);
|
bfd_release (abfd, raw_armap);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
|
@ -1418,7 +1418,7 @@ bfd_set_file_flags (bfd *abfd, flagword flags)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bfd_get_file_flags (abfd) = flags;
|
abfd->flags = flags;
|
||||||
if ((flags & bfd_applicable_file_flags (abfd)) != flags)
|
if ((flags & bfd_applicable_file_flags (abfd)) != flags)
|
||||||
{
|
{
|
||||||
bfd_set_error (bfd_error_invalid_operation);
|
bfd_set_error (bfd_error_invalid_operation);
|
||||||
|
|
|
@ -2420,9 +2420,9 @@ ppc_bfd_coff_final_link (bfd *abfd, struct bfd_link_info *info)
|
||||||
|
|
||||||
_bfd_stringtab_free (flaginfo.strtab);
|
_bfd_stringtab_free (flaginfo.strtab);
|
||||||
|
|
||||||
/* Setting bfd_get_symcount to 0 will cause write_object_contents to
|
/* Setting symcount to 0 will cause write_object_contents to
|
||||||
not try to write out the symbols. */
|
not try to write out the symbols. */
|
||||||
bfd_get_symcount (abfd) = 0;
|
abfd->symcount = 0;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
|
|
|
@ -1243,7 +1243,7 @@ _bfd_xcoff_slurp_armap (bfd *abfd)
|
||||||
|
|
||||||
if (xcoff_ardata (abfd) == NULL)
|
if (xcoff_ardata (abfd) == NULL)
|
||||||
{
|
{
|
||||||
bfd_has_map (abfd) = FALSE;
|
abfd->has_armap = FALSE;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1255,7 +1255,7 @@ _bfd_xcoff_slurp_armap (bfd *abfd)
|
||||||
GET_VALUE_IN_FIELD (off, xcoff_ardata (abfd)->symoff, 10);
|
GET_VALUE_IN_FIELD (off, xcoff_ardata (abfd)->symoff, 10);
|
||||||
if (off == 0)
|
if (off == 0)
|
||||||
{
|
{
|
||||||
bfd_has_map (abfd) = FALSE;
|
abfd->has_armap = FALSE;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1310,7 +1310,7 @@ _bfd_xcoff_slurp_armap (bfd *abfd)
|
||||||
GET_VALUE_IN_FIELD (off, xcoff_ardata_big (abfd)->symoff, 10);
|
GET_VALUE_IN_FIELD (off, xcoff_ardata_big (abfd)->symoff, 10);
|
||||||
if (off == 0)
|
if (off == 0)
|
||||||
{
|
{
|
||||||
bfd_has_map (abfd) = FALSE;
|
abfd->has_armap = FALSE;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1373,7 +1373,7 @@ _bfd_xcoff_slurp_armap (bfd *abfd)
|
||||||
}
|
}
|
||||||
|
|
||||||
bfd_ardata (abfd)->symdef_count = c;
|
bfd_ardata (abfd)->symdef_count = c;
|
||||||
bfd_has_map (abfd) = TRUE;
|
abfd->has_armap = TRUE;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1906,7 +1906,7 @@ xcoff64_slurp_armap (bfd *abfd)
|
||||||
|
|
||||||
if (xcoff_ardata (abfd) == NULL)
|
if (xcoff_ardata (abfd) == NULL)
|
||||||
{
|
{
|
||||||
bfd_has_map (abfd) = FALSE;
|
abfd->has_armap = FALSE;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1914,7 +1914,7 @@ xcoff64_slurp_armap (bfd *abfd)
|
||||||
(const char **) NULL, 10);
|
(const char **) NULL, 10);
|
||||||
if (off == 0)
|
if (off == 0)
|
||||||
{
|
{
|
||||||
bfd_has_map (abfd) = FALSE;
|
abfd->has_armap = FALSE;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1976,7 +1976,7 @@ xcoff64_slurp_armap (bfd *abfd)
|
||||||
}
|
}
|
||||||
|
|
||||||
bfd_ardata (abfd)->symdef_count = c;
|
bfd_ardata (abfd)->symdef_count = c;
|
||||||
bfd_has_map (abfd) = TRUE;
|
abfd->has_armap = TRUE;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4809,7 +4809,7 @@ coff_slurp_symbol_table (bfd * abfd)
|
||||||
obj_symbols (abfd) = cached_area;
|
obj_symbols (abfd) = cached_area;
|
||||||
obj_raw_syments (abfd) = native_symbols;
|
obj_raw_syments (abfd) = native_symbols;
|
||||||
|
|
||||||
bfd_get_symcount (abfd) = number_of_symbols;
|
abfd->symcount = number_of_symbols;
|
||||||
obj_convert (abfd) = table_ptr;
|
obj_convert (abfd) = table_ptr;
|
||||||
/* Slurp the line tables for each section too. */
|
/* Slurp the line tables for each section too. */
|
||||||
{
|
{
|
||||||
|
|
|
@ -257,14 +257,14 @@ coff_real_object_p (bfd *abfd,
|
||||||
if ((internal_f->f_flags & F_EXEC) != 0)
|
if ((internal_f->f_flags & F_EXEC) != 0)
|
||||||
abfd->flags |= D_PAGED;
|
abfd->flags |= D_PAGED;
|
||||||
|
|
||||||
bfd_get_symcount (abfd) = internal_f->f_nsyms;
|
abfd->symcount = internal_f->f_nsyms;
|
||||||
if (internal_f->f_nsyms)
|
if (internal_f->f_nsyms)
|
||||||
abfd->flags |= HAS_SYMS;
|
abfd->flags |= HAS_SYMS;
|
||||||
|
|
||||||
if (internal_a != (struct internal_aouthdr *) NULL)
|
if (internal_a != (struct internal_aouthdr *) NULL)
|
||||||
bfd_get_start_address (abfd) = internal_a->entry;
|
abfd->start_address = internal_a->entry;
|
||||||
else
|
else
|
||||||
bfd_get_start_address (abfd) = 0;
|
abfd->start_address = 0;
|
||||||
|
|
||||||
/* Set up the tdata area. ECOFF uses its own routine, and overrides
|
/* Set up the tdata area. ECOFF uses its own routine, and overrides
|
||||||
abfd->flags. */
|
abfd->flags. */
|
||||||
|
@ -309,7 +309,7 @@ coff_real_object_p (bfd *abfd,
|
||||||
fail2:
|
fail2:
|
||||||
abfd->tdata.any = tdata_save;
|
abfd->tdata.any = tdata_save;
|
||||||
abfd->flags = oflags;
|
abfd->flags = oflags;
|
||||||
bfd_get_start_address (abfd) = ostart;
|
abfd->start_address = ostart;
|
||||||
return (const bfd_target *) NULL;
|
return (const bfd_target *) NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1186,9 +1186,9 @@ _bfd_coff_final_link (bfd *abfd,
|
||||||
|
|
||||||
_bfd_stringtab_free (flaginfo.strtab);
|
_bfd_stringtab_free (flaginfo.strtab);
|
||||||
|
|
||||||
/* Setting bfd_get_symcount to 0 will cause write_object_contents to
|
/* Setting symcount to 0 will cause write_object_contents to
|
||||||
not try to write out the symbols. */
|
not try to write out the symbols. */
|
||||||
bfd_get_symcount (abfd) = 0;
|
abfd->symcount = 0;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
|
|
15
bfd/ecoff.c
15
bfd/ecoff.c
|
@ -446,7 +446,7 @@ ecoff_slurp_symbolic_header (bfd *abfd)
|
||||||
/* See whether there is a symbolic header. */
|
/* See whether there is a symbolic header. */
|
||||||
if (ecoff_data (abfd)->sym_filepos == 0)
|
if (ecoff_data (abfd)->sym_filepos == 0)
|
||||||
{
|
{
|
||||||
bfd_get_symcount (abfd) = 0;
|
abfd->symcount = 0;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -479,8 +479,7 @@ ecoff_slurp_symbolic_header (bfd *abfd)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Now we can get the correct number of symbols. */
|
/* Now we can get the correct number of symbols. */
|
||||||
bfd_get_symcount (abfd) = (internal_symhdr->isymMax
|
abfd->symcount = internal_symhdr->isymMax + internal_symhdr->iextMax;
|
||||||
+ internal_symhdr->iextMax);
|
|
||||||
|
|
||||||
if (raw != NULL)
|
if (raw != NULL)
|
||||||
free (raw);
|
free (raw);
|
||||||
|
@ -521,7 +520,7 @@ _bfd_ecoff_slurp_symbolic_info (bfd *abfd,
|
||||||
return TRUE;
|
return TRUE;
|
||||||
if (ecoff_data (abfd)->sym_filepos == 0)
|
if (ecoff_data (abfd)->sym_filepos == 0)
|
||||||
{
|
{
|
||||||
bfd_get_symcount (abfd) = 0;
|
abfd->symcount = 0;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -965,7 +964,7 @@ _bfd_ecoff_slurp_symbol_table (bfd *abfd)
|
||||||
the symbol count and warning the user. */
|
the symbol count and warning the user. */
|
||||||
if (internal_ptr - internal < (ptrdiff_t) bfd_get_symcount (abfd))
|
if (internal_ptr - internal < (ptrdiff_t) bfd_get_symcount (abfd))
|
||||||
{
|
{
|
||||||
bfd_get_symcount (abfd) = internal_ptr - internal;
|
abfd->symcount = internal_ptr - internal;
|
||||||
_bfd_error_handler
|
_bfd_error_handler
|
||||||
/* xgettext:c-format */
|
/* xgettext:c-format */
|
||||||
(_("%pB: warning: isymMax (%ld) is greater than ifdMax (%ld)"),
|
(_("%pB: warning: isymMax (%ld) is greater than ifdMax (%ld)"),
|
||||||
|
@ -2905,7 +2904,7 @@ _bfd_ecoff_slurp_armap (bfd *abfd)
|
||||||
&& nextname[ARMAP_OBJECT_ENDIAN_INDEX] != ARMAP_LITTLE_ENDIAN)
|
&& nextname[ARMAP_OBJECT_ENDIAN_INDEX] != ARMAP_LITTLE_ENDIAN)
|
||||||
|| ! strneq (nextname + ARMAP_END_INDEX, ARMAP_END, sizeof ARMAP_END - 1))
|
|| ! strneq (nextname + ARMAP_END_INDEX, ARMAP_END, sizeof ARMAP_END - 1))
|
||||||
{
|
{
|
||||||
bfd_has_map (abfd) = FALSE;
|
abfd->has_armap = FALSE;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3018,7 +3017,7 @@ _bfd_ecoff_slurp_armap (bfd *abfd)
|
||||||
/* Pad to an even boundary. */
|
/* Pad to an even boundary. */
|
||||||
ardata->first_file_filepos += ardata->first_file_filepos % 2;
|
ardata->first_file_filepos += ardata->first_file_filepos % 2;
|
||||||
|
|
||||||
bfd_has_map (abfd) = TRUE;
|
abfd->has_armap = TRUE;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -4459,7 +4458,7 @@ _bfd_ecoff_bfd_final_link (bfd *abfd, struct bfd_link_info *info)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bfd_get_symcount (abfd) = symhdr->iextMax + symhdr->isymMax;
|
abfd->symcount = symhdr->iextMax + symhdr->isymMax;
|
||||||
|
|
||||||
ecoff_data (abfd)->linker = TRUE;
|
ecoff_data (abfd)->linker = TRUE;
|
||||||
|
|
||||||
|
|
|
@ -8405,7 +8405,7 @@ _bfd_elf_canonicalize_symtab (bfd *abfd, asymbol **allocation)
|
||||||
long symcount = bed->s->slurp_symbol_table (abfd, allocation, FALSE);
|
long symcount = bed->s->slurp_symbol_table (abfd, allocation, FALSE);
|
||||||
|
|
||||||
if (symcount >= 0)
|
if (symcount >= 0)
|
||||||
bfd_get_symcount (abfd) = symcount;
|
abfd->symcount = symcount;
|
||||||
return symcount;
|
return symcount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8417,7 +8417,7 @@ _bfd_elf_canonicalize_dynamic_symtab (bfd *abfd,
|
||||||
long symcount = bed->s->slurp_symbol_table (abfd, allocation, TRUE);
|
long symcount = bed->s->slurp_symbol_table (abfd, allocation, TRUE);
|
||||||
|
|
||||||
if (symcount >= 0)
|
if (symcount >= 0)
|
||||||
bfd_get_dynamic_symcount (abfd) = symcount;
|
abfd->dynsymcount = symcount;
|
||||||
return symcount;
|
return symcount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -305,7 +305,7 @@ elf_core_file_p (bfd *abfd)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Save the entry point from the ELF header. */
|
/* Save the entry point from the ELF header. */
|
||||||
bfd_get_start_address (abfd) = i_ehdrp->e_entry;
|
abfd->start_address = i_ehdrp->e_entry;
|
||||||
return abfd->xvec;
|
return abfd->xvec;
|
||||||
|
|
||||||
wrong:
|
wrong:
|
||||||
|
|
|
@ -9481,7 +9481,7 @@ elf_link_output_symstrtab (struct elf_final_link_info *flinfo,
|
||||||
hash_table->strtab[hash_table->strtabcount].destshndx_index
|
hash_table->strtab[hash_table->strtabcount].destshndx_index
|
||||||
= flinfo->symshndxbuf ? bfd_get_symcount (flinfo->output_bfd) : 0;
|
= flinfo->symshndxbuf ? bfd_get_symcount (flinfo->output_bfd) : 0;
|
||||||
|
|
||||||
bfd_get_symcount (flinfo->output_bfd) += 1;
|
flinfo->output_bfd->symcount += 1;
|
||||||
hash_table->strtabcount += 1;
|
hash_table->strtabcount += 1;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -12012,7 +12012,7 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
|
||||||
/* Figure out the file positions for everything but the symbol table
|
/* Figure out the file positions for everything but the symbol table
|
||||||
and the relocs. We set symcount to force assign_section_numbers
|
and the relocs. We set symcount to force assign_section_numbers
|
||||||
to create a symbol table. */
|
to create a symbol table. */
|
||||||
bfd_get_symcount (abfd) = info->strip != strip_all || emit_relocs;
|
abfd->symcount = info->strip != strip_all || emit_relocs;
|
||||||
BFD_ASSERT (! abfd->output_has_begun);
|
BFD_ASSERT (! abfd->output_has_begun);
|
||||||
if (! _bfd_elf_compute_section_file_positions (abfd, info))
|
if (! _bfd_elf_compute_section_file_positions (abfd, info))
|
||||||
goto error_return;
|
goto error_return;
|
||||||
|
@ -12057,7 +12057,7 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
|
||||||
.symtab, .strtab, and non-loaded reloc sections. We start the
|
.symtab, .strtab, and non-loaded reloc sections. We start the
|
||||||
.symtab section at the current file position, and write directly
|
.symtab section at the current file position, and write directly
|
||||||
to it. We build the .strtab section in memory. */
|
to it. We build the .strtab section in memory. */
|
||||||
bfd_get_symcount (abfd) = 0;
|
abfd->symcount = 0;
|
||||||
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
|
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
|
||||||
/* sh_name is set in prep_headers. */
|
/* sh_name is set in prep_headers. */
|
||||||
symtab_hdr->sh_type = SHT_SYMTAB;
|
symtab_hdr->sh_type = SHT_SYMTAB;
|
||||||
|
|
15
bfd/linker.c
15
bfd/linker.c
|
@ -810,14 +810,13 @@ bfd_generic_link_read_symbols (bfd *abfd)
|
||||||
symsize = bfd_get_symtab_upper_bound (abfd);
|
symsize = bfd_get_symtab_upper_bound (abfd);
|
||||||
if (symsize < 0)
|
if (symsize < 0)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
bfd_get_outsymbols (abfd) = (struct bfd_symbol **) bfd_alloc (abfd,
|
abfd->outsymbols = bfd_alloc (abfd, symsize);
|
||||||
symsize);
|
|
||||||
if (bfd_get_outsymbols (abfd) == NULL && symsize != 0)
|
if (bfd_get_outsymbols (abfd) == NULL && symsize != 0)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
symcount = bfd_canonicalize_symtab (abfd, bfd_get_outsymbols (abfd));
|
symcount = bfd_canonicalize_symtab (abfd, bfd_get_outsymbols (abfd));
|
||||||
if (symcount < 0)
|
if (symcount < 0)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
bfd_get_symcount (abfd) = symcount;
|
abfd->symcount = symcount;
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -1824,8 +1823,8 @@ _bfd_generic_final_link (bfd *abfd, struct bfd_link_info *info)
|
||||||
size_t outsymalloc;
|
size_t outsymalloc;
|
||||||
struct generic_write_global_symbol_info wginfo;
|
struct generic_write_global_symbol_info wginfo;
|
||||||
|
|
||||||
bfd_get_outsymbols (abfd) = NULL;
|
abfd->outsymbols = NULL;
|
||||||
bfd_get_symcount (abfd) = 0;
|
abfd->symcount = 0;
|
||||||
outsymalloc = 0;
|
outsymalloc = 0;
|
||||||
|
|
||||||
/* Mark all sections which will be included in the output file. */
|
/* Mark all sections which will be included in the output file. */
|
||||||
|
@ -1958,12 +1957,12 @@ generic_add_output_symbol (bfd *output_bfd, size_t *psymalloc, asymbol *sym)
|
||||||
newsyms = (asymbol **) bfd_realloc (bfd_get_outsymbols (output_bfd), amt);
|
newsyms = (asymbol **) bfd_realloc (bfd_get_outsymbols (output_bfd), amt);
|
||||||
if (newsyms == NULL)
|
if (newsyms == NULL)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
bfd_get_outsymbols (output_bfd) = newsyms;
|
output_bfd->outsymbols = newsyms;
|
||||||
}
|
}
|
||||||
|
|
||||||
bfd_get_outsymbols (output_bfd) [bfd_get_symcount (output_bfd)] = sym;
|
output_bfd->outsymbols[output_bfd->symcount] = sym;
|
||||||
if (sym != NULL)
|
if (sym != NULL)
|
||||||
++ bfd_get_symcount (output_bfd);
|
++output_bfd->symcount;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -505,10 +505,10 @@ NAME (aout, some_aout_object_p) (bfd *abfd,
|
||||||
abort ();
|
abort ();
|
||||||
}
|
}
|
||||||
|
|
||||||
bfd_get_start_address (abfd) = execp->a_entry;
|
abfd->start_address = execp->a_entry;
|
||||||
|
|
||||||
obj_aout_symbols (abfd) = NULL;
|
obj_aout_symbols (abfd) = NULL;
|
||||||
bfd_get_symcount (abfd) = execp->a_syms / sizeof (struct external_nlist);
|
abfd->symcount = execp->a_syms / sizeof (struct external_nlist);
|
||||||
|
|
||||||
/* The default relocation entry size is that of traditional V7 Unix. */
|
/* The default relocation entry size is that of traditional V7 Unix. */
|
||||||
obj_reloc_entry_size (abfd) = RELOC_SIZE;
|
obj_reloc_entry_size (abfd) = RELOC_SIZE;
|
||||||
|
@ -1512,7 +1512,7 @@ NAME (aout, slurp_symbol_table) (bfd *abfd)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bfd_get_symcount (abfd) = obj_aout_external_sym_count (abfd);
|
abfd->symcount = obj_aout_external_sym_count (abfd);
|
||||||
|
|
||||||
obj_aout_symbols (abfd) = cached;
|
obj_aout_symbols (abfd) = cached;
|
||||||
|
|
||||||
|
|
|
@ -1093,7 +1093,7 @@ pe_ILF_build_a_bfd (bfd * abfd,
|
||||||
|
|
||||||
/* Point the bfd at the symbol table. */
|
/* Point the bfd at the symbol table. */
|
||||||
obj_symbols (abfd) = vars.sym_cache;
|
obj_symbols (abfd) = vars.sym_cache;
|
||||||
bfd_get_symcount (abfd) = vars.sym_index;
|
abfd->symcount = vars.sym_index;
|
||||||
|
|
||||||
obj_raw_syments (abfd) = vars.native_syms;
|
obj_raw_syments (abfd) = vars.native_syms;
|
||||||
obj_raw_syment_count (abfd) = vars.sym_index;
|
obj_raw_syment_count (abfd) = vars.sym_index;
|
||||||
|
|
12
bfd/som.c
12
bfd/som.c
|
@ -2031,12 +2031,12 @@ som_object_setup (bfd *abfd,
|
||||||
|| (aux_hdrp->exec_entry & 0x3) != 0
|
|| (aux_hdrp->exec_entry & 0x3) != 0
|
||||||
|| ! found)
|
|| ! found)
|
||||||
{
|
{
|
||||||
bfd_get_start_address (abfd) = aux_hdrp->exec_flags;
|
abfd->start_address = aux_hdrp->exec_flags;
|
||||||
obj_som_exec_data (abfd)->exec_flags = aux_hdrp->exec_entry;
|
obj_som_exec_data (abfd)->exec_flags = aux_hdrp->exec_entry;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
bfd_get_start_address (abfd) = aux_hdrp->exec_entry + current_offset;
|
abfd->start_address = aux_hdrp->exec_entry + current_offset;
|
||||||
obj_som_exec_data (abfd)->exec_flags = aux_hdrp->exec_flags;
|
obj_som_exec_data (abfd)->exec_flags = aux_hdrp->exec_flags;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2044,7 +2044,7 @@ som_object_setup (bfd *abfd,
|
||||||
obj_som_exec_data (abfd)->version_id = file_hdrp->version_id;
|
obj_som_exec_data (abfd)->version_id = file_hdrp->version_id;
|
||||||
|
|
||||||
bfd_default_set_arch_mach (abfd, bfd_arch_hppa, pa10);
|
bfd_default_set_arch_mach (abfd, bfd_arch_hppa, pa10);
|
||||||
bfd_get_symcount (abfd) = file_hdrp->symbol_total;
|
abfd->symcount = file_hdrp->symbol_total;
|
||||||
|
|
||||||
/* Initialize the saved symbol table and string table to NULL.
|
/* Initialize the saved symbol table and string table to NULL.
|
||||||
Save important offsets and sizes from the SOM header into
|
Save important offsets and sizes from the SOM header into
|
||||||
|
@ -4792,7 +4792,7 @@ som_slurp_symbol_table (bfd *abfd)
|
||||||
|
|
||||||
/* We modify the symbol count to record the number of BFD symbols we
|
/* We modify the symbol count to record the number of BFD symbols we
|
||||||
created. */
|
created. */
|
||||||
bfd_get_symcount (abfd) = sym - symbase;
|
abfd->symcount = sym - symbase;
|
||||||
|
|
||||||
/* Save our results and return success. */
|
/* Save our results and return success. */
|
||||||
obj_som_symtab (abfd) = symbase;
|
obj_som_symtab (abfd) = symbase;
|
||||||
|
@ -6131,7 +6131,7 @@ som_slurp_armap (bfd *abfd)
|
||||||
/* For archives without .o files there is no symbol table. */
|
/* For archives without .o files there is no symbol table. */
|
||||||
if (! CONST_STRNEQ (nextname, "/ "))
|
if (! CONST_STRNEQ (nextname, "/ "))
|
||||||
{
|
{
|
||||||
bfd_has_map (abfd) = FALSE;
|
abfd->has_armap = FALSE;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6201,7 +6201,7 @@ som_slurp_armap (bfd *abfd)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
/* Notify the generic archive code that we have a symbol map. */
|
/* Notify the generic archive code that we have a symbol map. */
|
||||||
bfd_has_map (abfd) = TRUE;
|
abfd->has_armap = TRUE;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -455,8 +455,8 @@ bfd_set_symtab (bfd *abfd, asymbol **location, unsigned int symcount)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bfd_get_outsymbols (abfd) = location;
|
abfd->outsymbols = location;
|
||||||
bfd_get_symcount (abfd) = symcount;
|
abfd->symcount = symcount;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8912,8 +8912,8 @@ alpha_vms_bfd_final_link (bfd *abfd, struct bfd_link_info *info)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bfd_get_outsymbols (abfd) = NULL;
|
abfd->outsymbols = NULL;
|
||||||
bfd_get_symcount (abfd) = 0;
|
abfd->symcount = 0;
|
||||||
|
|
||||||
/* Mark all sections which will be included in the output file. */
|
/* Mark all sections which will be included in the output file. */
|
||||||
for (o = abfd->sections; o != NULL; o = o->next)
|
for (o = abfd->sections; o != NULL; o = o->next)
|
||||||
|
|
|
@ -6412,9 +6412,9 @@ _bfd_xcoff_bfd_final_link (bfd *abfd, struct bfd_link_info *info)
|
||||||
goto error_return;
|
goto error_return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Setting bfd_get_symcount to 0 will cause write_object_contents to
|
/* Setting symcount to 0 will cause write_object_contents to
|
||||||
not try to write out the symbols. */
|
not try to write out the symbols. */
|
||||||
bfd_get_symcount (abfd) = 0;
|
abfd->symcount = 0;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue