From 80e43a769057f807f859264a55c77edad4f2f6ad Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Wed, 24 Aug 2005 21:12:15 +0000 Subject: [PATCH] 2005-08-24 Roland McGrath * argp-std.c [_MUDFLAP] (__libdwfl_argp_mudflap_options): New function, magic initializer to set -heur-stack-bound option. --- libdwfl/ChangeLog | 5 +++++ libdwfl/argp-std.c | 12 ++++++++++++ 2 files changed, 17 insertions(+) diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog index 2edaf6f91..139ab47b2 100644 --- a/libdwfl/ChangeLog +++ b/libdwfl/ChangeLog @@ -1,3 +1,8 @@ +2005-08-24 Roland McGrath + + * argp-std.c [_MUDFLAP] (__libdwfl_argp_mudflap_options): New function, + magic initializer to set -heur-stack-bound option. + 2005-08-22 Roland McGrath * dwfl_validate_address.c: New file. diff --git a/libdwfl/argp-std.c b/libdwfl/argp-std.c index 75f8b99f0..4a6e1607f 100644 --- a/libdwfl/argp-std.c +++ b/libdwfl/argp-std.c @@ -196,3 +196,15 @@ dwfl_standard_argp (void) { 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 -- 2.47.2