aboutsummaryrefslogtreecommitdiff
path: root/libmudflap/mf-hooks1.c
AgeCommit message (Collapse)AuthorFilesLines
2011-07-07re PR libmudflap/49550 (Many libmudflap tests fail on Solaris 11/x86)Rainer Orth1-1/+56
gcc: PR libmudflap/49550 * gcc.c (MFWRAP_SPEC): Also wrap mmap64. libmudflap: PR libmudflap/49550 * mf-runtime.c (__wrap_main) [__sun__ && __svr4__]: Don't register stdin, stdout, stderr. Register __ctype, __ctype_mask. * configure.ac: Check for mmap64. Check for rawmemchr, stpcpy, mempcpy. * configure: Regenerate. * config.h.in: Regenerate. * mf-hooks1.c [HAVE_MMAP64] (__mf_0fn_mmap64): New function. (mmap64): New wrapper function. * mf-impl.h (__mf_dynamic_index) [HAVE_MMAP64]: Add dyn_mmap64. * mf-runtime.c (__mf_dynamic) [HAVE_MMAP64]: Handle mmap64. * mf-hooks2.c [HAVE_GETMNTENT && HAVE_SYS_MNTTAB_H]: Implement getmntent wrapper. * mf-hooks3.c (_REENTRANT): Define. * testsuite/libmudflap.c/heap-scalestress.c (SCALE): Reduce to 10000. * testsuite/libmudflap.c/pass-stratcliff.c: Include ../config.h. (MIN): Define. Use HAVE_RAWMEMCHR, HAVE_STPCPY, HAVE_MEMPCPY as guards. * testsuite/libmudflap.c/pass47-frag.c: Expect __ctype warning on *-*-solaris2.*. From-SVN: r175961
2009-09-01mf-runtime.c (__mf_init): Support FreeBSD.Loren J. Rittle1-0/+5
2009-09-01 Loren J. Rittle <ljrittle@acm.org> * mf-runtime.c (__mf_init): Support FreeBSD. Prime mutex which calls calloc upon first lock to avoid deadlock. * mf-hooks1.c (__mf_0fn_mmap): Support FreeBSD. Ignore red zone allocation request for initial thread's stack. From-SVN: r151278
2009-04-09Licensing changes to GPLv3 resp. GPLv3 with GCC Runtime Exception.Jakub Jelinek1-15/+9
From-SVN: r145841
2006-11-10re PR libmudflap/28578 (A most simple multithreaded program (practically any ↵Frank Ch. Eigler1-6/+22
multithreaded one) causes mudflap violation) 2006-11-10 Frank Ch. Eigler <fche@redhat.com> PR libmudflap/28578 * mf-hooks1.c (__mf_0fn_malloc): Make the bootstrap buffers static but not function scope static. (free): Skip deallocation attempts for objects placed into bootstrap buffers. * testsuite/libmudflap.cth/pass59-frag.c: New test. M libmudflap/mf-hooks1.c M libmudflap/ChangeLog A libmudflap/testsuite/libmudflap.cth/pass59-frag.c From-SVN: r118662
2005-09-29We can only wrap mmap if it exists.James E Wilson1-0/+5
* mf-hooks1.c (__mf_0fn_mmap, mmap, __mf_0fn_munmap, munmap): Protect with HAVE_MMAP ifdef. From-SVN: r104810
2005-08-18Fix FreeBSD failure with recursive malloc call.James E Wilson1-0/+18
* mf-hooks1.c (malloc, calloc, realloc, free, __mf_wrap_alloca_indirect): Call BEGIN_MALLOC_PROTECT before calling the real routines, and END_MALLOC_PROTECT afterwards. * mf-impl.h (enum __mf_state_enum): Expand comment. Add in_malloc. (BEGIN_PROTECT): Handle in_malloc state. (BEGIN_MALLOC_PROTECT, END_MALLOC_PROTECT): New. * testsuite/libmudflap.c/hook2-allocstuff.c: New. From-SVN: r103256
2005-08-17All files: Update FSF address.Kelley Cook1-2/+2
2005-08-17 Kelley Cook <kcook@gcc.gnu.org> * All files: Update FSF address. From-SVN: r103197
2005-07-16gcc.c (MFWRAP_SPEC): Don't wrap pthread_join or pthread_exit.Richard Henderson1-18/+16
* gcc.c (MFWRAP_SPEC): Don't wrap pthread_join or pthread_exit. * acinclude.m4: New file. * configure.ac: Invoke LIBMUDFLAP_CHECK_TLS. * configure, config.h.in, Makefile.in, testsuite/Makefile.in: Rebuild. * mf-hooks1.c (__mf_0fn_malloc): Move body from ... (__mf_0fn_calloc): ... here. * mf-hooks3.c (struct pthread_info): Remove. (__mf_pthread_info, __mf_pthread_info_idx): Remove. (LIBMUDFLAPTH_THREADS_MAX): Set to 1021. (struct mf_thread_data): New. (mf_thread_data, mf_thread_data_lock): New. (__mf_allocate_blank_threadinfo): Remove. (__mf_find_threadinfo): Rewrite and simplify. Only use if TLS is not available. (__mf_state_perthread): Remove. (__mf_get_state, __mf_set_state): New. (__mf_pthread_cleanup): Use &errno, rather than saved pointer. Update mf_thread_data killing procedure. (__mf_pthread_spawner): Similarly. (__mf_0fn_pthread_create): Only use wrapper if necessary. Remove code to allocate thread stack space. (__mf_0fn_pthread_join, pthread_join): Remove. (__mf_0fn_pthread_exit, pthread_exit): Remove. * mf-impl.h (dyn_pthread_join, dyn_pthread_exit): Remove. (__mf_state_1): Rename from __mf_state; use TLS when available. (__mf_get_state, __mf_set_state): New. Update all users. * mf-runtime.c (begin_recursion_protect1): New. (BEGIN_RECURSION_PROTECT): Use it. (__mf_state_1): Rename from __mf_state; use TLS when available. (threads_active_p): Remove. (__mf_usage): Compute it directly. From-SVN: r102108
2005-03-22mf-heuristics.c: Fix whitespace at end of line.Mike Stump1-30/+30
* mf-heuristics.c: Fix whitespace at end of line. * mf-hooks1.c: Likewise. * mf-hooks2.c: Likewise. * mf-hooks3.c: Likewise. * mf-impl.h: Likewise. * mf-runtime.c: Likewise. * mf-runtime.h: Likewise. From-SVN: r96850
2004-06-24Adopt splay trees for object database.Frank Ch. Eigler1-4/+6
2004-06-24 Frank Ch. Eigler <fche@redhat.com> Adopt splay trees for object database. * Makefile.am: Copy splay-tree.* from libiberty. * Makefile.in, testsuite/Makefile.in: Regenerated. * mf-runtime.h.in (__mf_unregister): Add third parameter (type). * mf-hooks[123].c (*): Add new third parameter to mf_unregister. * mf-impl.h (BEGIN_PROTECT): Remove some trace text. * mf-runtime.c: Rewrite code dealing with object database to use libiberty splay trees. Remove tree liveness aging option. * testsuite/libmudflap.c/fail18-frag.c: Add volatile flag. From-SVN: r83611
2004-06-04Portability improvements, e.g., libmudflap/15293.Frank Ch. Eigler1-23/+7
2004-06-04 Frank Ch. Eigler <fche@redhat.com> Portability improvements, e.g., libmudflap/15293. * configure.in: Look for glibc extension functions. Look for support of -f{function,data}-sections. Look for more headers. Create testsuite/mfconfig.exp. Correct more "test x.." thinkos. * Makefile.am: Use $(SECTION_FLAGS). Collapse piecemeal-compiled mf-hooks* into usual single object per source. * mf-hooks*.c: Remove all #if WRAP_foo conditionals. * mf-hooks2.c: #include a bunch more system headers. Define strnlen if system doesn't provide one. * mf-hooks3.c (struct pthread_info): Add stack_*_alloc fields. (pthread_create): Use it to properly GC dead thread stacks. * mf-runtime.c (__mf_violation): Correct snprintf type warning. * testsuite/Makefile.am: Stop generating site.exp. * testsuite/mfconfig.exp.in: New file. * testsuite/config/default.exp: Load new mfconfig.exp. * testsuite/lib/libmudflap.exp (libmudflap-init): Add extra libraries. (prune_gcc_output): Add glibc static linking warnings. * testsuite/libmudflap.*/*frags.exp: Enumerate needed -lmudflap* libs. * testsuite/libmudflap.c/pass46-frag.c: Ditto. * configure, Makefile, aclocal.m4, config.h.in, testsuite/Makefile.in: Regenerated with autoconf 2.57 and automake 1.7. From-SVN: r82632
2004-05-13Merge tree-ssa-20020619-branch into mainline.Diego Novillo1-0/+478
From-SVN: r81764