OSDN Git Service

1b284719beec5771228a73ea017de9d1b711f13e
[pf3gnuchains/gcc-fork.git] / libmudflap / ChangeLog
1 2006-12-04  Eric Botcazou  <ebotcazou@libertysurf.fr>
2
3         * configure: Regenerate.
4
5 2006-11-13  Daniel Jacobowitz  <dan@codesourcery.com>
6
7         * configure: Regenerated.
8
9 2006-11-10  Frank Ch. Eigler  <fche@redhat.com>
10
11         PR libmudflap/28578
12         * mf-hooks1.c (__mf_0fn_malloc): Make the bootstrap buffers
13         static but not function scope static.
14         (free): Skip deallocation attempts for objects placed into
15         bootstrap buffers.
16         * testsuite/libmudflap.cth/pass59-frag.c: New test.
17
18 2006-11-06  Frank Ch. Eigler  <fche@redhat.com>
19
20         From Herman ten Brugge <hermantenbrugge@home.nl>:
21         * mf-runtime.c (__mf_uncache_object): Optimize the code so that
22         small and large objects are handled a lot faster.
23
24 2006-11-06  Frank Ch. Eigler  <fche@redhat.com>
25
26         * configure.ac (__libc_freeres): Look for it.
27         * mf-impl.h (call_libc_freeres): New configuration flag.
28         * mf-runtime.c (__mf_set_default_options): Set it by default.
29         (__mfu_report): Call it if needed.
30         (__mfu_unregister): Remove "unaccessed registered object" warning.
31         * configure, config.h.in: Regenerated.
32
33 2006-09-18  Tom Tromey  <tromey@redhat.com>
34
35         * configure: Rebuilt.
36
37 2006-06-21  Frank Ch. Eigler  <fche@redhat.com>
38
39         PR 21274
40         mf-runtime.h installation based on ssp patch for PR 26473 from
41         Mark Mitchell  <mark@codesourcery.com>.
42         * configure.ac (ACX_NONCANONICAL_TARGET): Use it.
43         * Makefile.am (target_noncanonical): Define.
44         (libsubincludedir): New variable.
45         (nobase_libsubinclude_HEADERS): Add mf-runtime.h.
46         (include_HEADERS): Remove.
47         * configure, aclocal.m4, config.h.in: Regenerated.
48         * Makefile.in, testsuite/Makefile.in: Likewise.
49         * mf-runtime.h: Add #ifndef protection for conflicting _REENTRANT
50         and _THREAD_SAFE redefinition values.
51
52 2006-05-23  Carlos O'Donell  <carlos@codesourcery.com>
53
54         * Makefile.am: Add install-html target. Add install-html to .PHONY
55         * Makefile.in: Regenerate.
56
57 2006-04-19  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
58
59         PR mudflap/26789
60         * testsuite/libmudflap.c++/error1-frag.cxx: New test.
61
62         PR mudflap/26790
63         * testsuite/libmudflap.c++/error2-frag.cxx: New test.
64
65 2006-04-10  Matthias Klose  <doko@debian.org>
66
67         * testsuite/lib/libmudflap.exp (libmudflap-init): Recognize multilib
68         directory names containing underscores.
69
70 2005-11-22  Janis Johnson  <janis187@us.ibm.com>
71
72         * testsuite/lib/libmudflap.exp (libmudflap-init): Remove -static from
73         MUDFLAP_FLAGS if static library not supported.
74         * testsuite/libmudflap.c/cfrags.exp (MUDFLAP_FLAGS): new.
75         * testsuite/libmudflap.c/externs.exp: Ditto.
76         * testsuite/libmudflap.c++/ctors.exp: Ditto.
77         * testsuite/libmudflap.c++/c++frags.exp: Ditto.
78         * testsuite/libmudflap.cth/cthfrags.exp: Ditto.
79
80 2005-10-04  James E Wilson  <wilson@specifix.com>
81
82         * configure.ac (mudflap_cv_entry_point): Use quadrigraphs to declare
83         $name as array of characters with unknown bound.  Also store into the
84         array.
85         * configure: Regenerate.
86
87 2005-09-30  James E. Wilson  <wilson@specifix.com>
88
89         * configure.ac (pthread.h): Use AC_CHECK_HEADERS instead of
90         AC_CHECK_HEADER.
91         (target_thread_file): New.  Set from sed'ed gcc output.
92         (posix_threads): New.  Set from target_thread_file.  Use instead of
93         ac_have_pthread_h.
94         (pthread_create_version): Move initialization before code using it.
95         * configure: Regenerate.
96
97         * mf-heuristics.c (_end, ENTRY_POINT): Make them arrays with unknown
98         bounds.
99
100 2005-09-29  James E. Wilson  <wilson@specifix.com>
101
102         * mf-hooks1.c (__mf_0fn_mmap, mmap, __mf_0fn_munmap, munmap): Protect
103         with HAVE_MMAP ifdef.
104
105 2005-09-23  Frank Ch. Eigler  <fche@elastic.org>
106
107         PR 23084.
108         * mf-hooks2.c (accept): Tolerate NULL sockaddr* parameter.
109
110 2005-09-23  Frank Ch. Eigler  <fche@elastic.org>
111
112         * testsuite/libmudflap.c++/pass58-frag.cxx: New test for heisenbug 19319.
113
114 2005-09-23  Tom Tromey  <tromey@redhat.com>
115
116         * aclocal.m4, configure: Rebuilt.
117         * configure.ac: Use GCC_CHECK_TLS.
118         * acinclude.m4 (LIBMUDFLAP_CHECK_TLS, LIBMUDFLAP_ENABLE): Moved
119         to ../config.
120
121 2005-08-22  Jim Wilson  <wilson@specifix.com>
122
123         * mf-hooks2.c (MF_REGISTER_fopen): Define to __MF_TYPE_STATIC when
124         __FreeBSD__ is defined.
125
126 2005-08-17  Jim Wilson  <wilson@specifix.com>
127
128         * mf-hooks1.c (malloc, calloc, realloc, free,
129         __mf_wrap_alloca_indirect): Call BEGIN_MALLOC_PROTECT before calling
130         the real routines, and END_MALLOC_PROTECT afterwards.
131         * mf-impl.h (enum __mf_state_enum): Expand comment.  Add in_malloc.
132         (BEGIN_PROTECT): Handle in_malloc state.
133         (BEGIN_MALLOC_PROTECT, END_MALLOC_PROTECT): New.
134         * testsuite/libmudflap.c/hook2-allocstuff.c: New.
135
136 2005-08-17  Kelley Cook  <kcook@gcc.gnu.org>
137
138         * All files: Update FSF address.
139
140 2005-08-15  Ulrich Weigand  <weigand@informatik.uni-erlangen.de>
141
142         * mf-hooks3.c (main_seen_p): Remove.
143         (__mf_get_state): Remove attempt to recognize the main thread.
144
145 2005-08-15  Maciej W. Rozycki  <macro@linux-mips.org>
146
147         * configure.ac: Test for the name of the symbol used for the entry
148         point; define ENTRY_POINT to the result.
149         * configure: Regenerate.
150         * config.h.in: Regenerate.
151         * mf-heuristics.c: Replace _start with ENTRY_POINT throughout.
152
153 2005-08-14  Ulrich Weigand  <weigand@informatik.uni-erlangen.de>
154
155         * mf-runtime.c (__mf_state_1): Initialize to reentrant.
156         (__mf_init): Set thread state active.
157         * mf-hooks3.c (__mf_pthread_spawner): Always set thread
158         state active.
159         (pthread_create wrapper): Always use thread spawner.
160
161         * testsuite/libmudflap.cth/pass37-frag.c: Increase timeout.
162         * testsuite/libmudflap.cth/pass39-frag.c: Likewise.
163
164 2005-07-16  Richard Henderson  <rth@redhat.com>
165
166         * acinclude.m4: New file.
167         * configure.ac: Invoke LIBMUDFLAP_CHECK_TLS.
168         * configure, config.h.in, Makefile.in, testsuite/Makefile.in: Rebuild.
169         * mf-hooks1.c (__mf_0fn_malloc): Move body from ...
170         (__mf_0fn_calloc): ... here.
171         * mf-hooks3.c (struct pthread_info): Remove.
172         (__mf_pthread_info, __mf_pthread_info_idx): Remove.
173         (LIBMUDFLAPTH_THREADS_MAX): Set to 1021.
174         (struct mf_thread_data): New.
175         (mf_thread_data, mf_thread_data_lock): New.
176         (__mf_allocate_blank_threadinfo): Remove.
177         (__mf_find_threadinfo): Rewrite and simplify.  Only use if TLS is
178         not available.
179         (__mf_state_perthread): Remove.
180         (__mf_get_state, __mf_set_state): New.
181         (__mf_pthread_cleanup): Use &errno, rather than saved pointer.
182         Update mf_thread_data killing procedure.
183         (__mf_pthread_spawner): Similarly.
184         (__mf_0fn_pthread_create): Only use wrapper if necessary.  Remove
185         code to allocate thread stack space.
186         (__mf_0fn_pthread_join, pthread_join): Remove.
187         (__mf_0fn_pthread_exit, pthread_exit): Remove.
188         * mf-impl.h (dyn_pthread_join, dyn_pthread_exit): Remove.
189         (__mf_state_1): Rename from __mf_state; use TLS when available.
190         (__mf_get_state, __mf_set_state): New.  Update all users.
191         * mf-runtime.c (begin_recursion_protect1): New.
192         (BEGIN_RECURSION_PROTECT): Use it.
193         (__mf_state_1): Rename from __mf_state; use TLS when available.
194         (threads_active_p): Remove.
195         (__mf_usage): Compute it directly.
196
197 2005-06-19  Ulrich Weigand  <uweigand@de.ibm.com>
198
199         * testsuite/libmudflap.c/externs-1.c (main): Add return statement.
200
201 2005-06-15  Frank Ch. Eigler  <fche@redhat.com>
202
203         Fix for uncaching bug reported by Herman ten Brugge.
204         * mf-runtime.c (__mf_uncache_object): Search whole cache.
205         * testsuite/libmudflap.c/fail40-frag.c: New test.
206
207 2005-05-23  Alfred M. Szmidt  <ams@gnu.org>
208
209         PR libmudflap/21724
210         * Makefile.am (AM_MAKEFLAGS): Pass includedir.
211         * Makefile.in: Amend.
212
213 2005-06-14  Frank Ch. Eigler  <fche@redhat.com>
214
215         PR mudflap/21023
216         * testsuite/libmudflap.c/externs.exp, externs-{1,2}.c: New test files.
217         * testsuite/libmudflap.c/cfrags.exp: Bypass new sources.
218
219 2005-06-14  Frank Ch. Eigler  <fche@redhat.com>
220
221         PR libmudflap/21094
222         * testsuite/libmudflap.c++/*.exp: Assert build tree g++.
223
224 2005-06-14  Frank Ch. Eigler  <fche@redhat.com>
225
226         PR mudflap/22064
227         * mf-impl.h (mudflap_mode, violation_mode): Make these ordinary
228         unsigned vars with #defines instead of enums.
229
230 2005-05-09  Mike Stump  <mrs@apple.com>
231
232         * configure: Regenerate.
233
234 2005-04-12  Mike Stump  <mrs@apple.com>
235
236         * configure: Regenerate.
237
238 2005-04-12  Frank Ch. Eigler  <fche@redhat.com>
239
240         PR mudflap/19266
241         * testsuite/libmudflap.c++/c++frags.exp: Also test -O permutation.
242         * testsuite/libmudflap.c++/pass57-frag.cxx: New test.
243
244 2005-04-04  Alan Modra  <amodra@bigpond.net.au>
245
246         * mf-runtime.c (__mfu_unregister): Warning fix for char unsigned.
247
248 2005-03-31  Mike Stump  <mrs@apple.com>
249
250         * mf-runtime.h: Add libmudflap copyright clause.
251
252 2005-03-21  Mike Stump  <mrs@apple.com>
253
254         * mf-heuristics.c: Fix whitespace at end of line.
255         * mf-hooks1.c: Likewise.
256         * mf-hooks2.c: Likewise.
257         * mf-hooks3.c: Likewise.
258         * mf-impl.h: Likewise.
259         * mf-runtime.c: Likewise.
260         * mf-runtime.h: Likewise.
261
262 2005-03-21  Zack Weinberg  <zack@codesourcery.com>
263
264         * configure.ac: Do not invoke TL_AC_GCC_VERSION.
265         In all substitutions, expand gcc_version in Makefile.
266         * aclocal.m4, configure: Regenerate.
267         * Makefile.am: Set gcc_version.
268         * Makefile.in, testsuite/Makefile.in: Regenerate.
269
270 2005-03-17  Frank Ch. Eigler  <fche@redhat.com>
271
272         * mf-runtime.c (__mfu_check): Respect ignore_reads configuration.
273         * testsuite/libmudflap.c/{pass56,fail39}-frag.c: New tests.
274
275 2005-02-13  Frank Ch. Eigler  <fche@redhat.com>
276
277         PR mudflap/19319
278         * testsuite/libmudflap.c++/pass55-frag.c: New test.
279
280 2005-01-05  Richard Henderson  <rth@redhat.com>
281
282         * testsuite/libmudflap.c/pass32-frag.c: Fix typo.
283
284 2005-01-02  Greg McGary  <greg@mcgary.org>
285
286         * mf-impl.h (uintptr_t): Get typedef via stdint.h or define explicitly.
287         * mf-runtime.h: New file, replaces mf-runtime.h.in.
288         * configure.ac (AC_CONFIG_FILES): mf-runtime.h is no longer generated.
289         * Makefile.in: Ditto.
290         * testsuite/lib/libmudflap.exp: Add -I${srcdir}/.. to get mf-runtime.h
291         * testsuite/libmudflap.c/pass32-frag.c: s/uintptr_t/__mf_uintptr_t/
292         * testsuite/libmudflap.c/fail36-frag.c: New test.
293         * testsuite/libmudflap.c/fail37-frag.c: New test.
294         * testsuite/libmudflap.c/fail38-frag.c: New test.
295
296 2004-12-08  Kelley Cook  <kcook@gcc.gnu.org>
297
298         * Makefile.am: Add ../config to ACLOCAL_AMFLAGS.
299         * aclocal.m4, Makefile.in, testsuite/Makefile.in: Regenerate.
300
301 2004-12-02  Richard Sandiford  <rsandifo@redhat.com>
302
303         * configure.ac: Use TL_AC_GCC_VERSION to set gcc_version.
304         * aclocal.m4: Include ../config/gcc-version.m4.
305         * configure, Makefile.in, testsuite/Makefile.in: Regenerate.
306
307 2004-11-29  Kelley Cook  <kcook@gcc.gnu.org>
308
309         * Makefile.am: Define ACLOCAL_AMFLAGS.
310         * acinclude.m4: Remove.
311         * stamp-h.in: Remove superfluous stamp file.
312         * aclocal.m4, configure, Makefile.in: Regenerate.
313         * testsuite/Makefile.in: Likewise.
314
315 2004-11-24  Kelley Cook  <kcook@gcc.gnu.org>
316
317         * Makefile.am: Revert previous.
318         * acinclude.m4: Restore.
319         * aclocal.m4, configure, Makefile.in: Regenerate.
320         * testsuite/Makefile.in: Likewise.
321
322 2004-11-24  Kelley Cook  <kcook@gcc.gnu.org>
323
324         * Makefile.am: Define ACLOCAL_AMFLAGS.
325         * acinclude.m4: Remove.
326         * aclocal.m4, configure, Makefile.in: Regenerate.
327         * testsuite/Makefile.in: Likewise.
328
329 2004-11-23  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
330
331         * testsuite/lib/libmudflap.exp: Use new procs in target-libpath.exp.
332
333 2004-11-23  Kelley Cook  <kcook@gcc.gnu.org>
334
335         * Makefile.in, configure, aclocal.m4: Regenerate with automake 1.9.3.
336         * testsuite/Makefile.in: Likewise.
337
338 2004-11-01  Andreas Schwab  <schwab@suse.de>
339
340         * configure.ac: (target_alias): Default to $host_alias, not
341         $target.
342         * configure: Regenerated.
343
344 2004-10-28  Frank Ch. Eigler  <fche@redhat.com>
345
346         * testsuite/libmudflap.c/fail35-,pass53-,pass54-frag.c: New tests.
347         * testsuite/libmudflap.c/pass35-frag.c: Correct embedded warning
348         message.
349
350 2004-10-25  Eric Botcazou  <ebotcazou@libertysurf.fr>
351
352         PR other/18138
353         * testsuite/lib/libmudflap.exp: Accept more than one multilib libgcc.
354
355 2004-10-12  Frank Ch. Eigler  <fche@redhat.com>
356
357         * configure.ac: Check for more headers, functions.
358         * mf-hooks2.c (mkbuffer, unmkbuffer): New helper functions for
359         tracking overridden FILE buffers.
360         (fopen, setvbuf): New/revised hook functions for buffer overriding.
361         (setbuf,setlinebuf,fdopen,freopen,fopen64,freopen64,fclose): Ditto.
362         (fflush): Accept given NULL stream (means "all streams").
363         * mf-runtime.h.in:
364         * mf-runtime.c (__mfu_check): Accept accesses that span adjacent
365         HEAP/GUESS objects.
366         (LOOKUP_CACHE_SIZE_MAX): Raise to 64K entries tentatively.
367         (__mf_adapt_cache): Use them all.
368         * testsuite/libmudflap.c/pass35-frag.c: Update warning message.
369         * testsuite/libmudflap.c++/ctors.exp: Ditto.
370         * testsuite/libmudflap.c/{pass51,pass52}-frag.c: New tests.
371         * configure, config.h.in: Regenerated.
372
373 2004-10-05  Frank Ch. Eigler  <fche@redhat.com>
374
375         * configure.ac: Checking for sys/socket.h once is enough.
376         * configure: Regenerated.
377
378 2004-10-04  Frank Ch. Eigler  <fche@redhat.com>
379
380         * configure.ac: Look for more headers & functions.
381         * mf-hooks2.c (getmntent, inet_ntoa, getproto*): New wrapper functions.
382         * mf-runtime.h.in: Add new "#pragma redefine_extname"s for them.
383         * mf-runtime.c (options): Clean up integer signedness warnings.
384         (main): Add a declaration to fix a warning.
385         * mf-hooks3.c (pthread_exit): Add not-reached exit() to wrapper.
386         * configure, config.h.in: Regenerated.
387
388 2004-10-02  Frank Ch. Eigler  <fche@redhat.com>
389
390         * testsuite/libmudflap.c/pass50-frag.c, fail33-frag.c, fail34-frag.c:
391         New tests for proper base/limit checking for aggregates.
392
393 2004-09-15  Joseph S. Myers  <jsm@polyomino.org.uk>
394
395         * testsuite/libmudflap.c/pass35-frag.c: Update expected message.
396
397 2004-09-07  Frank Ch. Eigler  <fche@redhat.com>
398
399         * configure.ac: Look for pwd.h, grp.h, netdb.h headers and functions.
400         * mf-hooks2.c (strerror): Unregister previous string returned by
401         previous strerror.
402         (getlogin,cuserid,getpwnam,getpwuid,getgrnam,getgrgid): New wrappers.
403         (getservent,getservbyname,getservbyport,gai_strerror): Ditto.
404         * mf-runtime.h.in: Add redefine_extname pragmas for them all.
405         * mf-runtime.c (__mf_describe_object): Clarify object life status.
406         * testsuite/libmudflap.c/pass48-frag.c, pass49-frag.c, fail32-frag.c:
407         New tests.
408         * configure, config.h.in: Regenerated.
409
410 2004-08-03  Dale Johannesen  <dalej@apple.com>
411
412          * mf-runtime.c: Conditionalize POSIX_SOURCE for Darwin.
413
414 2004-08-03  Frank Ch. Eigler  <fche@redhat.com>
415
416         * mf-runtime.c (compare_uintptr_t): Remove function.  Inline
417         simplified contents in all former callers.
418
419 2004-07-27  Ulrich Weigand  <weigand@informatik.uni-erlangen.de>
420
421         * mf-runtime.c (__mf_fini): Set mudflap_mode to mode_nop in
422         the statically linked case.
423
424 2004-07-27  Frank Ch. Eigler  <fche@redhat.com>
425
426         * splay-tree.[ch]: Remove.  Merge contents into ...
427         * mf-runtime.c: ... here, renaming symbols and making all functions
428         static.  Remove unused min/max functions.
429         * Makefile.am: Forget about splay-tree.[ch].
430         * Makefile.in, testsuite/Makefile.in: Regenerated.
431
432 2004-07-21  Frank Ch. Eigler  <fche@redhat.com>
433
434         * mf-runtime.c (__mfu_check): Remove mistaken mode-nop handling.
435         (__mfu_usage): Include (C) 2004.
436         * mf-hooks3.c (__mf_find_threadinfo): Don't call tracing functions
437         here.  Include a comment explaining why.
438
439 2004-07-20  Frank Ch. Eigler  <fche@redhat.com>
440
441         * mf-impl.h (__mf_options): Add ignore_reads and timestamps fields.
442         * mf-runtime.c (options): Give them a name.
443         (__mf_set_default_options): Set them.
444         (__mf_insert_new_object, __mfu_unregister): Optionalize timestamps.
445         (__mf_violation): Warning cleanup.
446         * mf-impl.h (MF_VALIDATE_EXTENT): Support ignore_reads option.
447         * splay-tree.c (splay_tree_delete_helper): Remove obsolete decl.
448
449 2004-07-15  Frank Ch. Eigler  <fche@redhat.com>
450
451         g++/15861
452         * mf-runtime.c (__mf_init): Make it non-static.  Tolerate
453         repeated invocation.
454
455 2004-07-09  Frank Ch. Eigler  <fche@redhat.com>
456
457         Test case for g++/15861
458         * testsuite/libmudflap.c++/ctors-[12].cxx: New test case halves.
459         * testsuite/libmudflap.c++/ctors.exp: Driver.
460         * testsuite/libmudflap.c++/c++frags.exp: Elide redundant default.
461         Look only for *frag* test cases.
462
463 2004-07-08  Frank Ch. Eigler  <fche@redhat.com>
464
465         ANSI C conversion, libmudflap specialization, recursion limiting.
466         * splay-tree.h (splay_tree_{de,}allocate_fn): Remove allocation_data
467         argument and indirection function pointers, update callers.
468         (splay_tree_s): Add statistics and recursion control fields
469         num_keys, max_depth, depth, rebalance_p.
470         * splay-tree.c (splay_tree_splay_helper): Track recursion depth.
471         Back out of search if it exceeds limit.
472         (splay_tree_splay): Manage recursion limiting with rebalancing as
473         needed.
474         (splay_tree_new): More initialization.
475         (splay_tree_rebalance): New function.
476         (splay_tree_foreach): Rewrite using nonrecursive logic.
477         (splay_tree_xmalloc_allocate, splay_tree_xmalloc_deallocate):
478         Remove.  Point indirect calls to mf-runtime.c's routines.
479         (splay_tree_compare_ints, splay_tree_compare_pointers): Remove unused
480         functions.
481         (splay_tree_delete, splay_tree_delete_helper): Ditto.
482         * testsuite/heap-scalestress.c: New test based on one from
483         Eyal Lebedinsky <eyal@eyal.emu.id.au>:
484
485 2004-07-05  Matthias Klose  <doko@debian.org>
486
487         * libtool-version: New.
488         * Makefile.am (libmudflap_la_LDFLAGS, libmudflapth_la_LDFLAGS):
489         Use -version-info for soname.
490         * Makefile.in: Regenerate.
491         * configure.ac: Remove libtool_VERSION macro
492         * configure: Regenerate
493
494 2004-07-05  Zack Weinberg  <zack@codesourcery.com>
495
496         * mf-runtime.h.in: Wrap declarations of struct __mf_cache,
497         __mf_lookup_cache, __mf_lc_mask, or __mf_lc_shift in
498         #ifndef _MUDFLAP.
499
500 2004-06-29  Frank Ch. Eigler  <fche@redhat.com>
501
502         Splay tree implementation fork.
503         * splay-tree.c, splay-tree.h: Copied & modified from libiberty.
504         Use hard-coded comparison function for uintptr_t.  Remove key/value
505         deallocation logic.  Cache last splayed key for consecutive lookups.
506         * Makefile.am, Makefile.in: Use them, don't link to them.
507         * mf-runtime.c (__mf_object_tree): Adapt to simpler splay_tree_new.
508         (__mf_find_objects2): Flip successor/predecessor search sequence.
509         * ansidecl.h, libiberty.h: Removed dummy files.
510
511 2004-06-29  Nick Clifton  <nickc@redhat.com>
512
513         * configure.ac (AC_CHECK_HEADERS): Add dirent.h
514         * configure: Regenerate.
515         * mf-hooks2.c: Surround uses of dirent.h with #ifdef
516         HAVE_DIRENT_H.
517         Remove spurious inclusion of <strings.h>.
518
519 2004-06-29  Nick Clifton  <nickc@redhat.com>
520
521         * mf-runtime.c (pthread_join): Only apply the weak pragma if the
522         function actually exists.
523
524 2004-06-25  Frank Ch. Eigler  <fche@redhat.com>
525
526         * ansidecl.h, libiberty.h: New dummy files for building splay-tree.
527         * config.h.in: Regenerated.
528
529 2004-06-24  Frank Ch. Eigler  <fche@redhat.com>
530
531         Adopt splay trees for object database.
532         * Makefile.am: Copy splay-tree.* from libiberty.
533         * Makefile.in, testsuite/Makefile.in: Regenerated.
534         * mf-runtime.h.in (__mf_unregister): Add third parameter (type).
535         * mf-hooks[123].c (*): Add new third parameter to mf_unregister.
536         * mf-impl.h (BEGIN_PROTECT): Remove some trace text.
537         * mf-runtime.c: Rewrite code dealing with object database to use
538         libiberty splay trees.  Remove tree liveness aging option.
539         * testsuite/libmudflap.c/fail18-frag.c: Add volatile flag.
540
541 2004-06-15  Paolo Bonzini  <bonzini@gnu.org>
542
543         * configure.ac: New name of configure.in.  Update
544         AC_INIT, AC_CONFIG_SRCDIR, AC_CONFIG_HEADERS, AC_CONFIG_FILES,
545         AC_OUTPUT, AM_INIT_AUTOMAKE to the preferred style for
546         Autoconf 2.5x and Automake 1.7 or later.
547         * configure.in: Remove.
548         * configure: Regenerate.
549
550         * Makefile.am: Remove useless multilib rules.
551         * Makefile.in: Regenerate.
552
553 2004-06-15  Paolo Bonzini  <bonzini@gnu.org>
554
555         * .cvsignore: New file.
556
557 2004-06-10  Stephen Crowley  <stephen.crowley@sbcglobal.net>
558
559         PR libmudflap/13505
560         * mf-hooks2.c (semctl): Add cygwin porting hack.
561
562 2004-06-09  Frank Ch. Eigler  <fche@redhat.com>
563
564         ctype support.
565         * configure.in: Look for ctype header and glibc implementation.
566         * mf-hooks2.c (__ctype_{b,toupper,tolower}_loc): Sample ctype
567         array hooks for glibc 2.3.
568         * mf-runtime.h.in: Wrap them.
569         * mf-runtime.c (__mf_init): Leave marker regarding other ctype
570         implementations.
571         * testsuite/libmudflap.c/pass47-frag.c: New test.
572         * configure, config.h.in: Regenerated.
573
574 2004-06-04  Frank Ch. Eigler  <fche@redhat.com>
575
576         Portability improvements, e.g., libmudflap/15293.
577         * configure.in: Look for glibc extension functions.  Look for
578         support of -f{function,data}-sections.  Look for more headers.
579         Create testsuite/mfconfig.exp.  Correct more "test x.." thinkos.
580         * Makefile.am: Use $(SECTION_FLAGS).  Collapse piecemeal-compiled
581         mf-hooks* into usual single object per source.
582         * mf-hooks*.c: Remove all #if WRAP_foo conditionals.
583         * mf-hooks2.c: #include a bunch more system headers.  Define strnlen
584         if system doesn't provide one.
585         * mf-hooks3.c (struct pthread_info): Add stack_*_alloc fields.
586         (pthread_create): Use it to properly GC dead thread stacks.
587         * mf-runtime.c (__mf_violation): Correct snprintf type warning.
588         * testsuite/Makefile.am: Stop generating site.exp.
589         * testsuite/mfconfig.exp.in: New file.
590         * testsuite/config/default.exp: Load new mfconfig.exp.
591         * testsuite/lib/libmudflap.exp (libmudflap-init): Add extra libraries.
592         (prune_gcc_output): Add glibc static linking warnings.
593         * testsuite/libmudflap.*/*frags.exp: Enumerate needed -lmudflap* libs.
594         * testsuite/libmudflap.c/pass46-frag.c: Ditto.
595         * configure, Makefile, aclocal.m4, config.h.in, testsuite/Makefile.in:
596         Regenerated with autoconf 2.57 and automake 1.7.
597
598 2004-06-04  Per Bothner  <per@bothner.com>
599
600         * configure.in (LIBMUDFLAPTH):  Fix thinko.
601
602         * configure.in:  Check for more headers.
603         * mf-hooks2.c:  Conditionalize on HAVE_SYS_SOCKET_H etc.
604
605         * mf-runtime.c:  In two places conditionalize on SIUSR1 rather than
606         HAVE_SIGNAL as mingw has signal.h but not SIUSR1.
607
608 2004-06-01  Andreas Jaeger  <aj@suse.de>
609
610         * configure.in: Handle multilibs, support
611         --enable-version-specific-runtime-libs.
612         * Makefile.am (lib_LTLIBRARIES): Rename to ...
613         (toolexeclib_LTLIBRARIES): this for multilib support.
614         * Makefile.in: Regenerated.
615         * configure: Regenerated.
616         * aclocal.m4: Regenerated.
617         * config.h.in: Regenerated.
618         * testsuite/Makefile.in: Regenerated.
619
620 2004-06-01  Andreas Jaeger  <aj@suse.de>
621
622         * testsuite/lib/libmudflap.exp (libmudflap-init): Handle
623         multilibs, using multilib directory instead of hardcoded path.
624         Set LD_RUN_PATH.
625
626 2004-05-21  Frank Ch. Eigler  <fche@redhat.com>
627
628         * Makefile.am (AM_MAKEFLAGS): Pass RUNTESTFLAGS.
629         * Makefile.in: Ditto.
630
631 2004-05-18  Kaz Kojima  <kkojima@gcc.gnu.org>
632
633         * acinclude.m4 (lt_cv_deplibs_check_method): Use pass_all on sh*.
634         * aclocal.m4, configure: Rebuilt.
635
636 2004-05-17  Frank Ch. Eigler  <fche@redhat.com>
637
638         * lib/libmudflap.exp (libmudflap-init): For C++ test cases only,
639         import some build settings from libstdc++-v3 testsuite_flags.
640         * .../cfrags.exp, .../c++frags.exp, .../cthfrags.exp: Corresponding
641         changes to pass test language.
642
643         * mf-runtime.c (__mfu_check): Poison the cache with antidote for
644         quicker mode-nop handling.
645
646 2004-03-25  Frank Ch. Eigler  <fche@redhat.com>
647
648         * mf-impl.h: Added libgcc license header.
649
650 2004-03-20  Frank Ch. Eigler  <fche@redhat.com>
651
652         * mf-hooks[123].c, mf-runtime.c, mf-heuristics.c:
653         Added libgcc license header.
654         * mf-hooks3.c (__mf_0fn_pthread_create): Correct arg constness.
655         (pthread_create): Simplify stack allocation syntax.
656
657 2004-03-08  Loren J. Rittle  <ljrittle@acm.org>
658
659         * mf-hooks2.c: Support FreeBSD.
660         (WRAP_gets): Avoid gets().
661         * testsuite/libmudflap.c/pass-stratcliff.c: Do not
662         test unimplemented mem/str calls on FreeBSD.
663         * testsuite/libmudflap.c/pass21-frag.c: Do not include
664         <alloca.h> on FreeBSD.
665
666 2004-01-30  Frank Ch. Eigler  <fche@redhat.com>
667
668         * testsuite/libmudflap.c/pass36-frag.c: Add missing free() call.
669         * testsuite/libmudflap.c/pass46-frag.c: New test for -fmudflapir.
670         * testsuite/libmudflap.cth/cthfrags.exp: Add -DSTATIC to compiler
671         flags for static linking permutation.
672         * testsuite/libmudflap.cth/pass40-frag.c: When -DSTATIC, avoid
673         some pthreads code that croaks on linux glibc tls.
674
675 2004-01-27  Frank Ch. Eigler  <fche@redhat.com>
676
677         * testsuite/libmudflap.c/fail31-frag.c, pass45-frag.c: New tests.
678
679 2004-01-15  Frank Ch. Eigler  <fche@redhat.com>
680
681         * testsuite/libmudflap.c/pass44-frag.c: New test.
682
683 2004-01-12  Frank Ch. Eigler  <fche@redhat.com>
684
685         * testsuite/libmudflap.c/fail{28,29,30}-frag.c: New tests.
686
687 2004-01-08  Frank Ch. Eigler  <fche@redhat.com>
688
689         * testsuite/libmudflap.c/pass43-frag.c: Added missing program rc.
690
691 2003-12-11  Frank Ch. Eigler  <fche@redhat.com>
692
693         * testsuite/libmudflap.c/pass42-frag.c, pass43-frag.c: New tests.
694
695 2003-12-08  Andrew Pinski  <pinskia@physics.uc.edu>
696
697         PR libmudflap/12670
698         * configure.in: Add check for see if
699         socklen_t typedef is in sys/socket.h.
700         * mf-hooks1.c: Add define if socklen_t
701         is not typedef.
702         * mf-hooks2.c: Likewise.
703         * mf-hooks3.c: Likewise.
704         * config.h.in: Regen.
705         * configure: Regen.
706
707 2003-12-08  Frank Ch. Eigler  <fche@redhat.com>
708
709         * mf-runtime.c (__mf_watch_or_not): Tweak tracing message.
710         * testsuite/libmudflap.c/fail21-frag.c: Defeat aliasing
711         optimizations.
712         * testsuite/libmudflap.c/pass25-frag.c: Ditto.
713         * testsuite/libmudflap.c/pass26-frag.c: Tolerate non-overlapping
714         (unoptimized) allocation of stack space.
715
716 2003-12-07  Richard Henderson  <rth@redhat.com>
717
718         * testsuite/libmudflap.c/fail23-frag.c (main): Adjust addend to 11.
719         * testsuite/libmudflap.c/fail27-frag.c (foo): Mark noinline.
720
721 2003-12-06  Andrew Pinski <apinski@apple.com>
722
723         partial PR libmudflap/12670
724         * mf-hooks1.c: Respect Darwin checks.  Conditionalize POSIX_SOURCE.
725         * mf-hooks2.c: Likewise.
726         * mf-hooks3.c: Likewise.
727
728 2003-11-19  Frank Ch. Eigler  <fche@redhat.com>
729
730         libstdc++/11696
731         * mf-runtime.h.in: Switch to #pragma redefine_extname for
732         symbols interposed at compile time.
733         * testsuite/libmudflap.c++/pass41-frag.cxx: New test.
734
735         libmudflap/12939
736         * mf-hooks2.c (semctl): Tolerate FreeBSD.
737
738         * configure.in: Reorganize check for <pthread.h>.
739         * configure: Regenerated.
740
741 2003-11-04  David Edelsohn  <edelsohn@gnu.org>
742
743         * mf-runtime.c (_ALL_SOURCE): Define for AIX.
744         (_LARGE_FILE_API): Define for AIX.
745         * mf-hooks[123]: Same.
746         (_XOPEN_SOURCE_EXTENDED): Define to 1 for AIX.
747
748 2003-10-21  David Edelsohn  <edelsohn@gnu.org>
749
750         * mf-runtime.c (_XOPEN_SOURCE_EXTENDED): Define to 1 for AIX.
751
752 2003-07-29  Frank Ch. Eigler  <fche@redhat.com>
753
754         2003-07-29  Gerald Pfeifer  <pfeifer@dbai.tuwien.ac.at>
755
756         * configure.in: Update check for union semun.
757
758 2003-07-29  Gerald Pfeifer  <pfeifer@dbai.tuwien.ac.at>
759
760         PR other/11673
761         * mf-hooks2.c [WRAP_semctl]: Fix check for HAVE_UNION_SEMUN.
762
763 2003-07-29  Frank Ch. Eigler  <fche@redhat.com>
764
765         PR other/11673
766         * configure.in: Add checks for 64-bit LFS functions, struct semun
767         definition, for BSD compatibility.
768         * mf-hooks1.c: Respect BSD checks.  Conditionalize POSIX_SOURCE.
769         * mf-hooks2.c: Ditto.  Include <strings.h> for bcmp* decls.
770         * mf-hooks3.c: Ditto.
771         (pthread_create): Try MAP_ANON on platforms without the MAP_ANONYMOUS
772         mmap flag.
773         * configure, config.h.in: Regenerated.
774
775 2003-07-23  Frank Ch. Eigler  <fche@redhat.com>
776
777         Multithreading fixes:
778         * mf-runtime.c (__mf_object): Store allocating/deallocating
779         thread id.
780         (options): Support new "-thread-stack" option.
781         Rename "-heur-argv-environ" option to "-heur-stdlib".
782         Disable "-lc-mask" and "-lc-shift" options.
783         (__mf_dynamic): Add function pointers for pthread_join/_exit.
784         (__assert_fail): New self-contained function for glibc.
785         * mf-hooks3.c: Essentially rewritten, particularly related to
786         use of __mf_pthread_info array.
787         (pthread_join, _exit): New hook functions.
788         * mf-impl.h (BEGIN_PROTECT): Handle starting_p case.
789         * testsuite/libmudflap.cth/pass40-frag.c: New test.
790
791         Warning cleanups:
792         * mf-heuristics.c: Add type casts for tracing, sub calls.
793         * mf-impl.h (BEGIN_PROTECT): Redefine to omit result type.
794         Update all callers to declare explicit result holder.
795         (END_PROTECT): Removed.
796         * testsuite/*/*frags.exp: Clean up default MUDFLAP_OPTIONS.
797
798 2003-07-15  Diego Novillo  <dnovillo@redhat.com>
799
800         * testsuite/libmudflap.c/fail21-frag.c: Add volatile modifiers.
801         * testsuite/libmudflap.c/fail15-frag.c: Likewise.
802         * testsuite/libmudflap.c/fail13-frag.c: Likewise.
803
804 2003-07-04  Frank Ch. Eigler  <fche@redhat.com>
805
806         * mf-hooks1.c, 2.c, 3.c: New file, splits up content from old ...
807         * mf-hooks: Removed.
808         * mf-impl.h (MF_VALIDATE_EXTENT, BEGIN_PROTECT, END_PROTECT):
809         Move these macros from old mf-hooks.c here.
810         * Makefile.am: Adapt to split-up hook sources for faster builds.
811         * Makefile.in: Regenerated.
812
813         * mf-heuristics.c: Remove #if-0 block.
814
815         * mf-impl.h (__mf_state): Reorganize declaration and implementation.
816         (__mf_starting_p): New state only for use while dlsym bootstrapping.
817         (CALL_REAL, __mf_init): Corresponding changes.
818         (TRACE, VERBOSE_TRACE): Include thread id and "mf:" prefix.  Update
819         all callers to remove redundant "mf:" prefix.
820         * mf-runtime.h.in: #define a few reentrancy macros for libmudflapth.
821         * mf-hooks3.c: Rewrite chunks to support per-thread __mf_state value.
822         (__mf_pthread_info): Become a hash table.
823
824         * testsuite/lib/mfdg.exp: Support new "dg-timeout" and
825         "dg-repetitions" directives to control test case execution.
826         * testsuite/libmudflap.cth/pass37-frag.c: Add timeout and repeat
827         options.
828         * testsuite/libmudflap.cth/pass39-frag.c: Ditto for this new test.
829
830 2003-06-25  Frank Ch. Eigler  <fche@redhat.com>
831
832         * mf-hooks.c (alloca): Separate into stub.
833         (__mf_wrap_alloca_indirect): New function.  Use CALL_REAL
834         malloc/free for alloca blocks.
835         (pthread_create): Tolerate failing pthread_attr_get* calls.
836         * mf-runtime.c (__mf_fini): Call __mf_wrap_alloca_indirect.
837         * mf-impl.h (CALL_WRAP): Remove macro.
838         * testsuite/libmudflap.c/pass21-frag.c: Include <alloca.h>.
839         * testsuite/libmudflap.c/pass23-frag.c: Include more struct
840         padding for ia64 BIT_FIELD_REF constructs.
841
842 2003-06-19  Frank Ch. Eigler  <fche@redhat.com>
843
844         * mf-hooks.c (struct pthread_info): Add "thread_errno" field.
845         (__mf_pthread_spawner, __mf_pthread_cleanup): Use it with GUESS
846         libmudflap object type.
847         * mf-runtime.c (__mfu_unregister): Correct cemetary logic to avoid
848         crashes on unregistering STATIC objects.
849
850 2003-06-17  Frank Ch. Eigler  <fche@redhat.com>
851
852         Based on patch from Eyal Lebedinsky <eyal@eyal.emu.id.au>:
853         * mf-hooks.c (__mf_pthread_spawner): Register thread errno.
854         (time, strerror, fopen, fopen64, fclose, fread): New hooks.
855         (fwrite, fgetc, fgets, getc, gets, ungetc, fputc): New hooks.
856         (fputs, putc, puts, clearerr, feof, ferror, fileno): New hooks.
857         (printf, fprintf, sprintf, snprintf, vprintf, vfprintf): New hooks.
858         (vsprintf, vsnprintf, access, remove, fflush, fseek): New hooks.
859         (fseeko64, ftell, ftello64, rewind, fgetpos, fsetpos): New hooks.
860         (stat, stat64, fstat, lstat, mkfifo, setvbuf, setbuf): New hooks.
861         (setvbuf, opendir, closedir, readdir, recv, recvfrom): New hooks.
862         (recvmsg, send, sendto, sendmsg, setsockopt, getsockopt): New hooks.
863         (accept, bind, connect, gethostname, sethostname): New hooks.
864         (gethostbyname, wait, waitpid, popen, pclose, execve): New hooks.
865         (execv, execvp, system, dlopen, dlclose, dlerror, dlsym): New hooks.
866         (semop, semctl, shmctl, shmat, shmdt): New hooks.
867         * mf-runtime.h.in: Corresponding changes.
868         * mf-runtime.c (__mf_ini): Register stdio objects.  Use STATIC type.
869         (opts) Rename heur_argv_environ to heur_std_data.
870         (__mf_wrap_main): Use STATIC type for argv/environ strings.
871         * Makefile.am: Corresponding changes.
872         * Makefile.in: Regenerated.
873
874 2003-06-11  Frank Ch. Eigler  <fche@redhat.com>
875
876         * mf-heuristics.c (__mf_heuristic_check): Disable stack_bounds
877         heuristic for threaded case, and for non-x86-linux targets.
878         * mf-hooks.c (__mf_0fn_calloc): Provide a working dummy implementation
879         for use during pre-main() program startup.
880         (__mf_0fn_*): Make these functions non-static.
881         * mf-impl.h (DECLARE, CALL_REAL): Support calls to 0fn backup hook
882         functions.
883         * mf-runtime.c (__mf_state): Set initial state to "starting".
884         (__mf_resolve_single_dynamic): Tolerate repeated calls for same symbol.
885         (__wrap_main): New function to register argv[] and environ[] strings.
886         (__mf_ini): Call it.
887         (*): In all trace functions, use "%p" as formatter for uintptr_t.
888
889         * testsuite/libmudflap.c/pass38-frag.c: New test case.
890         * testsuite/libmudflap.cth/pass37-frag.c: Improved test.
891
892         * acinclude.m4: Add comments with aoliva's concerns about x86_64
893         pass_all.
894         * aclocal.m4, configure: Regenerated.
895
896 2003-06-04  Frank Ch. Eigler  <fche@redhat.com>
897
898         * acinclude.m4: Correct typo in AC_MSG_CHECKING.
899         * aclocal.m4, configure: Regenerated.
900
901 2003-06-03  Frank Ch. Eigler  <fche@redhat.com>
902
903         * acinclude.m4: Force "pass_all" deplibs_check_method for libtool
904         for x86_64 target.  Disable caching for this value.
905         * aclocal.m4, configure: Regenerated.
906
907 2003-06-02  Frank Ch. Eigler  <fche@redhat.com>
908
909         * testsuite/libmudflap.c/pass38-frag.c: Deleted.  -fwritable-strings
910         is about to become deprecated, and its present handling bugs are
911         unworthy of fixing.
912
913 2003-05-30  Frank Ch. Eigler  <fche@redhat.com>
914
915         * testsuite/libmudflap.c/pass38-frag.c: New test for
916         -fwritable-strings.
917
918 2003-05-23  Frank Ch. Eigler  <fche@redhat.com>
919
920         * mf-runtime.c (__mf_sigusr1_handle): Call unlocked variant of
921         __mf_report, asserting reentrant calling context.
922
923 2003-05-23  Frank Ch. Eigler  <fche@redhat.com>
924
925         * mf-hooks.c (realloc): Correct reentrancy logic.
926         * testsuite/libmudflap.c/hook-allocstuff.c: New test case.
927
928 2003-05-20  Frank Ch. Eigler  <fche@redhat.com>
929
930         * mf-hooks.c (LIBMUDFLAPTH_THREADS_MAX): New macro, replaces
931         PTHREAD_THREADS_MAX.  Update users.
932         * mf-runtime.c (__mf_usage): Print [active] instead of [default]
933         for active options.
934         * testsuite/Makefile.am (all-local): Prime dejagnu site.exp file
935         with libmudflapth presence indicator.
936         * testsuite/Makefile.in: Regenerated.
937
938 2003-05-16  Frank Ch. Eigler  <fche@redhat.com>
939
940         * Makefile.am (AM_CFLAGS): Remove "-ansi".
941         * configure.in: Remove silly no-pthreads => no-shared logic.
942         * Makefile.in, configure: Regenerated.
943         * mf-heuristics.c (__mf_heuristic_check): Remove reentrancy hacks.
944         * mf-hooks.c (BEGIN_PROTECT, END_PROTECT): Reorganize reentrancy
945         code.  Count reentrancy events.
946         (all hook functions): Don't directly manipulate __mf_state variable.
947         Add TRACE calls to hook functions without them.
948         * mf-impl.h (LOCKTH): Try to count lock contention events.
949         (VERBOSE_TRACE, TRACE): Remove reentrancy hacks.
950         * mf-runtime.c (BEGIN_RECURSION_PROTECT, END_RECURSION_PROTECT):
951         Reorganize reentrancy code.
952         (external __mf_ entry points): Use RECURSION_PROTECT mechanism to
953         identify reentrancy with mutex holding times.
954         (internal __mfu_ entry points): Remove internal reentrancy code.
955         (__mf_init): Use ordinary locked calls.
956         (__mfu_report): Print the two new counts.
957         * testsuite/lib/libmudflap.exp: Filter out junk ld/pthreads messages.
958         * testsuite/libmudfap.cth/cthfrags.exp: New test driver.
959         * testsuite/libmudflap.cth/pass37-frag.c: New pthreads test.
960         * testsuite/libmudfap.cth/cfrags.exp: Adapt to new libmudflap
961         option defaults.
962
963 2003-05-09  Frank Ch. Eigler  <fche@redhat.com>
964
965         * configure.in: Add pthread support, plus glibc and porting hacks.
966         * Makefile.am (LIBMUDFLAPTH): New conditional, to build -lmudflapth
967         from objects built into ./pth/.
968         * mf-runtime.c (__mfu_watch,register,...): Fork new unlocked
969         functions for internal entry points.  Update callers to pick
970         locked vs. unlocked variants.
971         (__mf_resolve_single_dynamic): Extend to support symbol versioning
972         info coming in from a static data structure.
973         (*): Reorder miscellaneous declarations to group data vs functions.
974         (__mf_set_default_options): Simplify.
975         (__mf_usage): Mention threading status of host executable.
976         * mf-impl.h: Move max/min decls here.  Reorganize __mf_dynamic
977         decls to match above.
978         (LOCKTH, UNLOCKTH): New macros for Big Libmudflap Lock management.
979         * mf-heuristics.c: Choose between locked/unlocked calls.  Add
980         some lock/unlock markers.  Remove some unused code.
981         * mf-hooks: Ditto.
982         (pthread_create): New hook function.
983         (__mf_pthread_cleanup, _spawner): New helper functions.
984         * configure. aclocal.m4, config.h.in, Makefile.in: Regenerated.
985
986 2003-05-02  Frank Ch. Eigler  <fche@redhat.com>
987
988         * testsuite/libmudflap.c/fail27-frag.c: Add more volatile flags.
989
990 2002-04-28  Frank Ch. Eigler  <fche@redhat.com>
991
992         * Makefile.am (HOOKOBJS): Add *time related hooks.
993         * configure.in: Look for pthreads.h header.
994         * mf-hooks.c (asctime, ctime, gmtime, localtime): New wrappers.
995         * mf-runtime.c: Begin sketching some pthreads support.
996         (__mf_usage): Check for -lpthread presence.
997         (__mf_unregister): Confirm matching unregistration base.
998         (__mf_find_objects_rec): Reduce unnecessary recursion.
999         * mf-runtime.h.in: Add "nothrow" attribute to functions.  Add
1000         #defines for new hook functions.
1001         * mf-impl.h: Corresponding changes.
1002         * config.h.in, configure, Makefile.in: Regenerated.
1003
1004 2002-04-27  Diego Novillo  <dnovillo@redhat.com>
1005
1006         * testsuite/libmudflap.c/fail1-frag.c: Add volatile
1007         modifiers to prevent being optimized away.
1008         * testsuite/libmudflap.c/fail10-frag.c: Likewise.
1009         * testsuite/libmudflap.c/fail13-frag.c: Likewise.
1010         * testsuite/libmudflap.c/fail14-frag.c: Likewise.
1011         * testsuite/libmudflap.c/fail15-frag.c: Likewise.
1012         * testsuite/libmudflap.c/fail2-frag.c: Likewise.
1013         * testsuite/libmudflap.c/fail20-frag.c: Likewise.
1014         * testsuite/libmudflap.c/fail3-frag.c: Likewise.
1015
1016 2003-04-15  Frank Ch. Eigler  <fche@redhat.com>
1017
1018         * Makefile.am (libmudflap_la_LIBADD): Remove -ldl.
1019         * configure.in: Look for uintptr_t and -ldl on target.
1020         * mf-runtime.h.in: Adjust uintptr_t declaration logic.
1021         * Makefile.in, aclocal.m4, configure, config.h.in: Regenerated.
1022         * testsuite/Makefile.in: Regenerated.
1023         * mf-runtime.c (__mf_sigusr1_respond): Tweak declaration and calls
1024         for better C compliance.
1025
1026 2003-04-15  Frank Ch. Eigler  <fche@redhat.com>
1027
1028         * mf-hooks.c (MF_VALIDATE_EXTENT): Remove unnecessary reentrancy
1029         prevention code.
1030         * mf-runtime.c (__mf_set_default_options): Turn off
1031         check-initialization.
1032         (__mf_describe_object): Shorten description.
1033         * testsuite/libmudflap.c/fail25-frag.c: Turn on check-initialization.
1034
1035 2003-04-07  Frank Ch. Eigler  <fche@redhat.com>
1036
1037         * mf-hooks.c (__mf_0fn_mmap): Correct return value, as per <rth>.
1038
1039 2003-04-02  Frank Ch. Eigler  <fche@redhat.com>
1040
1041         * mf-hooks.c (BEGIN_PROTECT): Handle startup-time reentrant
1042         calls specially.
1043         (__mf_0fn_malloc ... _munmap): New dummy backup calls.
1044         * mf-impl.h (CALL_BACKUP): New macros.
1045         * mf-runtime.c (__mf_init): Tweak __mf_state during startup.
1046
1047 2003-03-31  Frank Ch. Eigler  <fche@redhat.com>
1048
1049         * Makefile.am (AM_CFLAGS): Remove optimization flags.
1050         (HOOKOBJS): Remove dlopen hook.
1051         (libmudflap_la_LIBADD): Add -ldl.
1052         * mf-hooks.c (dlopen): Remove hook.
1053         * mf-impl.h (__mf_dynamic): Ditto.
1054         * mf-runtime.c (__mf_resolve_dynamics): Ditto.
1055         * Makefile.in: Regenerated.
1056
1057 2003-03-28  Frank Ch. Eigler  <fche@redhat.com>
1058
1059         * configure.in: Check for target gettimeofday, signal, some headers.
1060         * mf-impl.h (__mf_opts): Add new "sigusr1_report" field.  Comment
1061         out inop multi_threaded field.
1062         * mf-runtime.c (options): Handle new "-sigusr1-report" option.
1063         (__mf_set_options): Correct handling of "-help".
1064         (__mf_sigusr1_respond): New function to manage SIGUSR1 response.
1065         (__mf_check, __mf_register, __mf_unregister): Call it.
1066         (__mf_insert_new_object, __mf_unregister): Respect HAVE_GETTIMEOFDAY.
1067         (__mf_report_leaks): Make callable
1068         (__mf_tree_analyze): Traverse in-order.  Accumulate address bit
1069         distribution statistics.
1070         (__mf_adapt_cache): Rewrite shift guessing logic based on address
1071         bit distributions.
1072         * config.h.in, configure: Regenerated.
1073         * testsuite/libmudflap.c/fail27-frag.c: New test.
1074         * testsuite/libmudflap.c/pass36-frag.c: New test.
1075
1076 2003-03-11  Frank Ch. Eigler  <fche@redhat.com>
1077
1078         * mf-runtime.h.in: Tweak.
1079         * Makefile.am, configure.in: Tweak mf-runtime.h generation some more.
1080         Don't use intermediate files nor AC_OUTPUT-time postprocessing.
1081         * Makefile.in, testsuite/Makefile.in, configure: Regenerated.
1082
1083 2003-03-10  Frank Ch. Eigler  <fche@redhat.com>
1084
1085         * configure.in: Tweak generation of mf-runtime.h some more.  It
1086         needs to work from both config.status and configure.
1087         * configure: Regenerated.
1088
1089 2003-03-10  Frank Ch. Eigler  <fche@redhat.com>
1090
1091         * Makefile.am: Reorganize hook file building.  Add auto dependencies.
1092         * configure.in: Tweak generation of mf-runtime.h.
1093         * mf-runtime.h.in: Add new __MF_TYPE_HEAP_I.
1094         * mf-hooks.c (*): Adapt to initialized-heap object type.
1095         * mf-impl.h: Tweak cemetary boundaries.
1096         * mf-runtime.c (__mf_check): Adapt to new initialized-heap object
1097         type.
1098         (__mf_insert_new_object, __mf_register, __mf_unregister): Ditto.
1099         (__mf_describe_object, __mf_report_leaks, __mf_violation): Ditto.
1100         * testsuite/lib/libmudflap.exp (includes): Include build tree.
1101         * testsuite/libmudflap.c/pass{26,5}: Further adapt to initialization
1102         checking.
1103         * testsuite/.../fail{25,26}-frag.c: New tests.
1104         * testsuite/.../pass{32,33,34,35}-frag.c: New tests.
1105         * Makefile.in, configure: Regenerated.
1106
1107 2003-03-05  Frank Ch. Eigler  <fche@redhat.com>
1108
1109         * mf-runtime.c (__mf_set_default_options): Turn on initialization
1110         checking by default.
1111         (__mf_insert_new_object): As a temporary hack, assume that new
1112         objects registered on the stack start out initialized.
1113         * testsuite/libmudflap.c/fail9,pass23,pass[6789]-*: Initialize
1114         heap objects by hand.
1115
1116 2003-03-05  Frank Ch. Eigler  <fche@redhat.com>
1117
1118         Switch to macro-style hooks for str*/mem*/b* functions.
1119         * mf-runtime.h.in (__MF_TYPE_*): Moved some internal values out.
1120         (mem*, str*, b*): Added macro-style hooks for _MUDFLAP case.
1121         * mf-runtime.c: #include config.h to enable glibc backtraces again.
1122         (__mf_set_default_options): Turn off heur_proc_map.
1123         (*): Adapt to to macro-style hook functions.
1124         (__mf_object_dead_head, __mf_object_cemetary): Correct bounds.
1125         (__mf_check, __mf_register, __mf_unregister): Tweak tracing message.
1126         (__mf_violation): Handle __MF_VIOL_WATCH.
1127         * mf-impl.h (__MF_TYPE_*): Moved these internal values here.
1128         (__mf_dynamic): Removed mem*/str*/b* functions.
1129         (TRACE, VERBOSE_TRACE): Add reentrancy locking.
1130         (WRAPPER2): New macro for macro-style hooks.
1131         * mf-hooks.c: Convert mem*/str*/b* functions to simpler
1132         macro-style hooks.
1133         (BEGIN_PROTECT): Tweak tracing vs reentrancy-lock ordering.
1134         * mf-heuristics.c: Adapt to macro-style hook functions.
1135         Correct some comments.
1136         * testsuite/lib/mfdg.exp (dg-test): Simplify result string for
1137         output pattern tests.
1138         * testsuite/libmudflap.c/fail[89]-frag.c: Elaborate output test.
1139         * testsuite/libmudflap.c++/c++frags.exp: Enable non-static tests.
1140
1141 2003-02-28  Frank Ch. Eigler  <fche@redhat.com>
1142
1143         * testsuite/libmudflap.c/fail23-frag.c, pass30-frag.c: New tests
1144         for global array registration.
1145         * testsuite/libmudflap.c++/fail24-frag.cxx, pass31-frag.cxx: Ditto.
1146         * testsuite/libmudflap.c++/c++frags.exp: Tweak -static multilib hack.
1147
1148 2003-02-27  Frank Ch. Eigler  <fche@redhat.com>
1149
1150         * Makefile.am: Add gross make bug workarounds.  Tweaked
1151         SUBDIRS and AM_CFLAGS.
1152         * Makefile.in: Regenerated.
1153
1154 2003-02-26  Frank Ch. Eigler  <fche@redhat.com>
1155
1156         Switch to dejagnu.
1157         * configure.in (AC_PROG_CXX): Don't look for C++ any more.
1158         * Makefile.am (TESTS): Remove simple automake testing.
1159         * configure, Makefile.in: Regenerated.
1160         (SUBDIRS): Include new testsuite/ directory.
1161         * tests/*: Removed all files; moved bulk under:
1162         * testsuite/*: New subdirectory tree.
1163         * testsuite/libmudflap.c/cfrags.exp: New file, C test driver.
1164         * testsuite/libmudflap.c++/c++frags.exp: New file, C++ test driver.
1165         * testsuite/lib/libmudflap.exp: New file, derived from libstdc++.
1166         * testsuite/lib/mfdg.exp: New file, derived from dejagnu.
1167         * testsuite/config/default.exp: New file.
1168         * testsuite/Makefile.am, Makefile.in: New files.
1169
1170 2003-01-29  Frank Ch. Eigler  <fche@redhat.com>
1171
1172         * Makefile.am (TESTS_ENVIRONMENT): Remove redundant "-mode-check".
1173         (TESTS): Add fail22 and pass29 tests.
1174         * mf-runtime.h.in: Change API to take void*/size_t region parameters.
1175         Add new access-type parameter for __mf_check.  Move __MF_VIOL* out.
1176         * mf-impl.h: Corresponding changes.  Update CLAMP* macros for void*
1177         values.  Move __MF_VIOL* here.
1178         * mf-runtime.c (*): Adapt to void*/size_t API in mf-runtime.h.
1179         (check_initialization): New field in __mf_opts.  Default off.
1180         (read_count,write_count): New fields in __mf_object.
1181         (__mf_check): Implement basic initialization checking.
1182         (__mf_insert_new_object): Assume STATIC|GUESS regions are initialized.
1183         (__mf_describe_object): Print new fields.
1184         (__mf_violation): Identify check/read vs. check/write in messages.
1185         * test/pass29-frag.c, test/fail22-frag.c: Basic tests for new
1186         "-check-initialized" mudflap option.
1187         * test/pass25-frag.c, test/fail21-frag.c: Adapt to API changes.
1188         * mf-hooks.c (MF_VALIDATE_EXTENT): Add new access-type parameter.
1189         Drop __FILE__/__LINE__ hack.  Update callers.
1190         (*): Adapt to new mf-runtime.h API.
1191         * Makefile.in: regenerated.
1192
1193 2003-01-24  Frank Ch. Eigler  <fche@redhat.com>
1194
1195         * configure.in: Build mf-runtime.h a more proper way.
1196         * mf-hooks.c (strdup, strndup): Correct reentrancy logic.
1197         * mf-runtime.c (verbose_violations): Turn on by default.
1198         * mf-runtime.h.in: Remove some miscellaneous stuff ...
1199         * mf-impl.h: ... and move it here.
1200         * configure: Regenerated.
1201
1202 2003-01-22  Frank Ch. Eigler  <fche@redhat.com>
1203
1204         * configure.in: Look for C++ compiler.
1205         * test/*-frag.c, mf-driver.c: Reformatted with GNU indent and
1206         fixed type warnings when built with C++.
1207         * test/pass27-frag.cxx, pass28-frag.cxx: New C++ tests.
1208         * Makefile.am (TESTS): Run them.
1209         (*) Add new rules for building and running C++ tests.
1210         (TESTFLAGS): Set new default to avoid libstdc++-v3 shlib issues.
1211         * mf-runtime.h.in: Protect with extern "C".
1212         * Makefile, configure: Regenerated.
1213
1214 2003-01-06  Frank Ch. Eigler  <fche@redhat.com>
1215
1216         Portability improvements.
1217         * configure.in: Look for glibc backtrace headers/functions.
1218         * mf-hooks.c: Don't include <execinfo.h> any more.
1219         * mf-runtime.c (__mf_set_options): Call more stdlib functions
1220         via CALL_REAL.
1221         (__mf_backtrace): Provide alternate baby implementation in
1222         absence of glibc.
1223         * test/mf-driver.c: Portability tweaks.
1224         * acinclude.m4: New file, containing top level libtool.m4.
1225         * aclocal.m4, configure, Makefile.in, config.h.in: Regenerated.
1226
1227 2002-12-19  Frank Ch. Eigler  <fche@redhat.com>
1228
1229         * mf-runtime.h.in (HAVE_UINTPTR_T): Define unconditionally.
1230
1231 2002-11-08  Frank Ch. Eigler  <fche@redhat.com>
1232
1233         * mf-runtime.c (options): Add new "wipe-heap", "wipe-stack"
1234         options.
1235         (__mf_unregister): Implement stack/heap object wiping.
1236         (__mf_set_options): Renamed from __mf_process_opts.
1237         (__mf_uncache_object): Change arg type, correct callers.
1238         * mf-impl.h: Corresponding changes.
1239         * mf-hooks.c (realloc): Save/restore heap-wiping flag.
1240         * mf-runtime.h.in (__mf_set_options): Extend public API.
1241         * test/pass26-frag.c: New test for stack wiping.
1242         * Makefile.am (TESTS): Run it.
1243         * Makefile.in: Regenerated.
1244
1245 2002-11-07  Frank Ch. Eigler  <fche@redhat.com>
1246
1247         * mf-runtime.h.in (__mf_watch, __mf_unwatch): Extend public API.
1248         * mf-runtime.c (__mf_object_t): Add watching_p field.
1249         (__mf_watch_or_not): New function to implement
1250         object watch flagging.
1251         (__mf_watch, __mf_unwatch): New wrappers for above.
1252         (__mf_check, __mf_describe_object): Handle objects with watching_p.
1253         (__mf_count_violation): Enlarge array.
1254         (__mf_uncache_object): Renamed from __mf_remove_old_object.  Don't
1255         unlink object.  Clear cache properly.
1256         (__mf_unregister): Unlink object explicitly before uncaching.
1257         * test/fail21-frag.c, pass25-frag.c: New tests.
1258         * Makefile.in, aclocal.m4: Regenerated.
1259
1260 2002-11-05  Frank Ch. Eigler  <fche@redhat.com>
1261
1262         * test/fail20-frag.c: New test for NULL pointer dereferencing.
1263         * Makefile.am (TESTS): Add it.
1264         * test/pass-stratcliff.c: Add decls of stpcpy.
1265         * configure.in: Test for <stdint.h>.  Generate mf-runtime.h in
1266         build tree from config.h and new file mf-runtime.h.in.
1267         * mf-runtime.h.in: Renamed from mf-runtime.h.  Tweak uintptr_t decl.
1268         * Makefile.in, configure, config.h.in: Regenerated.
1269         * mf-hooks.c: Add #undef for wrapped glibc str*/mem* macros.
1270         * mf-runtime.c (options, __mf_set_default_options): Support new
1271         default "abbreviate" option.
1272         (__mf_object.description_epoch): New field.
1273         (__mf_describe_object): Conditionally abbreviate objects already
1274         displayed in current epoch.  Accept NULL input to increment epoch.
1275         (__mf_fini, __mf_ini): Reset description epoch.
1276         (__mf_register, __mf_unregister, __mf_adapt_cache, __mf_init): Ensure
1277         that NULL pointer slot in lookup cache is invalidated.  Register a
1278         NOACCESS region around NULL.
1279         * mf-impl.h: Corresponding changes.
1280
1281 2002-10-16  Frank Ch. Eigler  <fche@redhat.com>
1282
1283         * test/fail19-frag.c, pass24-frag.c, pass-stratcliff.c: New tests.
1284         * Makefile.am: Run them.  Install mf-runtime.h.
1285         * Makefile.in: Regenerated.
1286         * mf-hooks.c: Add some markers for more missing functions.
1287         * mf-runtime.c (__mf_adapt_cache): Experiment with a utilization-based
1288         statistic to tune tune cache size (mask).
1289
1290 2002-10-01  Frank Ch. Eigler  <fche@redhat.com>
1291
1292         * test/pass23-frag.c: New test for bit_field_ref expressions.
1293         * Makefile.am, Makefile.in: Add new test.
1294         * mf-hooks.c (mmap, munmap): Rewrite to track individual pages.
1295         (MF_VALIDATE_EXTENT): Accept zero-size mem/str operations.
1296         * mf-runtime.c (__mf_init): Register errno global.
1297         (__mf_find_object): Removed function.
1298         (__mf_check): Rewrite logic to support accesses across some
1299         contiguous but distinctly registered objects.
1300         (__mf_remove_old_object): Tolerate cache entries that span
1301         contiguous objects.
1302
1303 2002-09-30  Frank Ch. Eigler  <fche@redhat.com>
1304
1305         * test/pass21-frag.c, pass22-frag.c: New tests: alloca, bitfields.
1306         * Makefile.am, Makefile.in: Run new tests.
1307         * mf-hooks.c (alloca): Correct stack direction logic.
1308
1309 2002-09-26  Frank Ch. Eigler  <fche@redhat.com>
1310
1311         * mf-impl.h (adapt_cache): New option.
1312         * mf-runtime.c (__mf_set_default_options): Set its default value.
1313         Tweak the tree_aging parameter down.
1314         (__mf_check): Maintain separate counter for cache-adaptation.
1315         (__mf_tree_analyze): New function to collect object tree stats.
1316         (__mf_adapt_cache): New function to automate cache parameters.
1317
1318 2002-09-24  Frank Ch. Eigler  <fche@redhat.com>
1319
1320         * mf-heuristics.c (__init_misc, __mf_heuristic_check): Add
1321         hypothetical #if-0'd argv/envp region registration.
1322         * mf-runtime.c (__mf_init): Add kludged form of above.
1323         (*) Add "heur_argv_environ" flag, default on, to govern this.
1324         * mf-impl.h: Corresponding changes.
1325
1326 2002-09-20  Frank Ch. Eigler  <fche@redhat.com>
1327
1328         * test/fail18-frag.c: New test file for NOACCESS regions.
1329         * Makefile.am (TESTS): Add new test.
1330         * Makefile.in: Regenerated.
1331
1332         * mf-heuristics.c (__mf_heuristics_check): Correct deja_vu logic.
1333         * mf-impl.h (tree_aging): Add new mudflap_option, default 1000000.
1334         (optimize_object_tree): Remove unused mudflap_option.
1335         * mf-runtime.h (__MF_TYPE_NOACCESS): New region type.  Add printing
1336         support throughout.  Use .._MAX_CEM for cemetary upper bound.
1337         * mf-runtime.c (__mf_init): Register __mf_* globals as NOACCESS
1338         regions.
1339         (__mf_object): Add new liveness field for use by tree aging.
1340         (__mf_check): Trigger tree aging when needed.
1341         (__mf_age_tree): New function to decay liveness field.
1342         (__mf_find_objects_rec): Use liveness field to rotate tree.
1343         (__mf_insert_new_object): Only provide backtrace for HEAP objects.
1344         (__mf_unregister): Ditto.
1345         (__mf_register): Tweak duplicate-static message.
1346         (__mf_violation: Tweak nearby-object counter printing.
1347
1348 2002-09-16  Frank Ch. Eigler  <fche@redhat.com>
1349
1350         * test/pass20-frag.c: New test file.
1351         * Makefile.am (TESTS): Reorganize.  Add pass20 test.
1352         * Makefile.in: Regenerated.
1353
1354         * mf-impl.h (TRACE_IN, TRACE_OUT): Remove macros.  Update callers.
1355         * mf-hooks.c (BEGIN_PROTECT): Add hook tracing here.
1356         * mf-heuristic.c (__mf_heuristic_check): Track seen /proc/self/map
1357         entries to avoid repeat registration.
1358         * mf-runtime.c (__mf_object_cemetary): Don't bother bury GUESS regions.
1359         (__mf_register, __mf_unregister): Rewrite GUESS handling logic.
1360
1361 2002-09-09  Frank Ch. Eigler  <fche@redhat.com>
1362
1363         * Makefile.am: Create test sources with #include, not cat>>.
1364         * Makefile.in: Regenerated.
1365         * test/buildtest.sh: Removed.
1366         * test/driver.c (abort_handler, main): Be quiet.
1367
1368 2002-09-06  Frank Ch. Eigler  <fche@redhat.com>
1369
1370         * test/pass18-frag.c, pass19-frag.c: New tests.
1371         * Makefile.am (check): Run them.  Rebuild test programs each time.
1372         * Makefile.in: Regenerated.
1373
1374 2002-09-06  Frank Ch. Eigler  <fche@redhat.com>
1375
1376         * mf-runtime.c (__mf_register): Correct SEGV-inducing error in
1377         overlapping object search.
1378         (__mf_violation): Likewise for nearby objects.
1379         Improve nearby-object listing.
1380
1381         cleanup:
1382         * mf-runtime.c, mf-hooks.c: Remove "{{{"/"}}}" folding marks.
1383         * mf-heuristics.c (__mf_heuristic_check): Tweak message.
1384
1385 2002-09-03  Frank Ch. Eigler  <fche@redhat.com>
1386
1387         alloca support:
1388         * Makefile.am (AM_CFLAGS): New definition of needed settings.
1389         (HOOKOBJS): Add alloca-hook.o.
1390         * mf-hooks.c (alloca): New function to implement alloca in libiberty
1391         style.
1392         * mf-runtime.c (__mf_report): Call alloca(0) to flush remaining blocks.
1393         (__mf_backtrace): Reimplement without using alloca.
1394         * Makefile.in: Regenerated.
1395
1396         cleanup:
1397         * mf-hooks.c: Use VERBOSE_TRACE throughout instead of fprintf(stderr).
1398         Correct signedness bugs in length-tracking variables.
1399         * mf-impl.h: Make options unsigned.
1400         (CALL_WRAP): New macro to parallel CALL_REAL().
1401         (DECLARE): Remove erroneous ";" at end.
1402         * mf-runtime.c, mf-hooks.c, mf-heuristics.c: Replace remaining %p
1403         formatting specs with %08lx.  Correct several compiler warnings.
1404
1405 2002-08-28  Frank Ch. Eigler  <fche@redhat.com>
1406
1407         * mf-runtime.c (__mf_violation): Try harder to locate nearby objects.
1408
1409 2002-08-27  Frank Ch. Eigler  <fche@redhat.com>
1410
1411         libmudflap hook breakup:
1412         * Makefile.am (TESTS_ENVIRONMENT): Add ../../gcc to LD_LIBRARY_PATH
1413         for libgcc_s.
1414         (TESTS): Make dependent on libmudflap.
1415         (HOOKOBJS): Break up mf-hooks.o into many little hook objects,
1416         compiled from segments of mf-hooks.c.
1417         * mf-hooks.c: Corresponding changes: wrap each function in
1418         #ifdef/#endif.
1419         * Makefile.in: Regenerated.
1420
1421         Heuristics reorganization:
1422         * mf-heuristics.c (__mf_register_ro_sections, __mf_init_heuristics):
1423         Remove these functions.  Update callers.
1424         (__mf_heuristic_check): Incorporate all the various heuristics.
1425         Encode cacheability/retry judgement into trinary return value.
1426         Separate start-end logic into a separate fallback heuristic.  Only
1427         register relevant /proc/self/map segments.
1428         * mf-impl.h: Corresponding changes.
1429         * mf-runtime.c (__mf_check): Reorganize heuristics fallback logic.
1430         (__mf_init): Don't call __mf_init_heuristics.
1431
1432         Tracing cleanup:
1433         * mf-heuristics.c, mf-runtime.c: Use new MUDFLAP_OPTION
1434         "-verbose-trace" to emit all tracing messages other than those of
1435         basic public api.  Eliminate some duplicate/excessive messages.
1436         * mf-runtime.h: Corresponding changes.
1437
1438 2002-08-27  Graydon Hoare  <graydon@redhat.com>
1439
1440         * mf-impl.h (WRAPPER): Change to create linker aliases for __wrap
1441         and __real when compiled with -DPIC.
1442         * mf-hooks.c (WRAPPER): Change all uses of WRAPPER macro slightly.
1443         * Makefile.am (AUTOMAKE_OPTIONS): Fix LD_LIBRARY_PATH for tests.
1444         * Makefile.in: Regenerate.
1445
1446 2002-08-26  Graydon Hoare  <graydon@redhat.com>
1447
1448         * mf-impl.h: New file, private implementation header.
1449         * mf-runtime.h: Reorganize a bit.
1450         (CLAMPSZ): Fix arithmetic.
1451         (__MF_CACHE_MISS_P): Fix arithmetic.
1452         * mf-runtime.c: Reorganize a bit.
1453         (__mf_dynamic): New structure.
1454         (resolve_single_dynamic): New function.
1455         (__mf_resolve_dynamics): New function.
1456         (__mf_init): Initialize dynamic wrappers.
1457         * mf-hooks.c: Macro-ize __real calls.
1458         Clamp various bits of arithmetic.
1459         Add explicit __mf_check call contexts.
1460         * Makefile.am: Add dependencies on mf-impl.h
1461         * Makefile.in: Regenerate.
1462         * configure.in: Comment out shared override.
1463         * configure: Regenerate.
1464
1465 2002-08-22  Graydon Hoare  <graydon@redhat.com>
1466
1467         * mf-runtime.c (__mf_process_opts): Sanity-check free_queue_length.
1468         (__mf_check): Re-inialize and check heuristics before violation.
1469         (__mf_register): Permit updating pure-guess regions.
1470         * mf-hooks.c (__wrap_free): Correct some free queue logic.
1471         (__wrap_dlopen): New wrapper function.
1472         (__wrap_mmap): New wrapper function.
1473         (__wrap_munmap): New wrapper function.
1474         * mf-heuristics.c (__mf_register_ro_sections): Register *all* regions
1475         which are not stack addresses.
1476         (is_stack_address): New function.
1477         (__mf_init_heuristics): Save and restore state, always initialize with
1478         "starting" state.
1479
1480 2002-08-21  Frank Ch. Eigler  <fche@redhat.com>
1481
1482         * mf-hooks.c (MF_VALIDATE_EXTENT): Rewrite to correct off-by-one
1483         error.  Pass location string.
1484         (wrap_strcpy, wrap_strncpy): Remove extra %s in trace strings.
1485         * mf-runtime.c (options): Add lc-mask, lc-shift options.
1486         (__mf_process_opts): Apply some sanity checking for lc-mask.
1487         (__mf_check, __mf_violation): Take new location-string argument.
1488         Update callers to pass NULL if necessary.
1489         (__mf_backtrace): New smart backtracer function.  Calls replace
1490         several ad-hoc blocks elsewhere.
1491         (__mf_describe_object): Remove bad reentrancy test.  Improve
1492         tracing message.
1493         * mf-runtime.h: Corresponding changes.  Public/private markup.
1494         (__MF_CACHE_MISS_P): New macro.
1495
1496 2002-08-20  Graydon Hoare  <graydon@redhat.com>
1497
1498         * mf-runtime.h: New option: stack_bound (heuristic).
1499         Move some macros out of implementation files.
1500         * mf-runtime.c: New option string: -stack-bound.
1501         Unify recursion protection with hooks.
1502         Add more logging.
1503         (__mf_check): Call __mf_heuristic_check.
1504         (__mf_process_opts): Fix "no-" processing.
1505         * mf-heuristics.c (__mf_heuristic_check): New function.
1506         * mf-hooks.c: Much off-by-one fixing, recursion protection.
1507
1508 2002-08-20  Frank Ch. Eigler  <fche@redhat.com>
1509
1510         Option parsing improvements, region splitting bug fixes:
1511         * mf-heuristics.c (__mf_register_ro_sections): Add warned casts.
1512         * mf-runtime.h (heur_proc_map): New libmudflap option.
1513         * mf-runtime.c (__mf_set_default_options): Set it.
1514         (__mf_usage): Print default values/status.
1515         (__mf_process_opts): Support general "no-" option string prefix.
1516         (__mf_init): Print __mf_usage on unknown-option error.
1517         (__mf_register): Print trace message up front.
1518         Correct region splitting logic for case where a subregion disappears.
1519         Correct memory leak.
1520         (__mf_violation): Make even basic message conditional on option.
1521
1522         Build cleanup:
1523         * Makefile.am (TESTS_ENVIRONMENT): Add -no-heur-proc-map.
1524         (clean-local): New target.
1525         (test/*x rules): Add -g CFLAGS.
1526         (CFLAGS): Add -freorder-blocks.
1527         (MFCONFIG_CFLAGS, INCLUDE): Remove unneeded settings.
1528         * Makefile.in: Regenerated.
1529         * Makefile, mf-config.h: Removed files.
1530
1531 2002-08-16  Graydon Hoare  <graydon@redhat.com>
1532
1533         * mf-runtime.c (__mf_insert_new_object): Factor out of
1534         __mf_register.
1535         (__mf_remove_old_object): Factor out of __mf_unregister.
1536         (__mf_register): Handle guessed regions, splitting
1537         guesses when new registrations arrive.
1538         (__mf_unregister): Do not unregister guesses.
1539         * mf-runtime.h: Move convenience macros around,
1540         declare new option fields. Add __MF_TYPE_GUESS.
1541         * mf-hooks.c (__wrap_*alloc): Use crumple zones.
1542         (__wrap_free): Call __real_free for deferred frees.
1543         * Makefile.am: Add more tests, fix dependency.
1544         * Makefile.in: Regenerate.
1545         * test/pass[13..17]-frag.c: New testcases.
1546         * test/fail[13..17]-frag.c: New testcases.
1547
1548 2002-08-15  Graydon Hoare  <graydon@redhat.com>
1549
1550         * mf-heuristics.c: New file.
1551         * mf-runtime.c (options): Add -trace-calls option.
1552         (__mf_init): Call __mf_init_heuristics.
1553
1554 2002-08-14  Graydon Hoare  <graydon@redhat.com>
1555
1556         * Makefile.am (TESTS): Add testsuite support.
1557         * Makefile.in: Regenerate.
1558         * test/mf-driver.c: New file.
1559         * test/buildtest.sh: New file.
1560         * test/passNN-frag.c: New testcases.
1561         * test/failNN-frag.c: New testcases.
1562
1563 2002-08-14  Graydon Hoare  <graydon@redhat.com>
1564
1565         * mf-hooks.c: Change __real_strlen() to __real_strlen()+1 when
1566         verifying non-size-limited string extents.
1567
1568 2002-08-14  Frank Ch. Eigler  <fche@redhat.com>
1569
1570         * mf-hooks.c: Make __wrap string* functions use __real_str[n]len
1571         instead of plain str[n]len for internal checks.
1572         * mf-runtime.c (__mf_violation): Print optional stack traceback.
1573
1574 2002-08-14  Frank Ch. Eigler  <fche@redhat.com>
1575
1576         * mf-hooks.c: Remove #if-0 around hooks that are now ld-wrapped.
1577
1578 2002-08-13  Graydon Hoare  <graydon@redhat.com>
1579
1580         * mf-runtime.c: Rework configuration to operate on
1581         environment variable options rather than #defines
1582         (__mf_violation): Add simple fork-a-gdb violaiton mode.
1583         (__mf_init): Set static __mf_active_p flag on startup,
1584         to inhibit mudflap wrap-based checking during crt0.s.
1585         * mf-runtime.h: Declare options structure.
1586         * mf-hooks.c: New wrappings for mem*, b*, str*
1587         libc functions (temporarily #if 0-ed out).
1588
1589 2002-08-12  Frank Ch. Eigler  <fche@redhat.com>
1590
1591         * Makefile.am, configure.in: New files.
1592         * Makefile.in, Makefile, configure, config.h.in: New generated files.
1593         * stamp-h.in, aclocal.m4: Ditto.
1594
1595 2002-08-08  Frank Ch. Eigler  <fche@redhat.com>
1596
1597         * Makefile: New file.
1598         * mf-config.h: New file: runtime configuration.
1599         * mf-hooks.c: New file: interposed libc functions.
1600         * mf-runtime.c: New file: bulk of runtime.
1601         * mf-runtime.h: New file: public functions.