Commit 17691698 by Sebastian Huber Committed by Sebastian Huber

[PowerPC/RTEMS] Enable -mcmodel option

gcc/
	* config.gcc (powerpc-*-rtems*): Add rs6000/linux64.opt.
	* config/rs6000/rtems.h (ASM_PREFERRED_EH_DATA_FORMAT): New define.
	(DOT_SYMBOLS): Likewise.
	(MINIMAL_TOC_SECTION_ASM_OP): Likewise.
	(RELOCATABLE_NEEDS_FIXUP): Likewise.
	(RS6000_ABI_NAME): Likewise.
	(TARGET_CMODEL): Likewise.
	(TOC_SECTION_ASM_OP): Likewise.
	(SET_CMODEL): New macro.
	(SUBSUBTARGET_OVERRIDE_OPTIONS): Evaluate cmodel options.

From-SVN: r251275
parent cd0835ce
2017-08-22 Sebastian Huber <sebastian.huber@embedded-brains.de>
* config.gcc (powerpc-*-rtems*): Add rs6000/linux64.opt.
* config/rs6000/rtems.h (ASM_PREFERRED_EH_DATA_FORMAT): New define.
(DOT_SYMBOLS): Likewise.
(MINIMAL_TOC_SECTION_ASM_OP): Likewise.
(RELOCATABLE_NEEDS_FIXUP): Likewise.
(RS6000_ABI_NAME): Likewise.
(TARGET_CMODEL): Likewise.
(TOC_SECTION_ASM_OP): Likewise.
(SET_CMODEL): New macro.
(SUBSUBTARGET_OVERRIDE_OPTIONS): Evaluate cmodel options.
2017-08-22 Richard Biener <rguenther@suse.de>
* tree-inline.c (remap_type_1): Change asserts on TYPE_SIZE[_UNIT]
......
......@@ -2442,7 +2442,7 @@ powerpc-*-rtems*spe*)
;;
powerpc-*-rtems*)
tm_file="rs6000/biarch64.h ${tm_file} dbxelf.h elfos.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/rtems.h rtems.h"
extra_options="${extra_options} rs6000/sysv4.opt"
extra_options="${extra_options} rs6000/sysv4.opt rs6000/linux64.opt"
tmake_file="${tmake_file} rs6000/t-fprules rs6000/t-rtems rs6000/t-ppccomm"
;;
powerpc*-*-linux*spe*)
......
......@@ -37,6 +37,15 @@
#undef TARGET_AIX
#define TARGET_AIX TARGET_64BIT
/* Simplified copy and paste from linux64.h and freebsd64.h */
#undef DOT_SYMBOLS
#define DOT_SYMBOLS 0
/* Copy and paste from linux64.h and freebsd64.h */
#undef TARGET_CMODEL
#define TARGET_CMODEL rs6000_current_cmodel
#define SET_CMODEL(opt) rs6000_current_cmodel = opt
#undef TARGET_OS_CPP_BUILTINS
#define TARGET_OS_CPP_BUILTINS() \
do \
......@@ -64,6 +73,15 @@
while (0)
/* Copy and paste from linux64.h and freebsd64.h */
#undef RELOCATABLE_NEEDS_FIXUP
#define RELOCATABLE_NEEDS_FIXUP \
(rs6000_isa_flags & rs6000_isa_flags_explicit & OPTION_MASK_RELOCATABLE)
/* Copy and paste from linux64.h */
#undef RS6000_ABI_NAME
#define RS6000_ABI_NAME "linux"
/* Copy and paste from linux64.h and freebsd64.h */
#define INVALID_64BIT "-m%s not supported in this configuration"
/* A lot of copy and paste from linux64.h and freebsd64.h */
......@@ -95,6 +113,24 @@
rs6000_isa_flags |= OPTION_MASK_POWERPC64; \
error ("-m64 requires a PowerPC64 cpu"); \
} \
if ((rs6000_isa_flags_explicit \
& OPTION_MASK_MINIMAL_TOC) != 0) \
{ \
if (global_options_set.x_rs6000_current_cmodel \
&& rs6000_current_cmodel != CMODEL_SMALL) \
error ("-mcmodel incompatible with other toc options"); \
SET_CMODEL (CMODEL_SMALL); \
} \
else \
{ \
if (!global_options_set.x_rs6000_current_cmodel) \
SET_CMODEL (CMODEL_MEDIUM); \
if (rs6000_current_cmodel != CMODEL_SMALL) \
{ \
TARGET_NO_FP_IN_TOC = 0; \
TARGET_NO_SUM_IN_TOC = 0; \
} \
} \
} \
} \
while (0)
......@@ -141,6 +177,30 @@
#define RESTORE_FP_SUFFIX ""
/* Copy and paste from linux64.h and freebsd64.h */
#undef ASM_PREFERRED_EH_DATA_FORMAT
#define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL) \
(TARGET_64BIT || flag_pic \
? (((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel \
| (TARGET_64BIT ? DW_EH_PE_udata8 : DW_EH_PE_sdata4)) \
: DW_EH_PE_absptr)
/* Copy and paste from linux64.h and freebsd64.h */
#undef TOC_SECTION_ASM_OP
#define TOC_SECTION_ASM_OP \
(TARGET_64BIT \
? "\t.section\t\".toc\",\"aw\"" \
: "\t.section\t\".got\",\"aw\"")
/* Copy and paste from linux64.h and freebsd64.h */
#undef MINIMAL_TOC_SECTION_ASM_OP
#define MINIMAL_TOC_SECTION_ASM_OP \
(TARGET_64BIT \
? "\t.section\t\".toc1\",\"aw\"" \
: (flag_pic \
? "\t.section\t\".got2\",\"aw\"" \
: "\t.section\t\".got1\",\"aw\""))
/* Copy and paste from linux64.h and freebsd64.h */
#undef ASM_DECLARE_FUNCTION_SIZE
#define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \
do \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment