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]

Re: [PATCH] Use atexit vise .fini section for VMS port


Ian Lance Taylor wrote:
I don't think that VMS_DEBUGGING_INFO is a good macro to test.  I
*think* it should work to test FINI_ARRAY_SECTION_ASM_OP here.  Can you
look into that?

I've been looking into this as you suggested.


According to tm.texi: FINI_ARRAY_SECTION_ASM_OP: If defined, a C expression whose value is a string, including spacing,
containing the assembler operation to identify the following data as
part of the @code{.fini_array} (or equivalent) section.


Where is this string output? Only it's existence is tested that I can find.

I reorganized the code as follows (my interpretation of your intent), but seems like it should be outputting FINI_ARRAY_SECTION_ASM_OP rather than just testing it???

config/arm/ababi.h is the only place I found where it might matter.

--Doug

--- gcc-head-src/gcc/crtstuff.c 2009-08-27 14:24:31.302038000 -0400
+++ gcc-head-src-new/gcc/crtstuff.c     2009-08-27 14:27:39.749794000 -0400
@@ -325,11 +325,18 @@ __do_global_dtors_aux (void)
 /* Stick a call to __do_global_dtors_aux into the .fini section.  */
 #ifdef FINI_SECTION_ASM_OP
 CRT_CALL_STATIC_FUNCTION (FINI_SECTION_ASM_OP, __do_global_dtors_aux)
-#else /* !defined(FINI_SECTION_ASM_OP) */
+#elif defined (FINI_ARRAY_SECTION_ASM_OP)
 static func_ptr __do_global_dtors_aux_fini_array_entry[]
   __attribute__ ((__unused__, section(".fini_array")))
   = { __do_global_dtors_aux };
-#endif /* !defined(FINI_SECTION_ASM_OP) */
+#else /* !FINI_SECTION_ASM_OP && !FINI_ARRAY_SECTION_ASM_OP */
+static void __attribute__((used))
+__do_global_dtors_aux_1 (void)
+{
+  atexit (__do_global_dtors_aux);
+}
+CRT_CALL_STATIC_FUNCTION (INIT_SECTION_ASM_OP, __do_global_dtors_aux_1)
+#endif

 #if defined(USE_EH_FRAME_REGISTRY) || defined(JCR_SECTION_NAME)
 /* Stick a call to __register_frame_info into the .init section.  For some


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