|
Jakub Jelinek |
a11e79 |
--- valgrind/coregrind/pub_core_trampoline.h.jj 2009-04-22 12:10:54.000000000 +0200
|
|
Jakub Jelinek |
a11e79 |
+++ valgrind/coregrind/pub_core_trampoline.h 2009-04-22 14:50:39.000000000 +0200
|
|
Jakub Jelinek |
a11e79 |
@@ -66,6 +66,7 @@ extern Char* VG_(x86_linux_REDIR_FOR_ind
|
|
Jakub Jelinek |
a11e79 |
extern void VG_(amd64_linux_SUBST_FOR_rt_sigreturn);
|
|
Jakub Jelinek |
a11e79 |
extern void VG_(amd64_linux_REDIR_FOR_vgettimeofday);
|
|
Jakub Jelinek |
a11e79 |
extern void VG_(amd64_linux_REDIR_FOR_vtime);
|
|
Jakub Jelinek |
a11e79 |
+extern UInt VG_(amd64_linux_REDIR_FOR_strlen)( void* );
|
|
Jakub Jelinek |
a11e79 |
#endif
|
|
Jakub Jelinek |
a11e79 |
|
|
Jakub Jelinek |
a11e79 |
#if defined(VGP_ppc32_linux)
|
|
Jakub Jelinek |
a11e79 |
--- valgrind/coregrind/m_redir.c.jj 2009-04-22 12:10:54.000000000 +0200
|
|
Jakub Jelinek |
a11e79 |
+++ valgrind/coregrind/m_redir.c 2009-04-22 15:32:19.000000000 +0200
|
|
Jakub Jelinek |
a11e79 |
@@ -879,6 +879,20 @@ void VG_(redir_initialise) ( void )
|
|
Jakub Jelinek |
a11e79 |
(Addr)&VG_(amd64_linux_REDIR_FOR_vtime)
|
|
Jakub Jelinek |
a11e79 |
);
|
|
Jakub Jelinek |
a11e79 |
|
|
Jakub Jelinek |
a11e79 |
+ /* If we're using memcheck, use these intercepts right from
|
|
Jakub Jelinek |
a11e79 |
+ the start, otherwise ld.so makes a lot of noise. */
|
|
Jakub Jelinek |
a11e79 |
+ if (0==VG_(strcmp)("Memcheck", VG_(details).name)) {
|
|
Jakub Jelinek |
a11e79 |
+
|
|
Jakub Jelinek |
a11e79 |
+ static const HChar croakage[]
|
|
Jakub Jelinek |
a11e79 |
+ = "Possible fix: install glibc's debuginfo package on this machine.";
|
|
Jakub Jelinek |
a11e79 |
+
|
|
Jakub Jelinek |
a11e79 |
+ /* this is mandatory - can't sanely continue without it */
|
|
Jakub Jelinek |
a11e79 |
+ add_hardwired_spec(
|
|
Jakub Jelinek |
a11e79 |
+ "ld-linux-x86-64.so.2", "strlen",
|
|
Jakub Jelinek |
a11e79 |
+ (Addr)&VG_(amd64_linux_REDIR_FOR_strlen),
|
|
Jakub Jelinek |
a11e79 |
+ croakage
|
|
Jakub Jelinek |
a11e79 |
+ );
|
|
Jakub Jelinek |
a11e79 |
+ }
|
|
Jakub Jelinek |
a11e79 |
# elif defined(VGP_ppc32_linux)
|
|
Jakub Jelinek |
a11e79 |
{
|
|
Jakub Jelinek |
a11e79 |
static const HChar croakage[]
|
|
Jakub Jelinek |
a11e79 |
--- valgrind/coregrind/m_trampoline.S.jj 2009-04-22 12:10:54.000000000 +0200
|
|
Jakub Jelinek |
a11e79 |
+++ valgrind/coregrind/m_trampoline.S 2009-04-22 15:18:37.000000000 +0200
|
|
Jakub Jelinek |
a11e79 |
@@ -174,7 +174,29 @@ VG_(amd64_linux_REDIR_FOR_vtime):
|
|
Jakub Jelinek |
a11e79 |
.LfnE3:
|
|
Jakub Jelinek |
a11e79 |
.size VG_(amd64_linux_REDIR_FOR_vtime), .-.LfnB3
|
|
Jakub Jelinek |
a11e79 |
|
|
Jakub Jelinek |
a11e79 |
-/* A CIE for the above two functions, followed by their FDEs */
|
|
Jakub Jelinek |
a11e79 |
+/* There's no particular reason that this needs to be handwritten
|
|
Jakub Jelinek |
a11e79 |
+ assembly, but since that's what this file contains, here's a
|
|
Jakub Jelinek |
a11e79 |
+ simple strlen implementation (written in C and compiled by gcc.)
|
|
Jakub Jelinek |
a11e79 |
+*/
|
|
Jakub Jelinek |
a11e79 |
+.global VG_(amd64_linux_REDIR_FOR_strlen)
|
|
Jakub Jelinek |
a11e79 |
+.type VG_(amd64_linux_REDIR_FOR_strlen), @function
|
|
Jakub Jelinek |
a11e79 |
+VG_(amd64_linux_REDIR_FOR_strlen):
|
|
Jakub Jelinek |
a11e79 |
+.LfnB4:
|
|
Jakub Jelinek |
a11e79 |
+ xorl %eax, %eax
|
|
Jakub Jelinek |
a11e79 |
+ cmpb $0, (%rdi)
|
|
Jakub Jelinek |
a11e79 |
+ movq %rdi, %rdx
|
|
Jakub Jelinek |
a11e79 |
+ je .L41
|
|
Jakub Jelinek |
a11e79 |
+.L40: addq $1, %rdx
|
|
Jakub Jelinek |
a11e79 |
+ cmpb $0, (%rdx)
|
|
Jakub Jelinek |
a11e79 |
+ jne .L40
|
|
Jakub Jelinek |
a11e79 |
+ movq %rdx, %rax
|
|
Jakub Jelinek |
a11e79 |
+ subq %rdi, %rax
|
|
Jakub Jelinek |
a11e79 |
+.L41: ret
|
|
Jakub Jelinek |
a11e79 |
+.LfnE4:
|
|
Jakub Jelinek |
a11e79 |
+.size VG_(amd64_linux_REDIR_FOR_strlen), .-VG_(amd64_linux_REDIR_FOR_strlen)
|
|
Jakub Jelinek |
a11e79 |
+
|
|
Jakub Jelinek |
a11e79 |
+
|
|
Jakub Jelinek |
a11e79 |
+/* A CIE for the above three functions, followed by their FDEs */
|
|
Jakub Jelinek |
a11e79 |
.section .eh_frame,"a",@progbits
|
|
Jakub Jelinek |
a11e79 |
.Lframe1:
|
|
Jakub Jelinek |
a11e79 |
.long .LEcie1-.LScie1
|
|
Jakub Jelinek |
a11e79 |
@@ -212,6 +234,15 @@ VG_(amd64_linux_REDIR_FOR_vtime):
|
|
Jakub Jelinek |
a11e79 |
.uleb128 0x0
|
|
Jakub Jelinek |
a11e79 |
.align 8
|
|
Jakub Jelinek |
a11e79 |
.LEfde3:
|
|
Jakub Jelinek |
a11e79 |
+.LSfde4:
|
|
Jakub Jelinek |
a11e79 |
+ .long .LEfde4-.LASfde4
|
|
Jakub Jelinek |
a11e79 |
+.LASfde4:
|
|
Jakub Jelinek |
a11e79 |
+ .long .LASfde4-.Lframe1
|
|
Jakub Jelinek |
a11e79 |
+ .long .LfnB4
|
|
Jakub Jelinek |
a11e79 |
+ .long .LfnE4-.LfnB4
|
|
Jakub Jelinek |
a11e79 |
+ .uleb128 0x0
|
|
Jakub Jelinek |
a11e79 |
+ .align 8
|
|
Jakub Jelinek |
a11e79 |
+.LEfde4:
|
|
Jakub Jelinek |
a11e79 |
.previous
|
|
Jakub Jelinek |
a11e79 |
|
|
Jakub Jelinek |
a11e79 |
.global VG_(trampoline_stuff_end)
|