diff options
author | Alan Modra <amodra@gmail.com> | 2003-06-19 13:50:35 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2003-06-19 13:50:35 +0000 |
commit | d2a300cfe348688766fc425056c10512691bae65 (patch) | |
tree | d779be8b282f14fff6f6bba40b11c6d5dbc9e7ae /bfd/elf64-ppc.c | |
parent | 6ddfd88c7291a6dade160a8ff67d94b462ba5534 (diff) | |
download | gdb-d2a300cfe348688766fc425056c10512691bae65.zip gdb-d2a300cfe348688766fc425056c10512691bae65.tar.gz gdb-d2a300cfe348688766fc425056c10512691bae65.tar.bz2 |
* elf64-ppc.c (ppc64_elf_reloc_type_lookup): Tidy prototype.
(ppc64_elf_info_to_howto): Likewise.
(ppc64_elf_build_stubs): Add "stats" param, and print statistics.
* elf64-ppc.h (ppc64_elf_build_stubs): Adjust prototype.
Diffstat (limited to 'bfd/elf64-ppc.c')
-rw-r--r-- | bfd/elf64-ppc.c | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index 8ffae99b..6414d13 100644 --- a/bfd/elf64-ppc.c +++ b/bfd/elf64-ppc.c @@ -33,9 +33,9 @@ static void ppc_howto_init PARAMS ((void)); static reloc_howto_type *ppc64_elf_reloc_type_lookup - PARAMS ((bfd *abfd, bfd_reloc_code_real_type code)); + PARAMS ((bfd *, bfd_reloc_code_real_type)); static void ppc64_elf_info_to_howto - PARAMS ((bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst)); + PARAMS ((bfd *, arelent *, Elf_Internal_Rela *)); static bfd_reloc_status_type ppc64_elf_ha_reloc PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); static bfd_reloc_status_type ppc64_elf_brtaken_reloc @@ -7114,9 +7114,10 @@ ppc64_elf_toc (obfd) hash table. This function is called via gldelf64ppc_finish. */ bfd_boolean -ppc64_elf_build_stubs (emit_stub_syms, info) +ppc64_elf_build_stubs (emit_stub_syms, info, stats) bfd_boolean emit_stub_syms; struct bfd_link_info *info; + char **stats; { struct ppc_link_hash_table *htab = ppc_hash_table (info); asection *stub_sec; @@ -7242,7 +7243,29 @@ ppc64_elf_build_stubs (emit_stub_syms, info) (*_bfd_error_handler) (_("stubs don't match calculated size")); } - return !htab->stub_error; + if (htab->stub_error) + return FALSE; + + if (stats != NULL) + { + *stats = bfd_malloc (500); + if (*stats == NULL) + return FALSE; + + sprintf (*stats, _("linker stubs in %u groups\n" + " branch %lu\n" + " toc adjust %lu\n" + " long branch %lu\n" + " long toc adj %lu\n" + " plt call %lu"), + htab->stub_bfd->section_count, + htab->stub_count[(int) ppc_stub_long_branch - 1], + htab->stub_count[(int) ppc_stub_long_branch_r2off - 1], + htab->stub_count[(int) ppc_stub_plt_branch - 1], + htab->stub_count[(int) ppc_stub_plt_branch_r2off - 1], + htab->stub_count[(int) ppc_stub_plt_call - 1]); + } + return TRUE; } /* The RELOCATE_SECTION function is called by the ELF backend linker |