Commit 3c7404d3 by Rainer Orth Committed by Rainer Orth

config.gcc (mips-sgi-irix6*o32): Only enable use_collect2 without gas.

	* config.gcc (mips-sgi-irix6*o32): Only enable use_collect2
	without gas.
	(mips-sgi-irix6*): Likewise.

	* config/mips/iris6gas.h: New file.
	* gcc/config.gcc (mips-sgi-irix6*): Use it.

	* config/mips/mips.h (TARGET_IRIX): Provide default.
	(TARGET_IRIX5): Likewise.
	(TARGET_SGI_O32_AS): Likewise.
	* config/mips/iris5.h (TARGET_IRIX): Redefine as 1.
	(TARGET_IRIX5): Likewise.
	* config/mips/iris6.h (TARGET_IRIX6): Remove.
	(TARGET_IRIX5): Redefine as 0.

	* config/mips/mips.c (mips_output_external): Test for IRIX 6 O32
	linker workaround with TARGET_IRIX and mips_abi instead of
	ASM_OUTPUT_UNDEF_FUNCTION.
	(mips_file_end): Inline old ASM_OUTPUT_UNDEF_FUNCTION definition,
	testing TARGET_IRIX and mips_abi explicitly.
	* config/mips/iris5.h (ASM_OUTPUT_UNDEF_FUNCTION): Remove.
	* config/mips/iris6.h (ASM_OUTPUT_UNDEF_FUNCTION): Remove undef.

	* config/mips/mips.c (irix_output_external_libcall): Renamed from
	mips_output_external_libcall.
	Use new TARGET_IRIX in guard.
	* config/mips/mips-protos.h (irix_output_external_libcall): Match
	this.
	* config/mips/iris5.h (TARGET_ASM_EXTERNAL_LIBCALL): Likewise.

	* config/mips/iris5gas.h (HAVE_GAS_SHF_MERGE): Update comment.
	Define as 0.

	* config/mips/iris6.h (FUNCTION_NAME_ALREADY_DECLARED): Define
	depending on mips_abi.
	* config/mips/linux.h (FUNCTION_NAME_ALREADY_DECLARED): Define as 1.
	* config/mips/mips.c (mips_output_function_prologue): Test
	FUNCTION_NAME_ALREADY_DECLARED at runtime.
	(mips_output_function_epilogue): Likewise.
	(build_mips16_function_stub): Likewise.
	(build_mips16_call_stub): Likewise.
	* config/mips/mips.h (FUNCTION_NAME_ALREADY_DECLARED): Provide
	default.

	* config/mips/iris6.h (DWARF2_UNWIND_INFO): Don't define for native
	IRIX 6 O32 assembler.
	(SUBTARGET_CC1_SPEC): Enforce mips2 ISA with O32 ABI.
	(TARGET_OS_CPP_BUILTINS): Define _ABIO32, use it to define
	_MIPS_SIM for O32 ABI.
	(DWARF2_FRAME_INFO): Don't define for native IRIX 6 O32 assembler.
	(ASM_DECLARE_FUNCTION_NAME): Integrate mips.h version.
	(ASM_DECLARE_FUNCTION_SIZE): Move undef before redefinition.
	Integrate O32 version.
	(SUBTARGET_ASM_SPEC): Handle -mabi=32.
	(SUBTARGET_ASM_DEBUGGING_SPEC): Add mdebug_asm_spec for gas with
	O32 ABI.
	(BSS_SECTION_ASM_OP_32): Define.
	(BSS_SECTION_ASM_OP_64): Likewise.
	(BSS_SECTION_ASM_OP): Define differently for O32 and N32/N64 ABIs
	using them.
	(TARGET_ASM_NAMED_SECTION): Reflect renaming.
	Move up to allow override for O32 ABI without GNU as.
	(EH_FRAME_SECTION_NAME): Define explicitly.
	(MUST_USE_SJLJ_EXCEPTIONS): Define.
	[_MIPS_SIM == _ABIO32 && !GAS] (CTORS_SECTION_ASM_OP,
	DTORS_SECTION_ASM_OP): Dummy definitions.
	(TARGET_ASM_NAMED_SECTION): Undef statically.
	(EH_FRAME_SECTION_NAME): Likewise.
	(ASM_OUTPUT_FILENAME): Integrate mips.h version.
	(LINK_SPEC): Only use default options -call_shared -no_unresolved
	without -r.
	Don't pass -init, -fini with -mabi=32.
	(COLLECT_PARSE_FLAG): Define.

	* config/mips/mips.c (iris6_asm_named_section_1): Changed guard to
	TARGET_IRIX.
	Renamed to use irix_ prefix.
	(iris6_asm_named_section): Likewise.
	(iris_section_align_entry_eq): Likewise.
	(iris_section_align_entry_hash): Likewise.
	(iris6_file_start): Likewise.
	(iris6_section_align_1): Likewise.
	(iris6_file_end): Likewise.
	(iris6_section_type_flags): Likewise.
	(iris_section_align_htab): Likewise.
	(iris_orig_asm_out_file): Likewise.
	[TARGET_IRIX] (TARGET_ASM_FILE_START): Reflect rename.
	(TARGET_ASM_FILE_END): Likewise.
	(TARGET_SECTION_TYPE_FLAGS): Likewise.

	* config/mips/mips.c [TARGET_IRIX5 && !TARGET_IRIX6]
	(TARGET_ASM_UNALIGNED_HI_OP): Use runtime initialization in
	override_options instead.
	(TARGET_ASM_UNALIGNED_SI_OP): Likewise.
	(TARGET_ASM_UNALIGNED_DI_OP): Likewise.
	* config/mips/mips.c (override_options) [USE_COLLECT2]: Restore
	flag_gnu_linker to defaults without USE_COLLECT2 for non-IRIX O32
	assemblers.
	Likewise for constructor/destructor handling.
	(override_options): Handle IRIX O32 assembler quirks.
	[TARGET_IRIX] (irix_asm_named_section): Handle O32 ABI with and
	without gas.
	(mips_file_start): Use new TARGET_IRIX.
	(mips_declare_object_name): No special processing for IRIX O32
	assembler.
	(mips_finish_declare_object): Likewise.
	(irix_asm_output_align): Renamed from iris6_asm_output_align.
	Don't record alignment for O32 ABI.
	(irix_file_start): Renamed from iris6_file_start.
	Return early for O32 ABI.
	(irix_file_end): Renamed from iris6_file_end.
	Don't emit .section directives for O32 ABI.
	* config/mips/iris6.h (ASM_OUTPUT_ALIGN): Reflect renaming.
	* config/mips/mips-protos.h (irix_asm_output_align): Likewise.

	* config/mips/t-iris6 (MULTILIB_OPTIONS): Add mabi=32.
	(MULTILIB_OSDIRNAMES): Likewise.

From-SVN: r72600
parent 5f31e9bc
2003-10-17 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* config.gcc (mips-sgi-irix6*o32): Only enable use_collect2
without gas.
(mips-sgi-irix6*): Likewise.
* config/mips/iris6gas.h: New file.
* gcc/config.gcc (mips-sgi-irix6*): Use it.
* config/mips/mips.h (TARGET_IRIX): Provide default.
(TARGET_IRIX5): Likewise.
(TARGET_SGI_O32_AS): Likewise.
* config/mips/iris5.h (TARGET_IRIX): Redefine as 1.
(TARGET_IRIX5): Likewise.
* config/mips/iris6.h (TARGET_IRIX6): Remove.
(TARGET_IRIX5): Redefine as 0.
* config/mips/mips.c (mips_output_external): Test for IRIX 6 O32
linker workaround with TARGET_IRIX and mips_abi instead of
ASM_OUTPUT_UNDEF_FUNCTION.
(mips_file_end): Inline old ASM_OUTPUT_UNDEF_FUNCTION definition,
testing TARGET_IRIX and mips_abi explicitly.
* config/mips/iris5.h (ASM_OUTPUT_UNDEF_FUNCTION): Remove.
* config/mips/iris6.h (ASM_OUTPUT_UNDEF_FUNCTION): Remove undef.
* config/mips/mips.c (irix_output_external_libcall): Renamed from
mips_output_external_libcall.
Use new TARGET_IRIX in guard.
* config/mips/mips-protos.h (irix_output_external_libcall): Match
this.
* config/mips/iris5.h (TARGET_ASM_EXTERNAL_LIBCALL): Likewise.
* config/mips/iris5gas.h (HAVE_GAS_SHF_MERGE): Update comment.
Define as 0.
* config/mips/iris6.h (FUNCTION_NAME_ALREADY_DECLARED): Define
depending on mips_abi.
* config/mips/linux.h (FUNCTION_NAME_ALREADY_DECLARED): Define as 1.
* config/mips/mips.c (mips_output_function_prologue): Test
FUNCTION_NAME_ALREADY_DECLARED at runtime.
(mips_output_function_epilogue): Likewise.
(build_mips16_function_stub): Likewise.
(build_mips16_call_stub): Likewise.
* config/mips/mips.h (FUNCTION_NAME_ALREADY_DECLARED): Provide
default.
* config/mips/iris6.h (DWARF2_UNWIND_INFO): Don't define for native
IRIX 6 O32 assembler.
(SUBTARGET_CC1_SPEC): Enforce mips2 ISA with O32 ABI.
(TARGET_OS_CPP_BUILTINS): Define _ABIO32, use it to define
_MIPS_SIM for O32 ABI.
(DWARF2_FRAME_INFO): Don't define for native IRIX 6 O32 assembler.
(ASM_DECLARE_FUNCTION_NAME): Integrate mips.h version.
(ASM_DECLARE_FUNCTION_SIZE): Move undef before redefinition.
Integrate O32 version.
(SUBTARGET_ASM_SPEC): Handle -mabi=32.
(SUBTARGET_ASM_DEBUGGING_SPEC): Add mdebug_asm_spec for gas with
O32 ABI.
(BSS_SECTION_ASM_OP_32): Define.
(BSS_SECTION_ASM_OP_64): Likewise.
(BSS_SECTION_ASM_OP): Define differently for O32 and N32/N64 ABIs
using them.
(TARGET_ASM_NAMED_SECTION): Reflect renaming.
Move up to allow override for O32 ABI without GNU as.
(EH_FRAME_SECTION_NAME): Define explicitly.
(MUST_USE_SJLJ_EXCEPTIONS): Define.
[_MIPS_SIM == _ABIO32 && !GAS] (CTORS_SECTION_ASM_OP,
DTORS_SECTION_ASM_OP): Dummy definitions.
(TARGET_ASM_NAMED_SECTION): Undef statically.
(EH_FRAME_SECTION_NAME): Likewise.
(ASM_OUTPUT_FILENAME): Integrate mips.h version.
(LINK_SPEC): Only use default options -call_shared -no_unresolved
without -r.
Don't pass -init, -fini with -mabi=32.
(COLLECT_PARSE_FLAG): Define.
* config/mips/mips.c (iris6_asm_named_section_1): Changed guard to
TARGET_IRIX.
Renamed to use irix_ prefix.
(iris6_asm_named_section): Likewise.
(iris_section_align_entry_eq): Likewise.
(iris_section_align_entry_hash): Likewise.
(iris6_file_start): Likewise.
(iris6_section_align_1): Likewise.
(iris6_file_end): Likewise.
(iris6_section_type_flags): Likewise.
(iris_section_align_htab): Likewise.
(iris_orig_asm_out_file): Likewise.
[TARGET_IRIX] (TARGET_ASM_FILE_START): Reflect rename.
(TARGET_ASM_FILE_END): Likewise.
(TARGET_SECTION_TYPE_FLAGS): Likewise.
* config/mips/mips.c [TARGET_IRIX5 && !TARGET_IRIX6]
(TARGET_ASM_UNALIGNED_HI_OP): Use runtime initialization in
override_options instead.
(TARGET_ASM_UNALIGNED_SI_OP): Likewise.
(TARGET_ASM_UNALIGNED_DI_OP): Likewise.
* config/mips/mips.c (override_options) [USE_COLLECT2]: Restore
flag_gnu_linker to defaults without USE_COLLECT2 for non-IRIX O32
assemblers.
Likewise for constructor/destructor handling.
(override_options): Handle IRIX O32 assembler quirks.
[TARGET_IRIX] (irix_asm_named_section): Handle O32 ABI with and
without gas.
(mips_file_start): Use new TARGET_IRIX.
(mips_declare_object_name): No special processing for IRIX O32
assembler.
(mips_finish_declare_object): Likewise.
(irix_asm_output_align): Renamed from iris6_asm_output_align.
Don't record alignment for O32 ABI.
(irix_file_start): Renamed from iris6_file_start.
Return early for O32 ABI.
(irix_file_end): Renamed from iris6_file_end.
Don't emit .section directives for O32 ABI.
* config/mips/iris6.h (ASM_OUTPUT_ALIGN): Reflect renaming.
* config/mips/mips-protos.h (irix_asm_output_align): Likewise.
* config/mips/t-iris6 (MULTILIB_OPTIONS): Add mabi=32.
(MULTILIB_OSDIRNAMES): Likewise.
2003-10-17 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* collect2.c (COLLECT_PARSE_FLAG): Provide default.
(main): Use it.
* doc/tm.texi (COLLECT_PARSE_FLAG): Document it.
......
......@@ -1377,7 +1377,10 @@ mips-sgi-irix6*o32) # SGI System V.4., IRIX 6, O32 ABI
target_cpu_default="MASK_ABICALLS"
# mips-tfile doesn't work yet
# See comment in mips/iris5.h file.
use_collect2=yes
if test x$gas = xno
then
use_collect2=yes
fi
# if test x$enable_threads = xyes; then
# thread_file='irix'
# fi
......@@ -1385,6 +1388,10 @@ mips-sgi-irix6*o32) # SGI System V.4., IRIX 6, O32 ABI
;;
mips-sgi-irix6*) # SGI System V.4., IRIX 6
tm_file="${tm_file} mips/iris5.h mips/iris6.h"
if test x$gas = xyes
then
tm_file="${tm_file} mips/iris6gas.h"
fi
if test "x$gnu_ld" = xyes
then
tm_file="${tm_file} mips/iris6gld.h"
......@@ -1392,6 +1399,12 @@ mips-sgi-irix6*) # SGI System V.4., IRIX 6
tmake_file="mips/t-iris mips/t-iris5-6 mips/t-iris6"
target_cpu_default="MASK_ABICALLS|MASK_FLOAT64|MASK_64BIT"
tm_defines="MIPS_ISA_DEFAULT=3 MIPS_ABI_DEFAULT=ABI_N32"
# See comment in mips/iris5.h file. Only enabled for O32 ABI
# without GNU as.
if test x$gas = xno
then
use_collect2=yes
fi
# if test x$enable_threads = xyes; then
# thread_file='irix'
# fi
......
......@@ -19,6 +19,12 @@ along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* We are compiling for IRIX now. */
#undef TARGET_IRIX
#define TARGET_IRIX 1
/* Allow some special handling for IRIX 5. */
#undef TARGET_IRIX5
#define TARGET_IRIX5 1
#define ABICALLS_ASM_OP "\t.option pic2"
......@@ -203,20 +209,9 @@ do { \
fputs ("\n", (FILE)); \
} while (0)
/* In IRIX 5, we must output a `.global name .text' directive for every used
but undefined function. If we don't, the linker may perform an optimization
(skipping over the insns that set $gp) when it is unsafe. This is used
indirectly by ASM_OUTPUT_EXTERNAL. */
#define ASM_OUTPUT_UNDEF_FUNCTION(FILE, NAME) \
do { \
fputs ("\t.globl ", FILE); \
assemble_name (FILE, NAME); \
fputs (" .text\n", FILE); \
} while (0)
/* Also do this for libcalls. */
#undef TARGET_ASM_EXTERNAL_LIBCALL
#define TARGET_ASM_EXTERNAL_LIBCALL mips_output_external_libcall
#define TARGET_ASM_EXTERNAL_LIBCALL irix_output_external_libcall
/* This does for functions what ASM_DECLARE_OBJECT_NAME does for variables.
This is used indirectly by ASM_OUTPUT_EXTERNAL. */
......
......@@ -76,5 +76,8 @@ do { \
#define NM_FLAGS "-Bng"
/* Disable SHF_MERGE support. Even if gas supports it, the IRIX ld does not
without a special elspec(5) file. */
without a special elspec(5) file.
FIXME: Only do this if not using GNU ld. */
#undef HAVE_GAS_SHF_MERGE
#define HAVE_GAS_SHF_MERGE 0
......@@ -19,16 +19,18 @@ along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* Let mips.c know we need the IRIX 6 functions. */
#define TARGET_IRIX6 1
/* No more special IRIX 5 handling. */
#undef TARGET_IRIX5
#define TARGET_IRIX5 0
/* Default to -mabi=n32 and -mips3. */
#undef MULTILIB_DEFAULTS
#define MULTILIB_DEFAULTS { "mabi=n32" }
/* IRIX 6 assembler does handle DWARF2 directives. Override setting in
iris5.h file. */
/* The IRIX 6 O32 assembler cannot calculate label differences, while both
the N32/N64 assembler and gas can. Override setting in iris5.h file. */
#undef DWARF2_UNWIND_INFO
#define DWARF2_UNWIND_INFO !TARGET_SGI_O32_AS
/* The IRIX 6 assembler will sometimes assign labels to the wrong
section unless the labels are within .ent/.end blocks. Therefore,
......@@ -54,8 +56,9 @@ Boston, MA 02111-1307, USA. */
/* For IRIX 6, -mabi=64 implies TARGET_LONG64. */
/* This is handled in override_options. */
/* Default to the mips2 ISA for the O32 ABI. */
#undef SUBTARGET_CC1_SPEC
#define SUBTARGET_CC1_SPEC ""
#define SUBTARGET_CC1_SPEC "%{mabi=32: %{!mips*: -mips2}}"
/* #line directives let the O32 assembler create object files that cause the
O32 linker to crash. */
......@@ -91,7 +94,8 @@ Boston, MA 02111-1307, USA. */
\
if (mips_abi == ABI_32) \
{ \
builtin_define ("_MIPS_SIM=_MIPS_SIM_ABI32"); \
builtin_define ("_ABIO32=1"); \
builtin_define ("_MIPS_SIM=_ABIO32"); \
builtin_define ("_MIPS_SZLONG=32"); \
builtin_define ("_MIPS_SZPTR=32"); \
} \
......@@ -151,7 +155,7 @@ Boston, MA 02111-1307, USA. */
/* Force the generation of dwarf .debug_frame sections even if not
compiling -g. This guarantees that we can unwind the stack. */
#define DWARF2_FRAME_INFO 1
#define DWARF2_FRAME_INFO !TARGET_SGI_O32_AS
/* The size in bytes of a DWARF field indicating an offset or length
relative to a debug info section, specified to be 4 bytes in the DWARF-2
......@@ -180,11 +184,6 @@ Boston, MA 02111-1307, USA. */
#undef MACHINE_TYPE
#define MACHINE_TYPE "SGI running IRIX 6.x"
/* IRIX 5 stuff that we don't need for IRIX 6. */
/* ??? We do need this for the -mabi=32 switch though. */
#undef ASM_OUTPUT_UNDEF_FUNCTION
#undef ASM_DECLARE_FUNCTION_SIZE
/* Stuff we need for IRIX 6 that isn't in IRIX 5. */
/* The SGI assembler doesn't like labels before the .ent, so we must output
......@@ -193,25 +192,38 @@ Boston, MA 02111-1307, USA. */
#undef ASM_DECLARE_FUNCTION_NAME
#define ASM_DECLARE_FUNCTION_NAME(STREAM, NAME, DECL) \
do { \
fputs ("\t.ent\t", STREAM); \
assemble_name (STREAM, NAME); \
fputs ("\n", STREAM); \
assemble_name (STREAM, NAME); \
fputs (":\n", STREAM); \
if (mips_abi != ABI_32) \
{ \
fputs ("\t.ent\t", STREAM); \
assemble_name (STREAM, NAME); \
fputs ("\n", STREAM); \
assemble_name (STREAM, NAME); \
fputs (":\n", STREAM); \
} \
} while (0)
/* Likewise, the SGI assembler doesn't like labels after the .end, so we
must output the .end here. */
#undef ASM_DECLARE_FUNCTION_SIZE
#define ASM_DECLARE_FUNCTION_SIZE(STREAM, NAME, DECL) \
do { \
fputs ("\t.end\t", STREAM); \
assemble_name (STREAM, NAME); \
fputs ("\n", STREAM); \
if (mips_abi == ABI_32) \
{ \
tree name_tree = get_identifier (NAME); \
TREE_ASM_WRITTEN (name_tree) = 1; \
} \
else \
{ \
fputs ("\t.end\t", STREAM); \
assemble_name (STREAM, NAME); \
fputs ("\n", STREAM); \
} \
} while (0)
/* Tell function_prologue in mips.c that we have already output the .ent/.end
pseudo-ops. */
#define FUNCTION_NAME_ALREADY_DECLARED
#undef FUNCTION_NAME_ALREADY_DECLARED
#define FUNCTION_NAME_ALREADY_DECLARED (mips_abi != ABI_32)
#undef SET_ASM_OP /* Has no equivalent. See ASM_OUTPUT_DEF below. */
......@@ -248,7 +260,7 @@ Boston, MA 02111-1307, USA. */
on the mipsX option. */
/* If no mips[3,4] option given, give the appropriate default for mabi=X */
#undef SUBTARGET_ASM_SPEC
#define SUBTARGET_ASM_SPEC "%{!mabi*:-n32} %{!mips*: %{!mabi*:-mips3} %{mabi=n32|mabi=64:-mips3}}"
#define SUBTARGET_ASM_SPEC "%{!mabi*:-n32} %{mabi=32:-32} %{!mips*: %{!mabi*:-mips3} %{mabi=32:-mips2} %{mabi=n32|mabi=64:-mips3}}"
/* Must pass -g0 to the assembler, otherwise it may overwrite our
debug info with its own debug info. */
......@@ -262,7 +274,7 @@ Boston, MA 02111-1307, USA. */
#define SUBTARGET_MIPS_AS_ASM_SPEC "%{v:-show} -G 0 -w"
#undef SUBTARGET_ASM_DEBUGGING_SPEC
#define SUBTARGET_ASM_DEBUGGING_SPEC "-g0"
#define SUBTARGET_ASM_DEBUGGING_SPEC "-g0 %(mdebug_asm_spec)"
/* The MIPS assembler occasionally misoptimizes. Since GCC should be
doing scheduling anyhow, just turn off optimization in the assembler. */
......@@ -275,7 +287,12 @@ Boston, MA 02111-1307, USA. */
and dtor lists this way, so we use -init and -fini to invoke the
do_global_* functions instead of running collect2. */
#define BSS_SECTION_ASM_OP "\t.section\t.bss"
#define BSS_SECTION_ASM_OP_32 "\t.data"
#define BSS_SECTION_ASM_OP_64 "\t.section\t.bss"
#define BSS_SECTION_ASM_OP \
(mips_abi != ABI_32 && mips_abi != ABI_O64 \
? BSS_SECTION_ASM_OP_64 \
: BSS_SECTION_ASM_OP_32)
#undef READONLY_DATA_SECTION_ASM_OP
#define READONLY_DATA_SECTION_ASM_OP_32 "\t.rdata"
......@@ -285,8 +302,41 @@ Boston, MA 02111-1307, USA. */
? READONLY_DATA_SECTION_ASM_OP_64 \
: READONLY_DATA_SECTION_ASM_OP_32)
/* Switch into a generic section. */
#undef TARGET_ASM_NAMED_SECTION
#define TARGET_ASM_NAMED_SECTION irix_asm_named_section
/* The default definition in defaults.h cannot cope with the runtime-variable
definition of DWARF2_UNWIND_INFO above, so define here explicitly. */
#define EH_FRAME_SECTION_NAME ".eh_frame"
/* MUST_USE_SJLJ_EXCEPTIONS has the same problem. */
#define MUST_USE_SJLJ_EXCEPTIONS (DWARF2_UNWIND_INFO == 0)
/* The native IRIX 6 O32 assembler doesn't support named sections, while
the N32/N64 assembler does. We need crt{begin, end}.o for the N32/N64
ABIs, but there's no way to disable them for just one multilib.
Therefore we provide dummy definitions to allow crtstuff.c to compile,
but the resulting files are not used for the O32 ABI. */
#if (defined _ABIO32 && _MIPS_SIM == _ABIO32) \
&& ((TARGET_CPU_DEFAULT | TARGET_DEFAULT) & MASK_GAS) == 0
/* Provide dummy definitions. */
#define CTORS_SECTION_ASM_OP ""
#define DTORS_SECTION_ASM_OP ""
/* Undef so JCR_SECTION_NAME isn't defined and __JCR_{LIST, END}__ are not
used. */
#undef TARGET_ASM_NAMED_SECTION
/* Undef so __EH_FRAME_BEGIN__/__FRAME_END__ are not used. */
#undef EH_FRAME_SECTION_NAME
#endif /* _MIPS_SIM == _ABIO32 && !GAS */
/* Define functions to read the name and flags of the current section.
They are used by iris6_asm_output_align. */
They are used by irix_asm_output_align. */
#undef EXTRA_SECTION_FUNCTIONS
#define EXTRA_SECTION_FUNCTIONS \
......@@ -325,13 +375,9 @@ current_section_flags (void) \
abort (); \
}
/* Switch into a generic section. */
#undef TARGET_ASM_NAMED_SECTION
#define TARGET_ASM_NAMED_SECTION iris6_asm_named_section
/* SGI assembler needs all sorts of extra help to do alignment properly. */
#undef ASM_OUTPUT_ALIGN
#define ASM_OUTPUT_ALIGN iris6_asm_output_align
#define ASM_OUTPUT_ALIGN irix_asm_output_align
#undef MAX_OFILE_ALIGNMENT
#define MAX_OFILE_ALIGNMENT (32768*8)
......@@ -343,7 +389,10 @@ current_section_flags (void) \
#define ASM_OUTPUT_FILENAME(STREAM, NUM_SOURCE_FILENAMES, NAME) \
do \
{ \
fprintf (STREAM, "\t#.file\t%d ", NUM_SOURCE_FILENAMES); \
if (mips_abi == ABI_32) \
fprintf (STREAM, "\t.file\t%d ", NUM_SOURCE_FILENAMES); \
else \
fprintf (STREAM, "\t#.file\t%d ", NUM_SOURCE_FILENAMES); \
output_quoted_string (STREAM, NAME); \
fputs ("\n", STREAM); \
} \
......@@ -457,10 +506,19 @@ while (0)
%{G*} %{EB} %{EL} %{mips1} %{mips2} %{mips3} %{mips4} \
%{bestGnum} %{shared} %{non_shared} \
%{call_shared} %{no_archive} %{exact_version} %{w} \
%{!shared: %{!non_shared: %{!call_shared: -call_shared -no_unresolved}}} \
%{rpath} -init __do_global_ctors -fini __do_global_dtors \
%{!shared: %{!non_shared: %{!call_shared:%{!r: -call_shared -no_unresolved}}}} \
%{rpath} %{!mabi=32: -init __do_global_ctors -fini __do_global_dtors} \
%{shared:-hidden_symbol __do_global_ctors,__do_global_ctors_1,__do_global_dtors} \
-_SYSTYPE_SVR4 -woff 131 \
%{mabi=32: -32}%{mabi=n32: -n32}%{mabi=64: -64}%{!mabi*: -n32}"
/* We need to disable collecting for the N32 and N64 ABIs. */
#define COLLECT_PARSE_FLAG(FLAG) \
do { \
if (! strcmp (FLAG, "-n32") || ! strcmp (FLAG, "-64")) \
do_collecting = 0; \
if (! strcmp (FLAG, "-32") || ! strcmp (FLAG, "-o32")) \
do_collecting = 1; \
} while (0)
#define MIPS_TFMODE_FORMAT mips_extended_format
/* Definitions of target machine for GNU compiler. IRIX 6 with GNU as. */
/* Override mips.h version to match DWARF 2 default. */
#undef MDEBUG_ASM_SPEC
#define MDEBUG_ASM_SPEC "%{gstabs*|gcoff*:-mdebug} \
%{!gstabs*:%{!gcoff*:-no-mdebug}}"
/* Override iris6.h version to always use -init/-fini.
FIXME: integrate those use separate spec/define for this? */
#undef LINK_SPEC
#define LINK_SPEC "\
%{G*} %{EB} %{EL} %{mips1} %{mips2} %{mips3} %{mips4} \
%{bestGnum} %{shared} %{non_shared} \
%{call_shared} %{no_archive} %{exact_version} %{w} \
%{!shared: %{!non_shared: %{!call_shared:%{!r: -call_shared -no_unresolved}}}} \
%{rpath} -init __do_global_ctors -fini __do_global_dtors \
%{shared:-hidden_symbol __do_global_ctors,__do_global_ctors_1,__do_global_dtors} \
-_SYSTYPE_SVR4 -woff 131 \
%{mabi=32: -32}%{mabi=n32: -n32}%{mabi=64: -64}%{!mabi*: -n32}"
/* Disable SHF_MERGE support. Even if gas supports it, the IRIX 6 O32 ld
does not without a special elspec(5) file.
FIXME: Only do this if not using GNU ld. */
#if HAVE_GAS_SHF_MERGE
#undef HAVE_GAS_SHF_MERGE
#define HAVE_GAS_SHF_MERGE (mips_abi != ABI_32)
#endif /* HAVE_GAS_SHF_MERGE */
/* There's no need to perform collecting with GNU as. */
#undef COLLECT_PARSE_FLAG
......@@ -171,7 +171,7 @@ Boston, MA 02111-1307, USA. */
/* Tell function_prologue in mips.c that we have already output the .ent/.end
pseudo-ops. */
#define FUNCTION_NAME_ALREADY_DECLARED
#define FUNCTION_NAME_ALREADY_DECLARED 1
#define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL) \
(flag_pic \
......
......@@ -98,8 +98,8 @@ extern HOST_WIDE_INT mips_debugger_offset (rtx, HOST_WIDE_INT);
extern void print_operand (FILE *, rtx, int);
extern void print_operand_address (FILE *, rtx);
extern int mips_output_external (FILE *, tree, const char *);
#if TARGET_IRIX5 || TARGET_IRIX6
extern void mips_output_external_libcall (rtx);
#if TARGET_IRIX
extern void irix_output_external_libcall (rtx);
#endif
extern void mips_output_filename (FILE *, const char *);
extern void mips_output_lineno (FILE *, int);
......@@ -141,7 +141,7 @@ extern unsigned int mips_hard_regno_nregs (int, enum machine_mode);
extern int mips_return_in_memory (tree);
extern const char *mips_emit_prefetch (rtx *);
extern void iris6_asm_output_align (FILE *, unsigned);
extern void irix_asm_output_align (FILE *, unsigned);
extern const char *current_section_name (void);
extern unsigned int current_section_flags (void);
......
......@@ -336,6 +336,11 @@ extern const struct mips_cpu_info *mips_tune_info;
#define TARGET_NEWABI (mips_abi == ABI_N32 || mips_abi == ABI_64)
/* IRIX specific stuff. */
#define TARGET_IRIX 0
#define TARGET_IRIX5 0
#define TARGET_SGI_O32_AS (TARGET_IRIX && mips_abi == ABI_32 && !TARGET_GAS)
/* Define preprocessor macros for the -march and -mtune options.
PREFIX is either _MIPS_ARCH or _MIPS_TUNE, INFO is the selected
processor. If INFO's canonical name is "foo", define PREFIX to
......@@ -3276,7 +3281,6 @@ while (0)
#define ASM_OUTPUT_EXTERNAL(STREAM,DECL,NAME) \
mips_output_external(STREAM,DECL,NAME)
/* This is how to declare a function name. The actual work of
emitting the label is moved to function_prologue, so that we can
get the line number correctly emitted before the .ent directive,
......@@ -3286,6 +3290,10 @@ while (0)
#undef ASM_DECLARE_FUNCTION_NAME
#define ASM_DECLARE_FUNCTION_NAME(STREAM,NAME,DECL)
#ifndef FUNCTION_NAME_ALREADY_DECLARED
#define FUNCTION_NAME_ALREADY_DECLARED 0
#endif
/* This is how to store into the string LABEL
the symbol_ref name of an internal numbered label where
PREFIX is the class of label and NUM is the number within the class.
......
# ??? If no mabi=X option given, but a mipsX option is, then should deal
# with that.
# ??? mabi=32 is deliberately left off the list because it doesn't work yet.
MULTILIB_OPTIONS=mabi=n32/mabi=64
MULTILIB_OPTIONS=mabi=32/mabi=n32/mabi=64
MULTILIB_DIRNAMES=
MULTILIB_MATCHES=
MULTILIB_OSDIRNAMES=. mabi=64
MULTILIB_OSDIRNAMES=mabi=32 . mabi=64
LIBGCC = stmp-multilib
INSTALL_LIBGCC = install-multilib
......
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