the usual reason.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14070
// DDD: #warning fixme rdar://6166275
add_hardwired_spec("dyld", "arc4random",
(Addr)&VG_(amd64_darwin_REDIR_FOR_arc4random), NULL);
+# if DARWIN_VERS == DARWIN_10_9
+ add_hardwired_spec("dyld", "strchr",
+ (Addr)&VG_(amd64_darwin_REDIR_FOR_strchr), NULL);
+# endif
}
# elif defined(VGP_s390x_linux)
movq $0x76616c6772696e64, %rax
ret
+.globl VG_(amd64_darwin_REDIR_FOR_strchr)
+VG_(amd64_darwin_REDIR_FOR_strchr):
+ pushq %rbp
+ movq %rsp, %rbp
+ movb (%rdi), %cl
+ cmpb %sil, %cl
+ jne 1f
+ movq %rdi, %rax
+ popq %rbp
+ ret
+1:
+ testb %cl, %cl
+ movl $0, %eax
+ je 2f
+ movb 1(%rdi), %cl
+ incq %rdi
+ cmpb %sil, %cl
+ movq %rdi, %rax
+ jne 1b
+2:
+ popq %rbp
+ ret
+
.globl VG_(trampoline_stuff_end)
VG_(trampoline_stuff_end):
extern SizeT VG_(amd64_darwin_REDIR_FOR_strlcat)( char *s1, const char *s2,
SizeT size );
extern UInt VG_(amd64_darwin_REDIR_FOR_arc4random)( void );
+# if DARWIN_VERS == DARWIN_10_9
+ extern char* VG_(amd64_darwin_REDIR_FOR_strchr)( const char*, int );
+# endif
#endif
#if defined(VGP_s390x_linux)