OSDN Git Service

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