* elf64-ppc.c (ppc64_elf_reloc_type_lookup): Tidy prototype.
authorAlan Modra <amodra@gmail.com>
Thu, 19 Jun 2003 13:50:35 +0000 (13:50 +0000)
committerAlan Modra <amodra@gmail.com>
Thu, 19 Jun 2003 13:50:35 +0000 (13:50 +0000)
(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.

bfd/ChangeLog
bfd/elf64-ppc.c
bfd/elf64-ppc.h

index 5304adbe681b0b9cbf4eff727b7b5f6cea230f23..28284ecd2dc1aea0f3320fd7c419566cd0be6b16 100644 (file)
@@ -1,3 +1,10 @@
+2003-06-19  Alan Modra  <amodra@bigpond.net.au>
+
+       * 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.
+
 2003-06-19  Alan Modra  <amodra@bigpond.net.au>
 
        * elf64-sparc.c (sparc64_elf_relocate_section): Ignore R_SPARC_DISP32
index 8ffae99bdf934d451b238c7ffe333cd56d172950..6414d139521c356f600cfbea368e68c88f42ba40 100644 (file)
@@ -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
index cf720b4798b1be4f9df5ebf70ee60cfb202b4090..10f7da6594a3a547459a7ea6f5d7ee03921296c2 100644 (file)
@@ -39,4 +39,4 @@ bfd_boolean ppc64_elf_size_stubs
   PARAMS ((bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma,
           asection *(*) (const char *, asection *), void (*) (void)));
 bfd_boolean ppc64_elf_build_stubs
-  PARAMS ((bfd_boolean, struct bfd_link_info *));
+  PARAMS ((bfd_boolean, struct bfd_link_info *, char **));
This page took 0.036402 seconds and 4 git commands to generate.