aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJozef Lawrynowicz <jozef.l@mittosystems.com>2019-12-09 11:41:07 +0000
committerJozef Lawrynowicz <jozefl@gcc.gnu.org>2019-12-09 11:41:07 +0000
commitad8b778345e01ff8ce252bf572965684a0826082 (patch)
treece0ac0279a49cb13a2204d9edb35d5e2b404d320
parent41f36f22f38285fef3b2166a00d4ec446fb96125 (diff)
downloadgcc-ad8b778345e01ff8ce252bf572965684a0826082.zip
gcc-ad8b778345e01ff8ce252bf572965684a0826082.tar.gz
gcc-ad8b778345e01ff8ce252bf572965684a0826082.tar.bz2
libgcc: Dont define __do_global_dtors_aux if it will be empty
2019-12-09 Jozef Lawrynowicz <jozef.l@mittosystems.com> * crtstuff.c (__do_global_dtors_aux): Wrap in #if so it's only defined if it will have contents. From-SVN: r279123
-rw-r--r--libgcc/ChangeLog5
-rw-r--r--libgcc/crtstuff.c8
2 files changed, 12 insertions, 1 deletions
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog
index 78aefe8..0359f3a 100644
--- a/libgcc/ChangeLog
+++ b/libgcc/ChangeLog
@@ -1,3 +1,8 @@
+2019-12-09 Jozef Lawrynowicz <jozef.l@mittosystems.com>
+
+ * crtstuff.c (__do_global_dtors_aux): Wrap in #if so it's only defined
+ if it will have contents.
+
2019-12-05 Georg-Johann Lay <avr@gjlay.de>
PR target/92055
diff --git a/libgcc/crtstuff.c b/libgcc/crtstuff.c
index ae6328d..80cc78d 100644
--- a/libgcc/crtstuff.c
+++ b/libgcc/crtstuff.c
@@ -364,8 +364,12 @@ extern void __cxa_finalize (void *) TARGET_ATTRIBUTE_WEAK;
On some systems, this routine is run more than once from the .fini,
when exit is called recursively, so we arrange to remember where in
the list we left off processing, and we resume at that point,
- should we be re-invoked. */
+ should we be re-invoked.
+ This routine does not need to be run if none of the following clauses are
+ true, as it will not do anything, so can be removed. */
+#if defined(CRTSTUFFS_O) || !defined(FINI_ARRAY_SECTION_ASM_OP) \
+ || USE_TM_CLONE_REGISTRY || USE_EH_FRAME_REGISTRY
static void __attribute__((used))
__do_global_dtors_aux (void)
{
@@ -451,6 +455,8 @@ __do_global_dtors_aux_1 (void)
CRT_CALL_STATIC_FUNCTION (__LIBGCC_INIT_SECTION_ASM_OP__,
__do_global_dtors_aux_1)
#endif
+#endif /* defined(CRTSTUFFS_O) || !defined(FINI_ARRAY_SECTION_ASM_OP)
+ || defined(USE_TM_CLONE_REGISTRY) || defined(USE_EH_FRAME_REGISTRY) */
#if defined(USE_EH_FRAME_REGISTRY) || USE_TM_CLONE_REGISTRY
/* Stick a call to __register_frame_info into the .init section. For some