From a4b6fadd50968ec6c1b687fe52b88bd11ff734b3 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Tue, 1 Sep 2015 08:56:22 +0930 Subject: ppc64 out-of-line register save/restore functions Don't emit long branch or plt branch stubs to save/restore functions. Copy them instead. The problem is that plt branch stubs currently trash r12, one of the parameters to some of the save/restore functions, and there is no free register available to use instead of r12. 6f20ed8a is prerequisite for this patch. PR 18878 * elf64-ppc.c (ARRAY_SIZE): Define. Use throughout. (enum ppc_stub_type): Add ppc_stub_save_res. (struct map_stub): Add "next" and "needs_save_res". (struct ppc_link_hash_entry): Add "save_res" flag. (struct ppc_link_hash_table): Add "group". (sfpr_define): Add stub_sec param. Define symbol in stub_sec if stub_sec is non-null. Set "save_res". (save_res_funcs): Make file scope, rename from funcs. Adjust uses. (ppc64_elf_adjust_dynamic_symbol): Prohibit plt call to save_res syms. (ppc_build_one_stub): Handle ppc_stub_save_res. (ppc_size_one_stub): Set stub type to ppc_size_one_stub on finding stub for linker defined save_res sym. (group_sections): Init new fields of struct map_stub. (ppc64_elf_size_stubs): Reserve space for save/restore func copy. (ppc64_elf_build_stubs): Copy save/restore funcs to groups. Emit alias syms too. (ppc64_elf_relocate_section): Set destination for ppc_stub_save_res. --- bfd/ChangeLog | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'bfd/ChangeLog') diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 5742aa3..e2819fe 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,24 @@ +2015-09-01 Alan Modra + + PR 18878 + * elf64-ppc.c (ARRAY_SIZE): Define. Use throughout. + (enum ppc_stub_type): Add ppc_stub_save_res. + (struct map_stub): Add "next" and "needs_save_res". + (struct ppc_link_hash_entry): Add "save_res" flag. + (struct ppc_link_hash_table): Add "group". + (sfpr_define): Add stub_sec param. Define symbol in stub_sec if + stub_sec is non-null. Set "save_res". + (save_res_funcs): Make file scope, rename from funcs. Adjust uses. + (ppc64_elf_adjust_dynamic_symbol): Prohibit plt call to save_res syms. + (ppc_build_one_stub): Handle ppc_stub_save_res. + (ppc_size_one_stub): Set stub type to ppc_size_one_stub on finding + stub for linker defined save_res sym. + (group_sections): Init new fields of struct map_stub. + (ppc64_elf_size_stubs): Reserve space for save/restore func copy. + (ppc64_elf_build_stubs): Copy save/restore funcs to groups. Emit + alias syms too. + (ppc64_elf_relocate_section): Set destination for ppc_stub_save_res. + 2015-08-31 Alan Modra * elf64-ppc.c (get_r2off): Return -1 on error. -- cgit v1.1