Commit 21b807f1 by Richard Sandiford Committed by Richard Sandiford

config.gcc (mips-sgi-irix6*): Add t-iris6gld to tmake_file when using GNU ld.

	* config.gcc (mips-sgi-irix6*): Add t-iris6gld to tmake_file when
	using GNU ld.
	* config/mips/iris6.h (IRIX6_STARTFILE_SPEC): New, taking the
	whole of the previous STARTFILE_SPEC except crtbegin.o%s.
	(IRIX6_ENDFILE_SPEC): Likewise ENDFILE_SPEC and crtend.o%s.
	(STARTFILE_SPEC, ENDFILE_SPEC): Define in terms of the above.
	(SUBTARGET_EXTRA_SPECS): Define.
	* config/mips/iris6gld.h (LINK_SPEC): Change -init function
	to __gcc_init and -fini function to __gcc_fini.
	(STARTFILE_SPEC): Redefine, including irix6-crti.o before crtbegin.o.
	(ENDFILE_SPEC): Likewise, including irix6-crtn.o after crtend.o.
	(INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP): Define.
	* config/mips/t-iris6gld,
	* config/mips/irix6-crti.asm,
	* config/mips/irix6-crtn.asm: New files.

From-SVN: r73891
parent e13e48e7
2003-11-24 Richard Sandiford <rsandifo@redhat.com>
* config.gcc (mips-sgi-irix6*): Add t-iris6gld to tmake_file when
using GNU ld.
* config/mips/iris6.h (IRIX6_STARTFILE_SPEC): New, taking the
whole of the previous STARTFILE_SPEC except crtbegin.o%s.
(IRIX6_ENDFILE_SPEC): Likewise ENDFILE_SPEC and crtend.o%s.
(STARTFILE_SPEC, ENDFILE_SPEC): Define in terms of the above.
(SUBTARGET_EXTRA_SPECS): Define.
* config/mips/iris6gld.h (LINK_SPEC): Change -init function
to __gcc_init and -fini function to __gcc_fini.
(STARTFILE_SPEC): Redefine, including irix6-crti.o before crtbegin.o.
(ENDFILE_SPEC): Likewise, including irix6-crtn.o after crtend.o.
(INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP): Define.
* config/mips/t-iris6gld,
* config/mips/irix6-crti.asm,
* config/mips/irix6-crtn.asm: New files.
2003-11-24 Eric Christopher <echristo@redhat.com> 2003-11-24 Eric Christopher <echristo@redhat.com>
PR C/13014 PR C/13014
......
...@@ -1418,6 +1418,7 @@ mips-sgi-irix6*o32) # SGI System V.4., IRIX 6, O32 ABI ...@@ -1418,6 +1418,7 @@ mips-sgi-irix6*o32) # SGI System V.4., IRIX 6, O32 ABI
;; ;;
mips-sgi-irix6*) # SGI System V.4., IRIX 6 mips-sgi-irix6*) # SGI System V.4., IRIX 6
tm_file="${tm_file} mips/iris5.h mips/iris6.h" tm_file="${tm_file} mips/iris5.h mips/iris6.h"
tmake_file="mips/t-iris mips/t-iris5-6 mips/t-iris6"
if test x$gas = xyes if test x$gas = xyes
then then
tm_file="${tm_file} mips/iris6gas.h" tm_file="${tm_file} mips/iris6gas.h"
...@@ -1425,8 +1426,8 @@ mips-sgi-irix6*) # SGI System V.4., IRIX 6 ...@@ -1425,8 +1426,8 @@ mips-sgi-irix6*) # SGI System V.4., IRIX 6
if test "x$gnu_ld" = xyes if test "x$gnu_ld" = xyes
then then
tm_file="${tm_file} mips/iris6gld.h" tm_file="${tm_file} mips/iris6gld.h"
tmake_file="$tmake_file mips/t-iris6gld"
fi fi
tmake_file="mips/t-iris mips/t-iris5-6 mips/t-iris6"
target_cpu_default="MASK_ABICALLS|MASK_FLOAT64|MASK_64BIT" target_cpu_default="MASK_ABICALLS|MASK_FLOAT64|MASK_64BIT"
tm_defines="MIPS_ISA_DEFAULT=3 MIPS_ABI_DEFAULT=ABI_N32" tm_defines="MIPS_ISA_DEFAULT=3 MIPS_ABI_DEFAULT=ABI_N32"
# See comment in mips/iris5.h file. Only enabled for O32 ABI # See comment in mips/iris5.h file. Only enabled for O32 ABI
......
...@@ -436,8 +436,7 @@ while (0) ...@@ -436,8 +436,7 @@ while (0)
/* Profiling is supported via libprof1.a not -lc_p as in IRIX 3. */ /* Profiling is supported via libprof1.a not -lc_p as in IRIX 3. */
/* ??? If no mabi=X option give, but a mipsX option is, then should depend /* ??? If no mabi=X option give, but a mipsX option is, then should depend
on the mipsX option. */ on the mipsX option. */
#undef STARTFILE_SPEC #define IRIX6_STARTFILE_SPEC \
#define STARTFILE_SPEC \
"%{!shared: \ "%{!shared: \
%{mabi=32:%{pg:gcrt1.o%s} \ %{mabi=32:%{pg:gcrt1.o%s} \
%{!pg:%{p:mcrt1.o%s libprof1.a%s}%{!p:crt1.o%s}}} \ %{!pg:%{p:mcrt1.o%s libprof1.a%s}%{!p:crt1.o%s}}} \
...@@ -461,8 +460,10 @@ while (0) ...@@ -461,8 +460,10 @@ while (0)
%{!p:/usr/lib32/mips4/crt1.o%s}}} \ %{!p:/usr/lib32/mips4/crt1.o%s}}} \
%{!mips4:%{pg:/usr/lib32/mips3/gcrt1.o%s} \ %{!mips4:%{pg:/usr/lib32/mips3/gcrt1.o%s} \
%{!pg:%{p:/usr/lib32/mips3/mcrt1.o%s /usr/lib32/mips3/libprof1.a%s} \ %{!pg:%{p:/usr/lib32/mips3/mcrt1.o%s /usr/lib32/mips3/libprof1.a%s} \
%{!p:/usr/lib32/mips3/crt1.o%s}}}}} \ %{!p:/usr/lib32/mips3/crt1.o%s}}}}}"
crtbegin.o%s"
#undef STARTFILE_SPEC
#define STARTFILE_SPEC "%(irix6_startfile_spec) crtbegin.o%s"
#undef LIB_SPEC #undef LIB_SPEC
#define LIB_SPEC \ #define LIB_SPEC \
...@@ -481,10 +482,8 @@ while (0) ...@@ -481,10 +482,8 @@ while (0)
/* ??? If no mabi=X option give, but a mipsX option is, then should depend /* ??? If no mabi=X option give, but a mipsX option is, then should depend
on the mipsX option. */ on the mipsX option. */
#undef ENDFILE_SPEC #define IRIX6_ENDFILE_SPEC \
#define ENDFILE_SPEC \ "%{!shared: \
"crtend.o%s \
%{!shared: \
%{mabi=32:crtn.o%s}\ %{mabi=32:crtn.o%s}\
%{mabi=n32:%{mips4:/usr/lib32/mips4/crtn.o%s}\ %{mabi=n32:%{mips4:/usr/lib32/mips4/crtn.o%s}\
%{!mips4:/usr/lib32/mips3/crtn.o%s}}\ %{!mips4:/usr/lib32/mips3/crtn.o%s}}\
...@@ -493,6 +492,9 @@ while (0) ...@@ -493,6 +492,9 @@ while (0)
%{!mabi*:%{mips4:/usr/lib32/mips4/crtn.o%s}\ %{!mabi*:%{mips4:/usr/lib32/mips4/crtn.o%s}\
%{!mips4:/usr/lib32/mips3/crtn.o%s}}}" %{!mips4:/usr/lib32/mips3/crtn.o%s}}}"
#undef ENDFILE_SPEC
#define ENDFILE_SPEC "crtend.o%s %(irix6_endfile_spec)"
/* ??? If no mabi=X option give, but a mipsX option is, then should depend /* ??? If no mabi=X option give, but a mipsX option is, then should depend
on the mipsX option. */ on the mipsX option. */
#undef LINK_SPEC #undef LINK_SPEC
...@@ -516,3 +518,8 @@ do { \ ...@@ -516,3 +518,8 @@ do { \
} while (0) } while (0)
#define MIPS_TFMODE_FORMAT mips_extended_format #define MIPS_TFMODE_FORMAT mips_extended_format
#undef SUBTARGET_EXTRA_SPECS
#define SUBTARGET_EXTRA_SPECS \
{ "irix6_startfile_spec", IRIX6_STARTFILE_SPEC }, \
{ "irix6_endfile_spec", IRIX6_ENDFILE_SPEC },
...@@ -44,8 +44,17 @@ Boston, MA 02111-1307, USA. */ ...@@ -44,8 +44,17 @@ Boston, MA 02111-1307, USA. */
%{static: -non_shared} \ %{static: -non_shared} \
%{!static: \ %{!static: \
%{!shared: %{!non_shared: %{!call_shared: -call_shared}}}} \ %{!shared: %{!non_shared: %{!call_shared: -call_shared}}}} \
%{rpath} -init __do_global_ctors -fini __do_global_dtors \ %{rpath} -init __gcc_init -fini __gcc_fini \
%{mabi=32: -melf32bsmip}%{mabi=n32: -melf32bmipn32}%{mabi=64: -melf64bmip}%{!mabi*: -melf32bmipn32}" %{mabi=32: -melf32bsmip}%{mabi=n32: -melf32bmipn32}%{mabi=64: -melf64bmip}%{!mabi*: -melf32bmipn32}"
#undef STARTFILE_SPEC
#define STARTFILE_SPEC "%(irix6_startfile_spec) irix6-crti.o%s crtbegin.o%s"
#undef ENDFILE_SPEC
#define ENDFILE_SPEC "crtend.o%s irix6-crtn.o%s %(irix6_endfile_spec)"
/* The GNU linker supports one-only sections. */ /* The GNU linker supports one-only sections. */
#define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1) #define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
#define INIT_SECTION_ASM_OP "\t.section\t.init,0x1,0x6,4,4"
#define FINI_SECTION_ASM_OP "\t.section\t.fini,0x1,0x6,4,4"
.abicalls
.set noreorder
.set nomacro
.section .init,0x1,0x6,4,4
jr $31
nop
.globl __gcc_init
__gcc_init:
#if _MIPS_SIM == _ABIO32
addiu $sp,$sp,-16
sw $31,0($sp)
#else
daddiu $sp,$sp,-16
sd $31,0($sp)
sd $28,8($sp)
#endif
.section .fini,0x1,0x6,4,4
jr $31
nop
.globl __gcc_fini
__gcc_fini:
#if _MIPS_SIM == _ABIO32
addiu $sp,$sp,-16
sw $31,0($sp)
#else
daddiu $sp,$sp,-16
sd $31,0($sp)
sd $28,8($sp)
#endif
.abicalls
.set noreorder
.set nomacro
.section .init,0x1,0x6,4,4
#if _MIPS_SIM == _ABIO32
lw $31,0($sp)
jr $31
addiu $sp,$sp,16
#else
ld $31,0($sp)
ld $28,8($sp)
jr $31
daddiu $sp,$sp,16
#endif
.section .fini,0x1,0x6,4,4
#if _MIPS_SIM == _ABIO32
lw $31,0($sp)
jr $31
addiu $sp,$sp,16
#else
ld $31,0($sp)
ld $28,8($sp)
jr $31
daddiu $sp,$sp,16
#endif
$(T)irix6-crti.o: $(srcdir)/config/mips/irix6-crti.asm $(GCC_PASSES)
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
-c -o $@ -x assembler-with-cpp $<
$(T)irix6-crtn.o: $(srcdir)/config/mips/irix6-crtn.asm $(GCC_PASSES)
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
-c -o $@ -x assembler-with-cpp $<
EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o irix6-crti.o irix6-crtn.o
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