From: Jeffrey A Law Date: Sun, 21 Feb 1999 20:00:16 +0000 (+0000) Subject: * tm.texi: Update docs for constructors and destructors. X-Git-Tag: prereleases/egcs-1.1.2-prerelease-2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=856776ffb8ce1691e61857dddacb4336ee174119;p=thirdparty%2Fgcc.git * tm.texi: Update docs for constructors and destructors. From-SVN: r25357 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bafaff5f0fbc..be4e0ffc3fc5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -2,6 +2,7 @@ Sun Feb 21 20:35:10 1999 Jeffrey A Law (law@cygnus.com) * config/aoutos.h (ASM_OUTPUT_CONSTRUCTOR): Delete. (ASM_OUTPUT_DESTRUCTOR, ASM_OUTPUT_GC_ENTRY): Likewise. + * tm.texi: Update docs for constructors and destructors. Tue Feb 16 21:02:07 1999 Anton Hartl diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index b7fe1394d3b3..c87c6079dbf9 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -2944,7 +2944,8 @@ start_objects (method_type) NULL_TREE, 0); #if defined(ASM_OUTPUT_CONSTRUCTOR) && defined(ASM_OUTPUT_DESTRUCTOR) - /* It can be a static function with .ctors/.dtors sections. */ + /* It can be a static function as long as collect2 does not have + to scan the object file to find its ctor/dtor routine. */ TREE_PUBLIC (current_function_decl) = 0; #endif diff --git a/gcc/tm.texi b/gcc/tm.texi index 1c5d3b665a2c..8265773175d4 100644 --- a/gcc/tm.texi +++ b/gcc/tm.texi @@ -5906,13 +5906,20 @@ names. @findex ASM_OUTPUT_DESTRUCTOR This is like @code{ASM_OUTPUT_CONSTRUCTOR} but used for termination functions rather than initialization functions. + +When @code{ASM_OUTPUT_CONSTRUCTOR} and @code{ASM_OUTPUT_DESTRUCTOR} are +defined, the initializaiton routine generated for the generated object +file will have static linkage. @end table If your system uses @code{collect2} as the means of processing constructors, then that program normally uses @code{nm} to scan an -object file for constructor functions to be called. On certain kinds of -systems, you can define these macros to make @code{collect2} work faster -(and, in some cases, make it work at all): +object file for constructor functions to be called. On such systems you +must not define @code{ASM_OUTPUT_CONSTRUCTOR} and @code{ASM_OUTPUT_DESTRUCTOR} +as the object file's initialization routine must have global scope. + +On certain kinds of systems, you can define these macros to make +@code{collect2} work faster (and, in some cases, make it work at all): @table @code @findex OBJECT_FORMAT_COFF