OSDN Git Service

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