|
From: <sv...@va...> - 2010-06-07 20:36:05
|
Author: sewardj
Date: 2010-06-07 21:35:57 +0100 (Mon, 07 Jun 2010)
New Revision: 11160
Log:
amd64-darwin: add VG_(amd64_darwin_SUBST_FOR_sigreturn), without
which the signal delivery stuff in r11159 can't be compiled.
Also, some renaming for the darwin-specific replacements in
m_trampoline.S.
Modified:
branches/MACOSX106/coregrind/m_trampoline.S
branches/MACOSX106/coregrind/pub_core_trampoline.h
Modified: branches/MACOSX106/coregrind/m_trampoline.S
===================================================================
--- branches/MACOSX106/coregrind/m_trampoline.S 2010-06-07 20:31:07 UTC (rev 11159)
+++ branches/MACOSX106/coregrind/m_trampoline.S 2010-06-07 20:35:57 UTC (rev 11160)
@@ -924,8 +924,8 @@
int $0x80
ud2
-.globl VG_(darwin_REDIR_FOR_strlen)
-VG_(darwin_REDIR_FOR_strlen):
+.globl VG_(x86_darwin_REDIR_FOR_strlen)
+VG_(x86_darwin_REDIR_FOR_strlen):
movl 4(%esp), %edx
movl %edx, %eax
jmp 1f
@@ -937,8 +937,8 @@
subl %edx, %eax
ret
-.globl VG_(darwin_REDIR_FOR_strcat)
-VG_(darwin_REDIR_FOR_strcat):
+.globl VG_(x86_darwin_REDIR_FOR_strcat)
+VG_(x86_darwin_REDIR_FOR_strcat):
pushl %esi
movl 8(%esp), %esi
movl 12(%esp), %ecx
@@ -961,8 +961,8 @@
ret
-.globl VG_(darwin_REDIR_FOR_strcmp)
-VG_(darwin_REDIR_FOR_strcmp):
+.globl VG_(x86_darwin_REDIR_FOR_strcmp)
+VG_(x86_darwin_REDIR_FOR_strcmp):
movl 4(%esp), %edx
movl 8(%esp), %ecx
jmp 1f
@@ -982,8 +982,8 @@
ret
-.globl VG_(darwin_REDIR_FOR_strcpy)
-VG_(darwin_REDIR_FOR_strcpy):
+.globl VG_(x86_darwin_REDIR_FOR_strcpy)
+VG_(x86_darwin_REDIR_FOR_strcpy):
pushl %ebp
movl %esp, %ebp
pushl %esi
@@ -1004,8 +1004,8 @@
leave
ret
-.globl VG_(darwin_REDIR_FOR_strlcat)
-VG_(darwin_REDIR_FOR_strlcat):
+.globl VG_(x86_darwin_REDIR_FOR_strlcat)
+VG_(x86_darwin_REDIR_FOR_strlcat):
pushl %ebp
movl %esp, %ebp
pushl %edi
@@ -1034,7 +1034,7 @@
3:
movl 12(%ebp), %eax
movl %eax, (%esp)
- call VG_(darwin_REDIR_FOR_strlen)
+ call VG_(x86_darwin_REDIR_FOR_strlen)
jmp 7f
4:
cmpl $1, %esi
@@ -1076,8 +1076,16 @@
.globl VG_(trampoline_stuff_start)
VG_(trampoline_stuff_start):
-.globl VG_(darwin_REDIR_FOR_strlen)
-VG_(darwin_REDIR_FOR_strlen):
+.globl VG_(amd64_darwin_SUBST_FOR_sigreturn)
+VG_(amd64_darwin_SUBST_FOR_sigreturn):
+ /* XXX does this need to have any special form? (cf x86-linux
+ version) */
+ movq $ __NR_DARWIN_FAKE_SIGRETURN, %rax
+ syscall
+ ud2
+
+.globl VG_(amd64_darwin_REDIR_FOR_strlen)
+VG_(amd64_darwin_REDIR_FOR_strlen):
movq %rdi, %rax
jmp 1f
0:
@@ -1088,8 +1096,8 @@
subq %rdi, %rax
ret
-.globl VG_(darwin_REDIR_FOR_strcat)
-VG_(darwin_REDIR_FOR_strcat):
+.globl VG_(amd64_darwin_REDIR_FOR_strcat)
+VG_(amd64_darwin_REDIR_FOR_strcat):
movq %rdi, %rdx
jmp 1f
0:
@@ -1108,8 +1116,8 @@
ret
-.globl VG_(darwin_REDIR_FOR_strcmp)
-VG_(darwin_REDIR_FOR_strcmp):
+.globl VG_(amd64_darwin_REDIR_FOR_strcmp)
+VG_(amd64_darwin_REDIR_FOR_strcmp):
jmp 1f
0:
incq %rdi
@@ -1126,8 +1134,8 @@
subl %edx, %eax
ret
-.globl VG_(darwin_REDIR_FOR_strcpy)
-VG_(darwin_REDIR_FOR_strcpy):
+.globl VG_(amd64_darwin_REDIR_FOR_strcpy)
+VG_(amd64_darwin_REDIR_FOR_strcpy):
pushq %rbp
movq %rdi, %rdx
movq %rsp, %rbp
@@ -1144,8 +1152,8 @@
movq %rdi, %rax
ret
-.globl VG_(darwin_REDIR_FOR_strlcat)
-VG_(darwin_REDIR_FOR_strlcat):
+.globl VG_(amd64_darwin_REDIR_FOR_strlcat)
+VG_(amd64_darwin_REDIR_FOR_strlcat):
pushq %rbp
leaq (%rdx,%rdi), %rax
movq %rdi, %rcx
@@ -1170,7 +1178,7 @@
jmp 6f
3:
movq %rsi, %rdi
- call VG_(darwin_REDIR_FOR_strlen)
+ call VG_(amd64_darwin_REDIR_FOR_strlen)
jmp 7f
4:
cmpq $1, %rdi
@@ -1193,8 +1201,8 @@
leave
ret
-.globl VG_(darwin_REDIR_FOR_arc4random)
-VG_(darwin_REDIR_FOR_arc4random):
+.globl VG_(amd64_darwin_REDIR_FOR_arc4random)
+VG_(amd64_darwin_REDIR_FOR_arc4random):
/* not very random, hope dyld won't mind */
movq $0x76616c6772696e64, %rax
ret
Modified: branches/MACOSX106/coregrind/pub_core_trampoline.h
===================================================================
--- branches/MACOSX106/coregrind/pub_core_trampoline.h 2010-06-07 20:31:07 UTC (rev 11159)
+++ branches/MACOSX106/coregrind/pub_core_trampoline.h 2010-06-07 20:35:57 UTC (rev 11160)
@@ -119,16 +119,27 @@
extern void VG_(ppc64_aix5_do_preloads_then_start_client);
#endif
-#if defined(VGO_darwin)
+#if defined(VGP_x86_darwin)
extern void VG_(x86_darwin_SUBST_FOR_sigreturn);
-extern SizeT VG_(darwin_REDIR_FOR_strlen)( void* );
-extern SizeT VG_(darwin_REDIR_FOR_strcmp)( void*, void* );
-extern void* VG_(darwin_REDIR_FOR_strcat)( void*, void * );
-extern char* VG_(darwin_REDIR_FOR_strcpy)( char *s1, char *s2 );
-extern SizeT VG_(darwin_REDIR_FOR_strlcat)( char *s1, const char *s2, SizeT size );
-extern UInt VG_(darwin_REDIR_FOR_arc4random)( void );
+extern SizeT VG_(x86_darwin_REDIR_FOR_strlen)( void* );
+extern SizeT VG_(x86_darwin_REDIR_FOR_strcmp)( void*, void* );
+extern void* VG_(x86_darwin_REDIR_FOR_strcat)( void*, void * );
+extern char* VG_(x86_darwin_REDIR_FOR_strcpy)( char *s1, char *s2 );
+extern SizeT VG_(x86_darwin_REDIR_FOR_strlcat)( char *s1, const char *s2,
+ SizeT size );
#endif
+#if defined(VGP_amd64_darwin)
+extern void VG_(amd64_darwin_SUBST_FOR_sigreturn);
+extern SizeT VG_(amd64_darwin_REDIR_FOR_strlen)( void* );
+extern SizeT VG_(amd64_darwin_REDIR_FOR_strcmp)( void*, void* );
+extern void* VG_(amd64_darwin_REDIR_FOR_strcat)( void*, void * );
+extern char* VG_(amd64_darwin_REDIR_FOR_strcpy)( char *s1, char *s2 );
+extern SizeT VG_(amd64_darwin_REDIR_FOR_strlcat)( char *s1, const char *s2,
+ SizeT size );
+extern UInt VG_(amd64_darwin_REDIR_FOR_arc4random)( void );
+#endif
+
#endif // __PUB_CORE_TRAMPOLINE_H
/*--------------------------------------------------------------------*/
|