aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2003-06-19 13:50:35 +0000
committerAlan Modra <amodra@gmail.com>2003-06-19 13:50:35 +0000
commitd2a300cfe348688766fc425056c10512691bae65 (patch)
treed779be8b282f14fff6f6bba40b11c6d5dbc9e7ae /bfd
parent6ddfd88c7291a6dade160a8ff67d94b462ba5534 (diff)
downloadgdb-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')
-rw-r--r--bfd/ChangeLog7
-rw-r--r--bfd/elf64-ppc.c31
-rw-r--r--bfd/elf64-ppc.h2
3 files changed, 35 insertions, 5 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 5304adb..28284ec 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,12 @@
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
reloc overflow on discarded eh_frame entries.
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
diff --git a/bfd/elf64-ppc.h b/bfd/elf64-ppc.h
index cf720b4..10f7da6 100644
--- a/bfd/elf64-ppc.h
+++ b/bfd/elf64-ppc.h
@@ -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 **));