gcc/libitm
Daniel Jacobowitz 1e44e857e0 config.gcc: Handle --enable-fdpic.
gcc/ChangeLog
	* config.gcc: Handle --enable-fdpic.
	* config/sh/constraints.md (Ccl): New constraint.
	* config/sh/linux.h (SUBTARGET_LINK_EMUL_SUFFIX): Handle -mfdpic.
	* config/sh/sh-c.c (sh_cpu_cpp_builtins): Add __FDPIC__ and
	__SH_FDPIC__.
	* config/sh/sh-mem.cc (expand_block_move): Support FDPIC for calls to
	library functions.
	* config/sh/sh-protos.h (function_symbol_result): New struct.
	(function_symbol): Return function_symbol_result.
	(sh_get_fdpic_reg_initial_val, sh_load_function_descriptor): New
	declarations.
	* config/sh/sh.c (TARGET_ASM_INTEGER, sh_assemble_integer): Implement
	target hook.
	(TARGET_CANNOT_FORCE_CONST_MEM, sh_cannot_force_const_mem_p): Likewise.
	(sh_option_override): Force -fPIC if FDPIC is in effect.
	(sh_asm_output_addr_const_extra): Add UNSPEC_GOTFUNCDESC and
	UNSPEC_GOTOFFFUNCDESC cases.
	(prepare_move_operands): Use FDPIC initial GOT register for
	TLS-related GOT access; inhibit cross-section address offset constants
	for FDPIC.
	(sh_assemble_integer): New function.
	(sh_cannot_copy_insn_p): Inhibit copying insns that are FDPIC
	PC-relative call sites.
	(expand_ashiftrt): Adapt invocation of function_symbol.
	(sh_expand_prologue): Inhibit PC-relative GOT address load for FDPIC.
	(nonpic_symbol_mentioned_p): Add cases for UNSPEC_GOTFUNCDESC and
	UNSPEC_GOTOFFFUNCDESC.
	(legitimize_pic_address): Resolve function symbols to function
	descriptors for FDPIC.  Do not use GOT-relative addressing for local
	data that may be read-only on FDPIC.
	(sh_emit_storesi, sh_emit_storehi): New functions.
	(sh_trampoline_init): Generate FDPIC trampolines.
	(sh_function_ok_for_sibcall): Add TARGET_FDPIC check.
	(sh_expand_sym_label2reg): Don't assume sibcalls are local.
	(sh_output_mi_thunk): Generate FDPIC call.
	(function_symbol): Return function_symbol_result.  For SFUNC_STATIC on
	FDPIC, generate call site labels to use PC-relative addressing rather
	than GOT-relative addressing.
	(sh_conditional_register_usage): Make PIC register fixed and call used
	when FDPIC is in effect.
	(sh_legitimate_constant_p): Impose FDPIC constant constraints.
	(sh_cannot_force_const_mem_p, sh_load_function_descriptor,
	sh_get_fdpic_reg_initial_val): New functions.
	* config/sh/sh.h (SUBTARGET_ASM_SPEC, SUBTARGET_LINK_EMUL_SUFFIX):
	Handle -mfdpic.
	(FDPIC_SELF_SPECS, SUBTARGET_DRIVER_SELF_SPECS,
	PIC_OFFSET_TABLE_REG_CALL_CLOBBERED,
	SH_OFFSETS_MUST_BE_WITHIN_SECTIONS_P): New macros.
	(DRIVER_SELF_SPECS): Add SUBTARGET_DRIVER_SELF_SPECS and
	FDPIC_SELF_SPECS.
	(TRAMPOLINE_SIZE): Select trampoline size for FDPIC.
	(ASM_PREFERRED_EH_DATA_FORMAT): Add EH format constraints for FDPIC.
	(ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Handle FDPIC case.
	* config/sh/sh.md (UNSPEC_GOTFUNCDESC, UNSPEC_GOTOFFFUNCDESC): New
	constants.
	(calli_fdpic, call_valuei_fdpic, sibcalli_fdpic, sibcalli_pcrel_fdpic,
	sibcall_pcrel_fdpic, sibcall_valuei_fdpic, sibcall_valuei_pcrel_fdpic,
	sibcall_value_pcrel_fdpic, sym2GOTFUNCDESC, symGOTFUNCDESC2reg,
	sym2GOTOFFFUNCDESC, symGOTOFFFUNCDESC2reg): New patterns.
	(udivsi3_i1, udivsi3_i4, udivsi3_i4_single, udivsi3,
	*divsi_inv_call_combine, divsi3_i4, divsi3_i4_single, divsi3, ashlsi3,
	ashlsi3_d_call, ashrsi3_n, lshrsi3, lshrsi3_d_call, calli, call_valuei,
	call, call_value, sibcalli, sibcalli_pcrel, sibcall_pcrel, sibcall,
	sibcall_valuei, sibcall_valuei_pcrel, sibcall_value_pcrel,
	sibcall_value, GOTaddr2picreg, symGOT_load, symGOTOFF2reg,
	block_move_real, block_lump_real, block_move_real_i4,
	block_lump_real_i4): Add support for FDPIC calls.
	(mulsi3, ic_invalidate_line, initialize_trampoline, call_pop,
	call_value_pop): Adjust for new function_symbol signature.
	* config/sh/sh.opt (-mfdpic): New option.
	* doc/install.texi (Options specification): Document --enable-fdpic.
	* doc/invoke.texi (SH Options): Document -mfdpic.

include/ChangeLog:
	* longlong.h (udiv_qrnnd): Add FDPIC compatible version for SH.

libitm/ChangeLog:
	* config/sh/sjlj.S (_ITM_beginTransaction): Bypass PLT calling
	GTM_begin_transaction for compatibility with FDPIC.

Co-Authored-By: Andrew Stubbs <ams@codesourcery.com>
Co-Authored-By: Joseph Myers <joseph@codesourcery.com>
Co-Authored-By: Mark Shinwell <shinwell@codesourcery.com>
Co-Authored-By: Rich Felker <dalias@libc.org>

From-SVN: r229438
2015-10-27 13:36:47 +00:00
..
config config.gcc: Handle --enable-fdpic. 2015-10-27 13:36:47 +00:00
testsuite Testsuite: add dg-{begin|end}-multiline-output commands 2015-10-09 13:55:23 +00:00
aatree.cc Update copyright years. 2015-01-05 13:33:28 +01:00
aatree.h Update copyright years. 2015-01-05 13:33:28 +01:00
acinclude.m4 Centralise clearing hardware capabilities with Sun ld 2014-05-28 11:32:54 +00:00
aclocal.m4 libitm: Bump to automake 1.11.6 2015-05-13 11:25:28 +00:00
alloc_c.cc Update copyright years. 2015-01-05 13:33:28 +01:00
alloc_cpp.cc Update copyright years. 2015-01-05 13:33:28 +01:00
alloc.cc Update copyright years. 2015-01-05 13:33:28 +01:00
barrier.cc Update copyright years. 2015-01-05 13:33:28 +01:00
beginend.cc Update copyright years. 2015-01-05 13:33:28 +01:00
ChangeLog config.gcc: Handle --enable-fdpic. 2015-10-27 13:36:47 +00:00
clone.cc Update copyright years. 2015-01-05 13:33:28 +01:00
common.h Update copyright years. 2015-01-05 13:33:28 +01:00
config.h.in acinclude.m4 (LIBITM_CHECK_AS_HTM): New. 2013-07-15 12:23:49 -05:00
configure libitm: Bump to automake 1.11.6 2015-05-13 11:25:28 +00:00
configure.ac Update copyright years. 2015-01-05 13:33:28 +01:00
configure.tgt Update copyright years. 2015-01-05 13:33:28 +01:00
containers.h Update copyright years. 2015-01-05 13:33:28 +01:00
dispatch.h Update copyright years. 2015-01-05 13:33:28 +01:00
eh_cpp.cc Update copyright years. 2015-01-05 13:33:28 +01:00
libitm_i.h Update copyright years. 2015-01-05 13:33:28 +01:00
libitm.h Update copyright years. 2015-01-05 13:33:28 +01:00
libitm.map Remove _ITM_getThreadnum 2012-01-23 13:05:00 +00:00
libitm.spec.in
libitm.texi gcc.c (process_command): Update copyright notice dates. 2015-01-05 13:05:46 +01:00
local_atomic libitm: Don't redefine __always_inline in local_atomic. 2015-08-20 17:55:24 +00:00
local_type_traits Update copyright years. 2015-01-05 13:33:28 +01:00
local.cc Update copyright years. 2015-01-05 13:33:28 +01:00
Makefile.am Make sure that -msse/-mavx are appended at the end 2014-01-13 11:36:17 -08:00
Makefile.in libitm: Bump to automake 1.11.6 2015-05-13 11:25:28 +00:00
method-gl.cc Update copyright years. 2015-01-05 13:33:28 +01:00
method-ml.cc Update copyright years. 2015-01-05 13:33:28 +01:00
method-serial.cc Update copyright years. 2015-01-05 13:33:28 +01:00
query.cc Update copyright years. 2015-01-05 13:33:28 +01:00
retry.cc Update copyright years. 2015-01-05 13:33:28 +01:00
stmlock.h Update copyright years. 2015-01-05 13:33:28 +01:00
useraction.cc Update copyright years. 2015-01-05 13:33:28 +01:00
util.cc Update copyright years. 2015-01-05 13:33:28 +01:00