aboutsummaryrefslogtreecommitdiff
path: root/bfd/linker.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2019-09-18 15:07:33 +0930
committerAlan Modra <amodra@gmail.com>2019-09-18 22:21:58 +0930
commited48ec2e6ec5514f01b9b3a810d6ddf39651114b (patch)
tree68111a47a8fbf5230be398cb68fe84840ab0d099 /bfd/linker.c
parent01c2b26160575ad4add68da8a043b3fa30defae4 (diff)
downloadgdb-ed48ec2e6ec5514f01b9b3a810d6ddf39651114b.zip
gdb-ed48ec2e6ec5514f01b9b3a810d6ddf39651114b.tar.gz
gdb-ed48ec2e6ec5514f01b9b3a810d6ddf39651114b.tar.bz2
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.
Diffstat (limited to 'bfd/linker.c')
-rw-r--r--bfd/linker.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/bfd/linker.c b/bfd/linker.c
index f6eef93..8aec0d2 100644
--- a/bfd/linker.c
+++ b/bfd/linker.c
@@ -810,14 +810,13 @@ bfd_generic_link_read_symbols (bfd *abfd)
symsize = bfd_get_symtab_upper_bound (abfd);
if (symsize < 0)
return FALSE;
- bfd_get_outsymbols (abfd) = (struct bfd_symbol **) bfd_alloc (abfd,
- symsize);
+ abfd->outsymbols = bfd_alloc (abfd, symsize);
if (bfd_get_outsymbols (abfd) == NULL && symsize != 0)
return FALSE;
symcount = bfd_canonicalize_symtab (abfd, bfd_get_outsymbols (abfd));
if (symcount < 0)
return FALSE;
- bfd_get_symcount (abfd) = symcount;
+ abfd->symcount = symcount;
}
return TRUE;
@@ -1824,8 +1823,8 @@ _bfd_generic_final_link (bfd *abfd, struct bfd_link_info *info)
size_t outsymalloc;
struct generic_write_global_symbol_info wginfo;
- bfd_get_outsymbols (abfd) = NULL;
- bfd_get_symcount (abfd) = 0;
+ abfd->outsymbols = NULL;
+ abfd->symcount = 0;
outsymalloc = 0;
/* 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);
if (newsyms == NULL)
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)
- ++ bfd_get_symcount (output_bfd);
+ ++output_bfd->symcount;
return TRUE;
}