Module Name: src
Committed By: matt
Date: Sat Sep 5 02:59:59 UTC 2009
Modified Files:
src/regress/lib/csu/initfini/arch/mips [matt-nb5-mips64]:
initfini_asm.S
Log Message:
Teach this about N32/N64
To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.3.48.1 \
src/regress/lib/csu/initfini/arch/mips/initfini_asm.S
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/regress/lib/csu/initfini/arch/mips/initfini_asm.S
diff -u src/regress/lib/csu/initfini/arch/mips/initfini_asm.S:1.3 src/regress/lib/csu/initfini/arch/mips/initfini_asm.S:1.3.48.1
--- src/regress/lib/csu/initfini/arch/mips/initfini_asm.S:1.3 Thu Aug 16 04:06:35 2001
+++ src/regress/lib/csu/initfini/arch/mips/initfini_asm.S Sat Sep 5 02:59:59 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: initfini_asm.S,v 1.3 2001/08/16 04:06:35 mhitch Exp $ */
+/* $NetBSD: initfini_asm.S,v 1.3.48.1 2009/09/05 02:59:59 matt Exp $ */
/*
* This file placed in the public domain.
@@ -7,24 +7,42 @@
#include <mips/asm.h>
- .abicalls
-
+#if defined(__mips_o32) || defined(__mips_o64)
.section .init, "ax", @progbits
.set noreorder
- la t9, 1f
+ PTR_LA t9, 1f
1: .cpload t9
.set reorder
.cprestore
- la t9, i_am_init
+ PTR_LA t9, i_am_init
jal t9
.previous
.section .fini, "ax", @progbits
.set noreorder
- la t9, 2f
+ PTR_LA t9, 2f
2: .cpload t9
.set reorder
.cprestore
- la t9, i_am_fini
+ PTR_LA t9, i_am_fini
+ jal t9
+ .previous
+#else
+ /*
+ * In N32/N64, gp is preserved across function calls.
+ */
+ .section .init, "ax", @progbits
+ .set noreorder
+ PTR_LA t9, i_am_init
jal t9
+ nop
.previous
+
+ .section .fini, "ax", @progbits
+ .set noreorder
+ PTR_LA t9, i_am_fini
+ jal t9
+ nop
+ .previous
+#endif
+