2 #include <pub_tool_basics.h>
3 #include <pub_tool_basics_asm.h>
4 #include <pub_tool_libcbase.h>
5 #include <pub_tool_libcprint.h>
7 #include <l4re_helper.h>
13 unsigned int client_env_size = 0;
15 /*************************************
16 * Stuff needed for linking Valgrind *
18 * ***********************************/
20 __extension__ typedef int __guard __attribute__ ((mode(__DI__)));
21 int __cxa_guard_acquire(__guard * g);
22 int __cxa_guard_acquire(__guard * g)
24 return !*(char *) (g);
27 void __cxa_guard_release(__guard * g);
28 void __cxa_guard_release(__guard * g)
33 void __cxa_pure_virtual(void);
34 void __cxa_pure_virtual(void)
36 VG_(unimplemented)("unimplemented function __cxa_pure_virtual()");
40 void __gxx_personality_v0(void);
41 void __gxx_personality_v0(void)
43 VG_(unimplemented)("unimplemented function __gxx_personality_v0()");
47 void __cxa_call_unexpected(void *ei);
48 void __cxa_call_unexpected(void *ei)
50 VG_(unimplemented)("unimplemented function __cxa_call_unexpected()");
54 void _Unwind_Resume(void);
55 void _Unwind_Resume(void)
57 VG_(unimplemented)("unimplemented function _Unwind_Resume()");
62 void _Unwind_DeleteException(void);
63 void _Unwind_DeleteException(void)
65 VG_(unimplemented)("unimplemented function _Unwind_DeleteException()");
69 void _Unwind_RaiseException(void);
70 void _Unwind_RaiseException(void)
72 VG_(unimplemented)("unimplemented function _Unwind_RaiseException()");
77 void _Unwind_Resume_or_Rethrow(void);
78 void _Unwind_Resume_or_Rethrow(void)
80 VG_(unimplemented)("unimplemented function _Unwind_Resume_or_Rethrow()");
85 void __stack_chk_fail(void);
86 void __stack_chk_fail(void)
88 VG_(unimplemented)("unimplemented function __stack_chk_fail()");
92 /*************************************
93 * Functions needed for linking some *
94 * L4Re-Libs with Valgrind *
95 *************************************/
97 // for libc_backends/lib/file/mmap.cc
98 // for l4util/lib/src/micros2l4to.c
99 // for l4util/lib/src/sleep.c
100 int printf(const char *format, ...);
101 int printf(const char *format, ...)
107 va_start(args, format);
108 n = VG_(vprintf) (format, args);
114 #include <pub_tool_mallocfree.h>
115 // for libc_backends/libc_be_file.h
116 void free(void *ptr);
123 // for l4re/lib/src/log.cc
124 // for l4re/lib/src/namespace.cc
125 size_t strlen(const char *s);
126 size_t strlen(const char *s)
128 return VG_(strlen) (s);
131 #include <pub_tool_mallocfree.h>
132 // for libc_backends/libc_be_file.h
133 void *malloc(size_t size);
134 void *malloc(size_t size)
136 return VG_(malloc) ("l4re", size);