OSDN Git Service

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