summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-04-03 14:09:25 +0000
committerEric Andersen <andersen@codepoet.org>2002-04-03 14:09:25 +0000
commit9f18d3e1a8da09598b75e9ebf1561a8909fb320e (patch)
tree6e6ac95faa5c2fa47fb8d7cdc4f313b5af675069
parent30e35d4aadb5a5b06c5cd4a52910a2258af48858 (diff)
Teach initfini to build properly on arches where gcc tries to be
sneaky behind our back... -Erik
-rwxr-xr-xextra/scripts/initfini.pl8
-rw-r--r--libc/sysdeps/linux/common/initfini.c10
2 files changed, 18 insertions, 0 deletions
diff --git a/extra/scripts/initfini.pl b/extra/scripts/initfini.pl
index 9a5c3ba09..ec6bdb36b 100755
--- a/extra/scripts/initfini.pl
+++ b/extra/scripts/initfini.pl
@@ -81,6 +81,14 @@ while(<INITFINI>) {
$omitcrti = 0;
next;
}
+ if (/PROLOG_PAUSES/) {
+ $omitcrti = 1;
+ next;
+ }
+ if (/PROLOG_UNPAUSES/) {
+ $omitcrti = 0;
+ next;
+ }
if (/PROLOG_ENDS/) {
$omitcrti = 1;
next;
diff --git a/libc/sysdeps/linux/common/initfini.c b/libc/sysdeps/linux/common/initfini.c
index 9a23c55d0..4f95fbfd1 100644
--- a/libc/sysdeps/linux/common/initfini.c
+++ b/libc/sysdeps/linux/common/initfini.c
@@ -84,6 +84,16 @@ _init (void)
module which has a constructor; but then user code's constructors
would come first, and not be profiled. */
call_gmon_start ();
+#else
+ asm ("\n/*@_init_PROLOG_PAUSES*/");
+ {
+ /* Let GCC know that _init is not a leaf function by having a dummy
+ * function call here. We arrange for this call to be omitted from
+ * either crt file. */
+ extern void i_am_not_a_leaf (void);
+ i_am_not_a_leaf ();
+ }
+ asm ("\n/*@_init_PROLOG_UNPAUSES*/");
#endif
asm ("ALIGN");