aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'csu/initfini.c')
-rw-r--r--csu/initfini.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/csu/initfini.c b/csu/initfini.c
index a91c3de7a4..2727596a4c 100644
--- a/csu/initfini.c
+++ b/csu/initfini.c
@@ -99,6 +99,15 @@ _fini (void)
to crtn.s-new, followed by the function epilogue. */
asm ("\nEOF.crti.fini\
\n\
+cat > /dev/null <<\\EOF.fini.skip");
+
+ /* Let GCC know that _fini is not a leaf function by having a dummy
+ function call here. We arrange for this call to be omitted from
+ either crt file. */
+ i_am_not_a_leaf();
+
+ asm ("\nEOF.fini.skip\
+\n\
fgrep .fini crti.s-new >>crtn.s-new\n\
cat >> crtn.s-new <<\\EOF.crtn.fini");
}