]> gcc.gnu.org Git - gcc.git/commitdiff
libgcc: Declare __dso_handle only if DEFAULT_USE_CXA_ATEXIT is true
authorJozef Lawrynowicz <jozef.l@mittosystems.com>
Wed, 11 Dec 2019 18:59:38 +0000 (18:59 +0000)
committerJozef Lawrynowicz <jozefl@gcc.gnu.org>
Wed, 11 Dec 2019 18:59:38 +0000 (18:59 +0000)
2019-12-11  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

* crtstuff.c: Declare __dso_handle only if DEFAULT_USE_CXA_ATEXIT is
true.

From-SVN: r279243

libgcc/ChangeLog
libgcc/crtstuff.c

index c8480cd35a5bba27724cb580a1fad76c595b0064..b415d78a8af8f563f6c6a0621f11f84e61d81bd8 100644 (file)
@@ -1,3 +1,8 @@
+2019-12-11  Jozef Lawrynowicz  <jozef.l@mittosystems.com>
+
+       * crtstuff.c: Declare __dso_handle only if DEFAULT_USE_CXA_ATEXIT is
+       true.
+
 2019-12-09  Jozef Lawrynowicz  <jozef.l@mittosystems.com>
 
        * crtstuff.c (__do_global_dtors_aux): Check if USE_EH_FRAME_REGISTRY is
index 9346cc5ca542472996e8e45d09cabe88b9bd8d4d..e282cb1aabb40ced7254425418529e886d1906fb 100644 (file)
@@ -325,11 +325,14 @@ register_tm_clones (void)
 
 #ifdef OBJECT_FORMAT_ELF
 
+#if DEFAULT_USE_CXA_ATEXIT
 /* Declare the __dso_handle variable.  It should have a unique value
    in every shared-object; in a main program its value is zero.  The
    object should in any case be protected.  This means the instance
    in one DSO or the main program is not used in another object.  The
-   dynamic linker takes care of this.  */
+   dynamic linker takes care of this.
+   If __cxa_atexit is not being used, __dso_handle will not be used and
+   doesn't need to be defined.  */
 
 #ifdef TARGET_LIBGCC_SDATA_SECTION
 extern void *__dso_handle __attribute__ ((__section__ (TARGET_LIBGCC_SDATA_SECTION)));
@@ -342,6 +345,7 @@ void *__dso_handle = &__dso_handle;
 #else
 void *__dso_handle = 0;
 #endif
+#endif /* DEFAULT_USE_CXA_ATEXIT */
 
 /* The __cxa_finalize function may not be available so we use only a
    weak declaration.  */
This page took 0.085496 seconds and 5 git commands to generate.