+2003-12-06 Ulrich Drepper <drepper@redhat.com>
+
+ * sysdeps/unix/sysv/linux/ia64/pt-initfini.c: Use .init_array
+ instead of .init. Patch by David Mosberger.
+
2003-11-30 Thorsten Kukuk <kukuk@suse.de>
* sysdeps/pthread/configure.in: Remove broken declaration in C
* crtn.s puts the corresponding function epilogues
in the .init and .fini sections. */
+#include <stddef.h>
+
+#ifdef HAVE_INITFINI_ARRAY
+
+__asm__ ("\n\
+#include \"defs.h\"\n\
+\n\
+/*@HEADER_ENDS*/\n\
+\n\
+/*@_init_PROLOG_BEGINS*/\n\
+ .xdata8 \".init_array\",@fptr(__pthread_initialize_minimal_internal)\n\
+/*@_init_PROLOG_ENDS*/\n\
+");
+
+#else
+
__asm__ ("\n\
\n\
#include \"defs.h\"\n\
.global _init#\n\
.proc _init#\n\
_init:\n\
+ .prologue\n\
+ .save ar.pfs, r34\n\
alloc r34 = ar.pfs, 0, 3, 0, 0\n\
+ .vframe r32\n\
mov r32 = r12\n\
+ .save rp, r33\n\
mov r33 = b0\n\
+ .body\n\
adds r12 = -16, r12\n\
;;\n\
-/* we could use r35 to save gp, but we use the stack since that's what\n\
- * all the other init routines will do --davidm 00/04/05 */\n\
st8 [r12] = gp, -16\n\
br.call.sptk.many b0 = __pthread_initialize_minimal_internal# ;;\n\
;;\n\
;;\n\
ld8 gp = [r12]\n\
;;\n\
- .align 16\n\
.endp _init#\n\
\n\
/*@_init_PROLOG_ENDS*/\n\
.global _fini#\n\
.proc _fini#\n\
_fini:\n\
+ .prologue\n\
+ .save ar.pfs, r34\n\
alloc r34 = ar.pfs, 0, 3, 0, 0\n\
+ .vframe r32\n\
mov r32 = r12\n\
+ .save rp, r33\n\
mov r33 = b0\n\
+ .body\n\
adds r12 = -16, r12\n\
;;\n\
- .align 16\n\
.endp _fini#\n\
\n\
/*@_fini_PROLOG_ENDS*/\n\
/*@TRAILER_BEGINS*/\n\
.weak __gmon_start__#\n\
");
+
+#endif