This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

java crt changes for alpha


Alpha doesn't (and can't) use crtstuff.c, so needs updating
for the recent Java changes.

Also tweaked the code a bit to remove one dynamic relocation.


r~


        * config/alpha/crtbegin.asm (__JCR_LIST__): New.
        (__do_global_dtors_aux): Use gp-relative static data to avoid
        one dynamic relocation.
        (__do_frame_setup): Register Java classes.
        * config/alpha/crtend.asm (__JCR_END__): New.

Index: crtbegin.asm
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/alpha/crtbegin.asm,v
retrieving revision 1.6
diff -c -p -d -r1.6 crtbegin.asm
*** crtbegin.asm	2000/04/29 21:12:45	1.6
--- crtbegin.asm	2001/08/09 16:51:14
***************
*** 44,59 ****
     application's lists.  */
  
  .section .ctors,"aw"
- 
  	.align 3
  __CTOR_LIST__:
! 	.quad -1
  
  .section .dtors,"aw"
- 
  	.align 3
  __DTOR_LIST__:
! 	.quad -1
  
  .section .eh_frame,"aw"
  __EH_FRAME_BEGIN__:
--- 44,61 ----
     application's lists.  */
  
  .section .ctors,"aw"
  	.align 3
  __CTOR_LIST__:
! 	.quad	-1
  
  .section .dtors,"aw"
  	.align 3
  __DTOR_LIST__:
! 	.quad	-1
! 
! .section .jcr,"aw"
! 	.align 3
! __JCR_LIST__:
  
  .section .eh_frame,"aw"
  __EH_FRAME_BEGIN__:
*************** __EH_FRAME_BEGIN__:
*** 96,104 ****
  
  /* Support recursive calls to exit.  */
  	.type dtor_ptr,@object
! 	.size dtor_ptr,8
  dtor_ptr:
! 	.quad	__DTOR_LIST__ + 8
  
  /* A globally unique widget for c++ local destructors to hang off.
  
--- 98,106 ----
  
  /* Support recursive calls to exit.  */
  	.type dtor_ptr,@object
! 	.size dtor_ptr,4
  dtor_ptr:
! 	.gprel32 __DTOR_LIST__ + 8
  
  /* A globally unique widget for c++ local destructors to hang off.
  
*************** __do_global_dtors_aux:
*** 150,161 ****
  
  0:	lda     $9,dtor_ptr
  	br      2f
! 1:	stq	$1,0($9)
  	jsr     $26,($27)
  	ldgp	$29,0($26)
! 2:	ldq	$1,0($9)
! 	ldq     $27,0($1)
! 	addq    $1,8,$1
  	bne     $27,1b
  
  	/* Remove our frame info.  */
--- 152,164 ----
  
  0:	lda     $9,dtor_ptr
  	br      2f
! 1:	stl	$1,0($9)
  	jsr     $26,($27)
  	ldgp	$29,0($26)
! 2:	ldl	$1,0($9)
! 	addq	$1,$29,$2
! 	ldq     $27,0($2)
! 	addl    $1,8,$1
  	bne     $27,1b
  
  	/* Remove our frame info.  */
*************** __do_global_dtors_aux:
*** 173,183 ****
  	.end __do_global_dtors_aux
  
  /*
!  * Install our frame info.
   */
  
- /* ??? How can we rationally keep this size correct?  */
- 
  .section .bss
  	.type frame_object,@object
  	.size frame_object, 48
--- 176,184 ----
  	.end __do_global_dtors_aux
  
  /*
!  * Install our frame info; register java classes, if any.
   */
  
  .section .bss
  	.type frame_object,@object
  	.size frame_object, 48
*************** __do_frame_setup:
*** 205,212 ****
  	jsr	$26,__register_frame_info
  	ldgp	$29,0($26)
  
! 	ldq     $26,0($30)
! 0:	lda     $30,16($30)
  	ret
  
  	.end __do_frame_setup
--- 206,221 ----
  	jsr	$26,__register_frame_info
  	ldgp	$29,0($26)
  
! 0:	lda	$1,_Jv_RegisterClasses
! 	lda	$16,__JCR_LIST__
! 	beq	$1,0f
! 	ldq	$2,8($16)
! 	beq	$2,0f
! 	jsr	$26,_Jv_RegisterClasses
! 	ldgp	$29,0($26)
! 
! 0:	ldq     $26,0($30)
! 	lda     $30,16($30)
  	ret
  
  	.end __do_frame_setup
*************** __do_frame_setup:
*** 216,218 ****
--- 225,228 ----
  #ifdef SHARED
  .weak __cxa_finalize
  #endif
+ .weak _Jv_RegisterClasses
Index: crtend.asm
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/alpha/crtend.asm,v
retrieving revision 1.5
diff -c -p -d -r1.5 crtend.asm
*** crtend.asm	2000/04/29 21:12:45	1.5
--- crtend.asm	2001/08/09 16:51:14
***************
*** 41,56 ****
     application's lists.  */
  
  .section .ctors,"aw"
- 
  	.align 3
  __CTOR_END__:
  	.quad   0
  
  .section .dtors,"aw"
- 
  	.align 3
  __DTOR_END__:
  	.quad   0
  
  .section .eh_frame,"aw"
  __FRAME_END__:
--- 41,59 ----
     application's lists.  */
  
  .section .ctors,"aw"
  	.align 3
  __CTOR_END__:
  	.quad   0
  
  .section .dtors,"aw"
  	.align 3
  __DTOR_END__:
  	.quad   0
+ 
+ .section .jcr,"aw"
+ 	.align 3
+ __JCR_END__:
+ 	.quad	0
  
  .section .eh_frame,"aw"
  __FRAME_END__:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]