diff options
author | rearnsha <rearnsha@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-12-13 14:24:03 +0000 |
---|---|---|
committer | rearnsha <rearnsha@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-12-13 14:24:03 +0000 |
commit | 2f9e77d1f405a800f0a14731c4173eb64b0e0020 (patch) | |
tree | d02bbfaf0f7f2c12f79276ee2bd6883b939f8502 /gcc/collect2.c | |
parent | c0b8fbcb3a7f78d469285f2eef724af331bb3dfa (diff) | |
download | gcc-2f9e77d1f405a800f0a14731c4173eb64b0e0020.tar.gz |
* collect2.c (COLLECT_SHARED_INIT_FUNC)
(COLLECT_SHARD_FINI_FUNC): Define default values.
(write_c_file_stat): Use them to call construtor and destructor
functions in shared libraries.
* doc/tm.texi (COLLECT_SHARED_INIT_FUNC)
(COLLECT_SHARD_FINI_FUNC): Document them.
* config/netbsd.h (COLLECT_SHARED_INIT_FUNC)
(COLLECT_SHARD_FINI_FUNC): Define.
* config/netbsd.h (LINK_SPEC): Don't pull in estart if creating a
shared library. Pass -shared through to the linker.
* config/arm/netbsd.h (LINK_SPEC): Likewise.
* config/arm/t-netbsd (TARGET_LIBGCC2_CFLAGS): Add -fpic.
(SHLIB_EXT, SHLIB_NAME, SHLIB_SONAME, SHLIB_OBJS, SHLIB_LINK)
(SHLIB_INSTALL): Define.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47975 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/collect2.c')
-rw-r--r-- | gcc/collect2.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/gcc/collect2.c b/gcc/collect2.c index 19009e30180..4dd08f045b1 100644 --- a/gcc/collect2.c +++ b/gcc/collect2.c @@ -154,6 +154,15 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA /* This must match tree.h. */ #define DEFAULT_INIT_PRIORITY 65535 +#ifndef COLLECT_SHARED_INIT_FUNC +#define COLLECT_SHARED_INIT_FUNC(STREAM, FUNC) \ + fprintf ((STREAM), "void _GLOBAL__DI() {\n\t%s();\n}\n", (FUNC)) +#endif +#ifndef COLLECT_SHARED_FINI_FUNC +#define COLLECT_SHARED_FINI_FUNC(STREAM, FUNC) \ + fprintf ((STREAM), "void _GLOBAL__DD() {\n\t%s();\n}\n", (FUNC)) +#endif + #if defined (LDD_SUFFIX) || SUNOS4_SHARED_LIBRARIES #define SCAN_LIBRARIES #endif @@ -1944,8 +1953,8 @@ write_c_file_stat (stream, name) if (shared_obj) { - fprintf (stream, "void _GLOBAL__DI() {\n\t%s();\n}\n", initname); - fprintf (stream, "void _GLOBAL__DD() {\n\t%s();\n}\n", fininame); + COLLECT_SHARED_INIT_FUNC(stream, initname); + COLLECT_SHARED_FINI_FUNC(stream, fininame); } } |