[GOLD] PowerPC64 localentry:0 plt call optimization

elfcpp/
	* elfcpp.h (DT_PPC64_OPT): Define.
	* powerpc.h (PPC64_OPT_TLS, PPC64_OPT_MULTI_TOC,
	PPC64_OPT_LOCALENTRY): Define.
gold/
	* options.h (General_options): Add plt_localentry.
	* powerpc.cc (Target_powerpc::st_other): New function.
	(Target_powerpc::plt_localentry0_, plt_localentry0_init_,
	has_localentry0_): New vars.
	(Target_powerpc::plt_localentry0, set_has_localentry0,
	is_elfv2_localentry0): New functions.
	(Target_powerpc::Branch_info::mark_pltcall): Don't set tocsave or
	return true for localentry:0 calls.
	(Stub_table::Plt_stub_ent::localentry0_): New var.
	(Stub_table::add_plt_call_entry): Set localentry0_ and has_localentry0_.
	Don't set r2save_ for localentry:0 calls.
	(Output_data_glink::do_write): Save r2 in __glink_PLTresolve for elfv2.
	(Target_powerpc::scan_relocs): Default plt_localentry0_.
	(Target_powerpc::do_finalize_sections): Set DT_PPC64_OPT.
	(Target_powerpc::Relocate::relocate): Don't require nop following
	calls for localentry:0 plt calls, and don't change nop.
This commit is contained in:
Alan Modra
2017-06-23 20:39:43 +09:30
parent 7e57d19e48
commit 7ee7ff7015
6 changed files with 149 additions and 11 deletions

View File

@@ -228,6 +228,14 @@ enum
EF_PPC64_ABI = 3
};
// DT_PPC64_OPT bits
enum
{
PPC64_OPT_TLS = 1,
PPC64_OPT_MULTI_TOC = 2,
PPC64_OPT_LOCALENTRY = 4
};
enum
{
// The ELFv2 ABI uses three bits in the symbol st_other field of a