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]
Other format: [Raw text]

Committed, MMIX: crti.asm, crtn.asm: register _fini with atexit,fix typo...


Major thinko.  Maybe I was confused by crtstuff.c, thinking it'd
take care of registering _fini with atexit or something.  Most
tests amazingly still run without proper global dtors support.
It's actually hard to test for this not working since the exit
status has to be decided when main exits (exit is called) for
targets with "set_board_info needs_status_wrapper 1" in their
dejagnu baseboard description. Suggestions for tests are
welcome.  (Some tests are not taking this into account, for
example g++.old-deja/g++.pt/static11.C.)  Will commit this to
3.1 too.

	* config/mmix/crti.asm (_init): Register _fini with atexit.
	* config/mmix/crtn.asm (_fini): Add omitted "POP 0,0".

Index: crti.asm
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mmix/crti.asm,v
retrieving revision 1.2
diff -p -c -r1.2 crti.asm
*** crti.asm	2001/11/03 22:46:16	1.2
--- crti.asm	2002/03/30 22:19:22
***************
*** 1,4 ****
! /* Copyright (C) 2001 Free Software Foundation, Inc.
     Contributed by Hans-Peter Nilsson <hp@bitrange.com>

  This file is free software; you can redistribute it and/or modify it
--- 1,4 ----
! /* Copyright (C) 2001, 2002 Free Software Foundation, Inc.
     Contributed by Hans-Peter Nilsson <hp@bitrange.com>

  This file is free software; you can redistribute it and/or modify it
*************** _init:
*** 102,107 ****
--- 102,115 ----
  	SETL	$255,255
  	TRAP	0,0,0
  0H	IS	@
+
+ % Register _fini to be executed as the last atexit function.
+ #ifdef __MMIX_ABI_GNU__
+ 	GETA	$231,_fini
+ #else
+ 	GETA	$1,_fini
+ #endif
+ 	PUSHJ	$0,atexit

  	.section .fini,"ax",@progbits
  	.global	_fini
Index: crtn.asm
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mmix/crtn.asm,v
retrieving revision 1.1
diff -p -c -r1.1 crtn.asm
*** crtn.asm	2001/11/03 22:14:57	1.1
--- crtn.asm	2002/03/30 22:31:00
***************
*** 1,4 ****
! /* Copyright (C) 2001 Free Software Foundation, Inc.
     Contributed by Hans-Peter Nilsson <hp@bitrange.com>

  This file is free software; you can redistribute it and/or modify it
--- 1,4 ----
! /* Copyright (C) 2001, 2002 Free Software Foundation, Inc.
     Contributed by Hans-Peter Nilsson <hp@bitrange.com>

  This file is free software; you can redistribute it and/or modify it
*************** gnu_parm_reg_1 GREG
*** 87,91 ****
--- 87,92 ----
  	.section .fini,"ax",@progbits
  	GETA	$255,0F
  	PUT	rJ,$255
+ 	POP	0,0
  0H	PUT	rJ,$0
  	POP	0,0

brgds, H-P


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