2005-08-24 Roland McGrath <roland@redhat.com>
* argp-std.c [_MUDFLAP] (__libdwfl_argp_mudflap_options): New function,
magic initializer to set -heur-stack-bound option.
diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog
index 2edaf6f..139ab47 100644
--- a/libdwfl/ChangeLog
+++ b/libdwfl/ChangeLog
@@ -1,3 +1,8 @@
+2005-08-24 Roland McGrath <roland@redhat.com>
+
+ * argp-std.c [_MUDFLAP] (__libdwfl_argp_mudflap_options): New function,
+ magic initializer to set -heur-stack-bound option.
+
2005-08-22 Roland McGrath <roland@redhat.com>
* dwfl_validate_address.c: New file.
diff --git a/libdwfl/argp-std.c b/libdwfl/argp-std.c
index 75f8b99..4a6e160 100644
--- a/libdwfl/argp-std.c
+++ b/libdwfl/argp-std.c
@@ -196,3 +196,15 @@
{
return &libdwfl_argp;
}
+
+#ifdef _MUDFLAP
+/* In the absence of a mudflap wrapper for argp_parse, or a libc compiled
+ with -fmudflap, we'll see spurious errors for using the struct argp_state
+ on argp_parse's stack. */
+
+void __attribute__ ((constructor))
+__libdwfl_argp_mudflap_options (void)
+{
+ __mf_set_options ("-heur-stack-bound");
+}
+#endif