aboutsummaryrefslogtreecommitdiff
path: root/libgcc/crtstuff.c
diff options
context:
space:
mode:
authorJozef Lawrynowicz <jozef.l@mittosystems.com>2019-12-11 18:59:38 +0000
committerJozef Lawrynowicz <jozefl@gcc.gnu.org>2019-12-11 18:59:38 +0000
commit34a53788fec49e0a85bd32b51b057cfaae0200c8 (patch)
tree35c729cb152743702ce27f8f39a2334b739b3a37 /libgcc/crtstuff.c
parent0230c89710f748153fcab4fb80a7576942922c7d (diff)
downloadgcc-34a53788fec49e0a85bd32b51b057cfaae0200c8.zip
gcc-34a53788fec49e0a85bd32b51b057cfaae0200c8.tar.gz
gcc-34a53788fec49e0a85bd32b51b057cfaae0200c8.tar.bz2
libgcc: Declare __dso_handle only if DEFAULT_USE_CXA_ATEXIT is true
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
Diffstat (limited to 'libgcc/crtstuff.c')
-rw-r--r--libgcc/crtstuff.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libgcc/crtstuff.c b/libgcc/crtstuff.c
index 9346cc5..e282cb1 100644
--- a/libgcc/crtstuff.c
+++ b/libgcc/crtstuff.c
@@ -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. */