aboutsummaryrefslogtreecommitdiff
path: root/libmudflap/mf-hooks1.c
diff options
context:
space:
mode:
authorfche <fche@138bc75d-0d04-0410-961f-82ee72b054a4>2004-06-04 20:12:01 +0000
committerfche <fche@138bc75d-0d04-0410-961f-82ee72b054a4>2004-06-04 20:12:01 +0000
commit8981aed2e88666a3668271f54391f9266c4c80bb (patch)
treed248b4bcf141c1cec13d21a71e4945815f2ccb44 /libmudflap/mf-hooks1.c
parentcb05e3765b01db36c7d8dbd8536ebfe27ec39d1c (diff)
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@82632 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libmudflap/mf-hooks1.c')
-rw-r--r--libmudflap/mf-hooks1.c30
1 files changed, 7 insertions, 23 deletions
diff --git a/libmudflap/mf-hooks1.c b/libmudflap/mf-hooks1.c
index 7199472ebe1..d2f8312314f 100644
--- a/libmudflap/mf-hooks1.c
+++ b/libmudflap/mf-hooks1.c
@@ -1,5 +1,5 @@
/* Mudflap: narrow-pointer bounds-checking by tree rewriting.
- Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
Contributed by Frank Ch. Eigler <fche@redhat.com>
and Graydon Hoare <graydon@redhat.com>
@@ -74,8 +74,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
use plain macros in mf-runtime.h. */
-#ifdef WRAP_malloc
-
#if PIC
/* A special bootstrap variant. */
void *
@@ -86,6 +84,7 @@ __mf_0fn_malloc (size_t c)
}
#endif
+
#undef malloc
WRAPPER(void *, malloc, size_t c)
{
@@ -108,11 +107,8 @@ WRAPPER(void *, malloc, size_t c)
return result;
}
-#endif
-#ifdef WRAP_calloc
-
#ifdef PIC
/* A special bootstrap variant. */
void *
@@ -136,6 +132,7 @@ __mf_0fn_calloc (size_t c, size_t n)
}
#endif
+
#undef calloc
WRAPPER(void *, calloc, size_t c, size_t n)
{
@@ -164,9 +161,7 @@ WRAPPER(void *, calloc, size_t c, size_t n)
return result;
}
-#endif
-#ifdef WRAP_realloc
#if PIC
/* A special bootstrap variant. */
@@ -177,6 +172,7 @@ __mf_0fn_realloc (void *buf, size_t c)
}
#endif
+
#undef realloc
WRAPPER(void *, realloc, void *buf, size_t c)
{
@@ -220,11 +216,8 @@ WRAPPER(void *, realloc, void *buf, size_t c)
return result;
}
-#endif
-#ifdef WRAP_free
-
#if PIC
/* A special bootstrap variant. */
void
@@ -297,11 +290,8 @@ WRAPPER(void, free, void *buf)
CALL_REAL (free, base);
}
}
-#endif
-#ifdef WRAP_mmap
-
#if PIC
/* A special bootstrap variant. */
void *
@@ -353,10 +343,7 @@ WRAPPER(void *, mmap,
return result;
}
-#endif
-
-#ifdef WRAP_munmap
#if PIC
/* A special bootstrap variant. */
@@ -395,10 +382,7 @@ WRAPPER(int , munmap, void *start, size_t length)
}
return result;
}
-#endif
-
-#ifdef WRAP_alloca
/* This wrapper is a little different, as it's called indirectly from
__mf_fini also to clean up pending allocations. */
@@ -428,7 +412,9 @@ __mf_wrap_alloca_indirect (size_t c)
/* Free any previously alloca'd blocks that belong to deeper-nested functions,
which must therefore have exited by now. */
-#define DEEPER_THAN < /* for x86 */
+
+#define DEEPER_THAN < /* XXX: for x86; steal find_stack_direction() from libiberty/alloca.c */
+
while (alloca_history &&
((uintptr_t) alloca_history->stack DEEPER_THAN (uintptr_t) stack))
{
@@ -474,5 +460,3 @@ WRAPPER(void *, alloca, size_t c)
return __mf_wrap_alloca_indirect (c);
}
-#endif
-