| 1 |
--- valgrind/coregrind/pub_core_trampoline.h.jj 2009-04-22 12:10:54.000000000 +0200 |
| 2 |
+++ valgrind/coregrind/pub_core_trampoline.h 2009-04-22 14:50:39.000000000 +0200 |
| 3 |
@@ -66,6 +66,7 @@ extern Char* VG_(x86_linux_REDIR_FOR_ind |
| 4 |
extern void VG_(amd64_linux_SUBST_FOR_rt_sigreturn); |
| 5 |
extern void VG_(amd64_linux_REDIR_FOR_vgettimeofday); |
| 6 |
extern void VG_(amd64_linux_REDIR_FOR_vtime); |
| 7 |
+extern UInt VG_(amd64_linux_REDIR_FOR_strlen)( void* ); |
| 8 |
#endif |
| 9 |
|
| 10 |
#if defined(VGP_ppc32_linux) |
| 11 |
--- valgrind/coregrind/m_redir.c.jj 2009-04-22 12:10:54.000000000 +0200 |
| 12 |
+++ valgrind/coregrind/m_redir.c 2009-04-22 15:32:19.000000000 +0200 |
| 13 |
@@ -879,6 +879,20 @@ void VG_(redir_initialise) ( void ) |
| 14 |
(Addr)&VG_(amd64_linux_REDIR_FOR_vtime) |
| 15 |
); |
| 16 |
|
| 17 |
+ /* If we're using memcheck, use these intercepts right from |
| 18 |
+ the start, otherwise ld.so makes a lot of noise. */ |
| 19 |
+ if (0==VG_(strcmp)("Memcheck", VG_(details).name)) { |
| 20 |
+ |
| 21 |
+ static const HChar croakage[] |
| 22 |
+ = "Possible fix: add splitdebug to FEATURES in make.conf and remerge glibc."; |
| 23 |
+ |
| 24 |
+ /* this is mandatory - can't sanely continue without it */ |
| 25 |
+ add_hardwired_spec( |
| 26 |
+ "ld-linux-x86-64.so.2", "strlen", |
| 27 |
+ (Addr)&VG_(amd64_linux_REDIR_FOR_strlen), |
| 28 |
+ croakage |
| 29 |
+ ); |
| 30 |
+ } |
| 31 |
# elif defined(VGP_ppc32_linux) |
| 32 |
{ |
| 33 |
static const HChar croakage[] |
| 34 |
--- valgrind/coregrind/m_trampoline.S.jj 2009-04-22 12:10:54.000000000 +0200 |
| 35 |
+++ valgrind/coregrind/m_trampoline.S 2009-04-22 15:18:37.000000000 +0200 |
| 36 |
@@ -174,7 +174,29 @@ VG_(amd64_linux_REDIR_FOR_vtime): |
| 37 |
.LfnE3: |
| 38 |
.size VG_(amd64_linux_REDIR_FOR_vtime), .-.LfnB3 |
| 39 |
|
| 40 |
-/* A CIE for the above two functions, followed by their FDEs */ |
| 41 |
+/* There's no particular reason that this needs to be handwritten |
| 42 |
+ assembly, but since that's what this file contains, here's a |
| 43 |
+ simple strlen implementation (written in C and compiled by gcc.) |
| 44 |
+*/ |
| 45 |
+.global VG_(amd64_linux_REDIR_FOR_strlen) |
| 46 |
+.type VG_(amd64_linux_REDIR_FOR_strlen), @function |
| 47 |
+VG_(amd64_linux_REDIR_FOR_strlen): |
| 48 |
+.LfnB4: |
| 49 |
+ xorl %eax, %eax |
| 50 |
+ cmpb $0, (%rdi) |
| 51 |
+ movq %rdi, %rdx |
| 52 |
+ je .L41 |
| 53 |
+.L40: addq $1, %rdx |
| 54 |
+ cmpb $0, (%rdx) |
| 55 |
+ jne .L40 |
| 56 |
+ movq %rdx, %rax |
| 57 |
+ subq %rdi, %rax |
| 58 |
+.L41: ret |
| 59 |
+.LfnE4: |
| 60 |
+.size VG_(amd64_linux_REDIR_FOR_strlen), .-VG_(amd64_linux_REDIR_FOR_strlen) |
| 61 |
+ |
| 62 |
+ |
| 63 |
+/* A CIE for the above three functions, followed by their FDEs */ |
| 64 |
.section .eh_frame,"a",@progbits |
| 65 |
.Lframe1: |
| 66 |
.long .LEcie1-.LScie1 |
| 67 |
@@ -212,6 +234,15 @@ VG_(amd64_linux_REDIR_FOR_vtime): |
| 68 |
.uleb128 0x0 |
| 69 |
.align 8 |
| 70 |
.LEfde3: |
| 71 |
+.LSfde4: |
| 72 |
+ .long .LEfde4-.LASfde4 |
| 73 |
+.LASfde4: |
| 74 |
+ .long .LASfde4-.Lframe1 |
| 75 |
+ .long .LfnB4 |
| 76 |
+ .long .LfnE4-.LfnB4 |
| 77 |
+ .uleb128 0x0 |
| 78 |
+ .align 8 |
| 79 |
+.LEfde4: |
| 80 |
.previous |
| 81 |
|
| 82 |
.global VG_(trampoline_stuff_end) |