diff options
author | Richard Stallman <rms@gnu.org> | 1992-02-12 17:55:41 +0000 |
---|---|---|
committer | Richard Stallman <rms@gnu.org> | 1992-02-12 17:55:41 +0000 |
commit | 1d7fac3a9b99c21ad50cd9c7e204dca0bb9c18f4 (patch) | |
tree | d7f09ac4ab19738e36dfc6b8ca9c958340a96ee6 | |
parent | 948c37aafe65d32757046ca3dc979dc4571b3041 (diff) | |
download | gcc-1d7fac3a9b99c21ad50cd9c7e204dca0bb9c18f4.zip gcc-1d7fac3a9b99c21ad50cd9c7e204dca0bb9c18f4.tar.gz gcc-1d7fac3a9b99c21ad50cd9c7e204dca0bb9c18f4.tar.bz2 |
*** empty log message ***
From-SVN: r311
-rw-r--r-- | gcc/config/vax/vms.h | 63 |
1 files changed, 62 insertions, 1 deletions
diff --git a/gcc/config/vax/vms.h b/gcc/config/vax/vms.h index 7d9584a..1805ec7 100644 --- a/gcc/config/vax/vms.h +++ b/gcc/config/vax/vms.h @@ -246,4 +246,65 @@ const_section () \ fputc ('\n', (FILE)); \ } - +/* The following definitions are used in libgcc2.c with the __main + function. The _SHR symbol is used when the sharable image library + for libg++ is used - this is picked up automatically by the linker + and this symbol points to the start of the __CTOR_LIST__ from libg++. + If libg++ is not being used, then __CTOR_LIST_SHR__ occurs just after + __CTOR_LIST__, and essentially points to the same list as __CTOR_LIST. */ + +#ifdef L__main +#include <stdio.h> + +#define __CTOR_LIST__ __gxx_init_0 +#define __CTOR_LIST_END__ __gxx_init_2 + +#define __CTOR_LIST_SHR__ $$PsectAttributes_NOSHR$$__gxx_init_0_shr +#define __CTOR_LIST_SHR_END__ $$PsectAttributes_NOSHR$$__gxx_init_2_shr + +#define DO_GLOBAL_CTORS_BODY \ +do { \ + func_ptr *p; \ + extern func_ptr __CTOR_LIST__[1]; \ + extern func_ptr __CTOR_LIST_END__[1]; \ + extern func_ptr __CTOR_LIST_SHR__[1]; \ + extern func_ptr __CTOR_LIST_SHR_END__[1]; \ + fflush(stdout); \ + if( &__CTOR_LIST_SHR__[0] != &__CTOR_LIST__[1]) \ + for (p = __CTOR_LIST_SHR__ + 1; p < __CTOR_LIST_SHR_END__ ; p++ ) \ + if (*p) (*p) (); \ + for (p = __CTOR_LIST__ + 1; p < __CTOR_LIST_END__ ; p++ ) \ + if (*p) (*p) (); \ + atexit (__do_global_dtors); \ + { \ + __label__ foo; \ + int *callers_caller_fp = (int *) __builtin_frame_address (3); \ + register int retval asm ("r0"); \ + callers_caller_fp[4] = (int) && foo; \ + return; \ + foo: \ + exit (retval); \ + } \ +} while (0) + +#define __DTOR_LIST__ __gxx_clean_0 +#define __DTOR_LIST_END__ __gxx_clean_2 + +#define __DTOR_LIST_SHR__ $$PsectAttributes_NOSHR$$__gxx_clean_0_shr +#define __DTOR_LIST_SHR_END__ $$PsectAttributes_NOSHR$$__gxx_clean_2_shr + +#define DO_GLOBAL_DTORS_BODY \ +do { \ + func_ptr *p; \ + extern func_ptr __DTOR_LIST__[1]; \ + extern func_ptr __DTOR_LIST_END__[1]; \ + extern func_ptr __DTOR_LIST_SHR__[1]; \ + extern func_ptr __DTOR_LIST_SHR_END__[1]; \ + for (p = __DTOR_LIST__ + 1; p < __DTOR_LIST_END__ ; p++ ) \ + if (*p) (*p) (); \ + if( &__DTOR_LIST_SHR__[0] != &__DTOR_LIST__[1]) \ + for (p = __DTOR_LIST_SHR__ + 1; p < __DTOR_LIST_SHR_END__ ; p++ ) \ + if (*p) (*p) (); \ +} while (0) + +#endif /* L__main */ |