diff options
author | Hans-Peter Nilsson <hp@axis.com> | 2002-01-28 13:46:05 +0000 |
---|---|---|
committer | Hans-Peter Nilsson <hp@gcc.gnu.org> | 2002-01-28 13:46:05 +0000 |
commit | fdae5767f002780de4b83d84417e1faf73e1e947 (patch) | |
tree | 2ef53d7b7bee662bc74b10e07a646f9dc1fb92d3 | |
parent | 27d921c7cff1f4f15991a2a9d5bf425f70610055 (diff) | |
download | gcc-fdae5767f002780de4b83d84417e1faf73e1e947.zip gcc-fdae5767f002780de4b83d84417e1faf73e1e947.tar.gz gcc-fdae5767f002780de4b83d84417e1faf73e1e947.tar.bz2 |
cris.h (CRT_CALL_STATIC_FUNCTION): Change to emit atexit call in crtbegin, hooked in after call to frame_dummy...
* config/cris/cris.h (CRT_CALL_STATIC_FUNCTION): Change to emit
atexit call in crtbegin, hooked in after call to frame_dummy;
register EH before registering __fini__start.
From-SVN: r49281
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/cris/cris.h | 11 |
2 files changed, 13 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d678e87..97b8198 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2002-01-28 Hans-Peter Nilsson <hp@axis.com> + + * config/cris/cris.h (CRT_CALL_STATIC_FUNCTION): Change to emit + atexit call in crtbegin, hooked in after call to frame_dummy; + register EH before registering __fini__start. + 2002-01-28 Aldy Hernandez <aldyh@redhat.com> * config/rs6000/altivec.h: Remove spurious semicolons. diff --git a/gcc/config/cris/cris.h b/gcc/config/cris/cris.h index f92a3b3..84d0e89 100644 --- a/gcc/config/cris/cris.h +++ b/gcc/config/cris/cris.h @@ -1450,19 +1450,22 @@ struct cum_args {int regs;}; /* We pull a little trick to register the _fini function with atexit, after (presumably) registering the eh frame info, since we don't handle - _fini (a.k.a. ___fini_start) in crt0 or have a crti for "pure" ELF. */ -#ifdef CRT_END + _fini (a.k.a. ___fini_start) in crt0 or have a crti for "pure" ELF. If + you change this, don't forget that you can't have library function + references (e.g. to atexit) in crtend.o, since those won't be resolved + to libraries; those are linked in *before* crtend.o. */ +#ifdef CRT_BEGIN # define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \ static void __attribute__((__used__)) \ call_ ## FUNC (void) \ { \ asm (SECTION_OP); \ - if (__builtin_strcmp (#FUNC, "__do_global_ctors_aux") == 0) \ + FUNC (); \ + if (__builtin_strcmp (#FUNC, "frame_dummy") == 0) \ { \ extern void __fini__start (void); \ atexit (__fini__start); \ } \ - FUNC (); \ asm (TEXT_SECTION_ASM_OP); \ } #endif |