gcc/include
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
..
gdb Update copyright year in include 2015-07-14 09:08:59 -07:00
COPYING Update the address and phone number of the FSF organization. 2005-05-10 15:22:21 +00:00
COPYING3 COPYING_v3: New file. 2007-07-17 08:37:53 +00:00
ChangeLog config.gcc: Handle --enable-fdpic. 2015-10-27 13:36:47 +00:00
ChangeLog-9103 Convert ChangeLog files to UTF-8. 2008-09-05 13:07:45 +02:00
ChangeLog.jit Merger of dmalcolm/jit branch from git 2014-11-11 21:55:52 +00:00
ansidecl.h add GCC_FINAL to ansidecl.h 2015-08-11 22:39:31 +00:00
demangle.h Implement N4514, C++ Extensions for Transactional Memory. 2015-10-04 15:17:19 -04:00
dwarf2.def DWARF2: add extensions to handle biased types 2015-08-14 09:48:13 +00:00
dwarf2.h Update copyright year in include 2015-07-14 09:08:59 -07:00
dyn-string.h Update copyright year in include 2015-07-14 09:08:59 -07:00
environ.h Fix PR63758 by using the _NSGetEnviron() API on Darwin 2015-10-18 10:33:37 +00:00
fibheap.h Update copyright year in include 2015-07-14 09:08:59 -07:00
filenames.h Update copyright year in include 2015-07-14 09:08:59 -07:00
floatformat.h Update copyright year in include 2015-07-14 09:08:59 -07:00
fnmatch.h Update copyright year in include 2015-07-14 09:08:59 -07:00
gcc-c-fe.def Update copyright year in include 2015-07-14 09:08:59 -07:00
gcc-c-interface.h Update copyright year in include 2015-07-14 09:08:59 -07:00
gcc-interface.h Update copyright year in include 2015-07-14 09:08:59 -07:00
getopt.h Update copyright year in include 2015-07-14 09:08:59 -07:00
gomp-constants.h builtin-types.def (BT_FN_BOOL_UINT_LONGPTR_LONGPTR_LONGPTR, [...]): New. 2015-10-13 21:06:23 +02:00
hashtab.h Update copyright year in include 2015-07-14 09:08:59 -07:00
leb128.h Update copyright year in include 2015-07-14 09:08:59 -07:00
libiberty.h libiberty.h (asprintf): Don't declare if HAVE_DECL_ASPRINTF is not defined. 2015-05-22 20:53:45 +00:00
longlong.h config.gcc: Handle --enable-fdpic. 2015-10-27 13:36:47 +00:00
lto-symtab.h Update copyright year in include 2015-07-14 09:08:59 -07:00
md5.h Update copyright year in include 2015-07-14 09:08:59 -07:00
objalloc.h Update copyright year in include 2015-07-14 09:08:59 -07:00
obstack.h Update copyright year in include 2015-07-14 09:08:59 -07:00
partition.h partition.h (struct partition_elem): Re-order elements to avoid padding. 2015-03-19 11:44:08 +00:00
plugin-api.h Update copyright year in include 2015-07-14 09:08:59 -07:00
safe-ctype.h Update copyright year in include 2015-07-14 09:08:59 -07:00
sha1.h Update copyright year in include 2015-07-14 09:08:59 -07:00
simple-object.h Update copyright year in include 2015-07-14 09:08:59 -07:00
sort.h Update copyright year in include 2015-07-14 09:08:59 -07:00
splay-tree.h Update copyright year in include 2015-07-14 09:08:59 -07:00
symcat.h Update copyright year in include 2015-07-14 09:08:59 -07:00
timeval-utils.h Update copyright year in include 2015-07-14 09:08:59 -07:00
vtv-change-permission.h Update copyright year in include 2015-07-14 09:08:59 -07:00
xregex.h system.h [...]: Wrap C function declarations in extern "C". 2011-07-25 14:24:59 +00:00
xregex2.h Update copyright year in include 2015-07-14 09:08:59 -07:00
xtensa-config.h Update copyright year in include 2015-07-14 09:08:59 -07:00