+2003-05-07 David Mosberger <davidm@hpl.hp.com>
+
+ * config/ia64/crtbegin.asm (__do_jv_register_classes): Don't
+ forget to preserve gp.
+ * config/ia64/crtend.asm (__do_global_ctors_au): Ditto.
+
+ * config/ia64/crtbegin.asm (__do_jv_register_classes): Add missing
+ .prologue directive.
+ Use .skip instead of data8 for .bss section to make Intel
+ Assembler (ias) happy. Minor whitespace fixups. Make "nop 0"
+ explicit in the .mib bundles and remove the unnecessary stop
+ bits. Replace local labels with normal labels, to make ias
+ happy. Don't register __do_global_ctors_aux here, do it in
+ crtend.asm instead.
+
+ * config/ia64/crtend.asm [HAVE_INIT_FINI_ARRAY]: Register
+ __do_global_ctors_aux in .init_array section instead of
+ declaring it as a hidden global. Replace local labels with
+ ordinary labels to make ias happy.
+
2003-05-07 Richard Henderson <rth@redhat.com>
PR c++/10570
data8 __dso_handle
#else
.section .bss
+ .align 8
__dso_handle:
- data8 0
+ .skip 8
#endif
.hidden __dso_handle
#ifdef HAVE_INITFINI_ARRAY
-.section .fini_array,"a"
+.section .fini_array, "a"
data8 @fptr(__do_global_dtors_aux)
-.section .init_array,"a"
+.section .init_array, "a"
data8 @fptr(__do_jv_register_classes)
- data8 @fptr(__do_global_ctors_aux)
#else /* !HAVE_INITFINI_ARRAY */
/*
;;
}
{ .mib
+ nop 0
mov b6 = r2
br.call.sptk.many b0 = b6
- ;;
}
/* Likewise for _init. */
;;
}
{ .mib
+ nop 0
mov b6 = r2
br.call.sptk.many b0 = b6
- ;;
}
#endif /* !HAVE_INITFINI_ARRAY */
mov loc2 = gp
nop 0
- br.sptk.many 1f
- ;;
+ br.sptk.many .entry
#else
/*
if (__cxa_finalize)
nop 0
nop 0
- br.sptk.many 1f
+ br.sptk.many .entry
#endif
/*
do {
(*(dtor_ptr-1)) ();
} while (dtor_ptr);
*/
-0:
+.loop:
st8 [loc0] = r15 // update dtor_ptr (in memory)
ld8 r17 = [r16], 8 // r17 <- dtor's entry-point
nop 0
mov b6 = r17
br.call.sptk.many rp = b6
-1: ld8 r15 = [loc0] // r15 <- dtor_ptr (gp-relative)
+.entry: ld8 r15 = [loc0] // r15 <- dtor_ptr (gp-relative)
;;
add r16 = r15, loc2 // r16 <- dtor_ptr (absolute)
adds r15 = 8, r15
;;
cmp.ne p6, p0 = r0, r16
-(p6) br.cond.sptk.few 0b
+(p6) br.cond.sptk.few .loop
br.ret.sptk.many rp
.endp __do_global_dtors_aux
.align 32
.proc __do_jv_register_classes
__do_jv_register_classes:
+ .prologue
.save ar.pfs, r33
- alloc loc1 = ar.pfs, 0, 2, 1, 0
+ alloc loc1 = ar.pfs, 0, 3, 1, 0
movl out0 = @gprel(__JCR_LIST__)
;;
ld8 r15 = [r14], 8
;;
- ld8 gp = [r14]
+ nop 0
mov b6 = r15
- nop 0
- nop 0
+ mov loc2 = gp
+ ld8 gp = [r14]
br.call.sptk.many rp = b6
;;
- nop 0
+ mov gp = loc2
mov rp = loc0
mov ar.pfs = loc1
__JCR_END__:
data8 0
-#ifndef HAVE_INITFINI_ARRAY
+#ifdef HAVE_INITFINI_ARRAY
+
+.section .init_array, "a"
+ data8 @fptr(__do_global_ctors_aux)
+
+#else /* !HAVE_INITFINI_ARRAY */
/*
* Fragment of the ELF _init routine that invokes our dtor cleanup.
*
.text
.align 32
-#ifdef HAVE_INITFINI_ARRAY
- /* This is referenced from crtbegin.o. */
- .globl __do_global_ctors_aux
- .type __do_global_ctors_aux,@function
- .hidden __do_global_ctors_aux
-#endif
.proc __do_global_ctors_aux
__do_global_ctors_aux:
.prologue
(*p) ();
*/
.save ar.pfs, r34
- alloc loc2 = ar.pfs, 0, 4, 0, 0
+ alloc loc2 = ar.pfs, 0, 5, 0, 0
movl loc0 = @gprel(__CTOR_END__ - 8)
;;
;;
cmp.eq p6, p0 = -1, loc3
- nop 0
-(p6) br.cond.spnt.few 2f
+ mov loc4 = gp
+(p6) br.cond.spnt.few .exit
-0: ld8 r15 = [loc3], 8
+.loop: ld8 r15 = [loc3], 8
;;
ld8 gp = [loc3]
mov b6 = r15
cmp.ne p6, p0 = -1, loc3
nop 0
-(p6) br.cond.sptk.few 0b
+(p6) br.cond.sptk.few .loop
-2: nop.m 0
+.exit: mov gp = loc3
mov rp = loc1
mov ar.pfs = loc2