|
From: <sv...@va...> - 2015-02-11 00:41:55
|
Author: sewardj
Date: Wed Feb 11 00:41:48 2015
New Revision: 14927
Log:
arm32: local_sys_write_stderr and local_sys_getpid: don't trash r7
in the inline assembly, because gcc doesn't like that when compiling
for Thumb. And this file is compiled for Thumb during "make check".
Modified:
trunk/coregrind/m_debuglog.c
Modified: trunk/coregrind/m_debuglog.c
==============================================================================
--- trunk/coregrind/m_debuglog.c (original)
+++ trunk/coregrind/m_debuglog.c Wed Feb 11 00:41:48 2015
@@ -244,12 +244,14 @@
"mov r0, #2\n\t" /* stderr */
"ldr r1, [%0]\n\t" /* buf */
"ldr r2, [%0, #4]\n\t" /* n */
+ "push {r6,r7}\n\t"
"mov r7, #"VG_STRINGIFY(__NR_write)"\n\t"
"svc 0x0\n" /* write() */
+ "pop {r6,r7}\n\t"
"str r0, [%0]\n\t"
:
: "r" (block)
- : "r0","r1","r2","r7"
+ : "r0","r1","r2"
);
if (block[0] < 0)
block[0] = -1;
@@ -260,12 +262,14 @@
{
UInt __res;
__asm__ volatile (
- "mov r7, #"VG_STRINGIFY(__NR_getpid)"\n"
- "svc 0x0\n" /* getpid() */
- "mov %0, r0\n"
+ "push {r6,r7}\n\t"
+ "mov r7, #"VG_STRINGIFY(__NR_getpid)"\n\t"
+ "svc 0x0\n\t" /* getpid() */
+ "pop {r6,r7}\n\t"
+ "mov %0, r0\n\t"
: "=r" (__res)
:
- : "r0", "r7" );
+ : "r0" );
return __res;
}
|