crtbegin.asm (__do_jv_register_classes): Don't forget to preserve gp.

* 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.

From-SVN: r66584
This commit is contained in:
David Mosberger 2003-05-07 22:29:33 +00:00 committed by Richard Henderson
parent a944ceb94a
commit c35b64c256
3 changed files with 49 additions and 30 deletions

View File

@ -1,3 +1,23 @@
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

View File

@ -48,20 +48,20 @@ __dso_handle:
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 */
/*
@ -88,9 +88,9 @@ __dso_handle:
;;
}
{ .mib
nop 0
mov b6 = r2
br.call.sptk.many b0 = b6
;;
}
/* Likewise for _init. */
@ -106,9 +106,9 @@ __dso_handle:
;;
}
{ .mib
nop 0
mov b6 = r2
br.call.sptk.many b0 = b6
;;
}
#endif /* !HAVE_INITFINI_ARRAY */
@ -127,8 +127,7 @@ __do_global_dtors_aux:
mov loc2 = gp
nop 0
br.sptk.many 1f
;;
br.sptk.many .entry
#else
/*
if (__cxa_finalize)
@ -164,7 +163,7 @@ __do_global_dtors_aux:
nop 0
nop 0
br.sptk.many 1f
br.sptk.many .entry
#endif
/*
do {
@ -172,7 +171,7 @@ __do_global_dtors_aux:
(*(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
@ -182,7 +181,7 @@ __do_global_dtors_aux:
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
@ -194,15 +193,16 @@ __do_global_dtors_aux:
;;
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__)
;;
@ -224,15 +224,15 @@ __do_jv_register_classes:
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

View File

@ -33,7 +33,12 @@ __DTOR_END__:
__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.
*
@ -66,12 +71,6 @@ __JCR_END__:
.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
@ -80,7 +79,7 @@ __do_global_ctors_aux:
(*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)
;;
@ -93,10 +92,10 @@ __do_global_ctors_aux:
;;
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
@ -108,9 +107,9 @@ __do_global_ctors_aux:
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