From: Julian Seward Date: Thu, 28 Apr 2005 09:40:53 +0000 (+0000) Subject: Even more pissing with inline asm around to placate gcc-3.4 -fpic. We X-Git-Tag: svn/VALGRIND_3_0_0~739 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=efbfebe72efac16fc10262e79cd86ab065d9249d;p=thirdparty%2Fvalgrind.git Even more pissing with inline asm around to placate gcc-3.4 -fpic. We can't trash %ebx without gcc getting unhappy, so trash %edi instead. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3579 --- diff --git a/coregrind/m_debuglog.c b/coregrind/m_debuglog.c index 3808e60eaf..940d1881e0 100644 --- a/coregrind/m_debuglog.c +++ b/coregrind/m_debuglog.c @@ -63,15 +63,18 @@ static UInt local_sys_write_stderr ( HChar* buf, Int n ) { UInt __res; __asm__ volatile ( - "movl $4, %%eax\n" /* set %eax = __NR_write */ - "movl $2, %%ebx\n" /* set %ebx = stderr */ - "movl %1, %%ecx\n" /* set %ecx = buf */ - "movl %2, %%edx\n" /* set %edx = n */ - "int $0x80\n" /* write(stderr, buf, n) */ - "movl %%eax, %0\n" /* set __res = eax */ + "movl $4, %%eax\n" /* %eax = __NR_write */ + "movl $2, %%edi\n" /* %edi = stderr */ + "movl %1, %%ecx\n" /* %ecx = buf */ + "movl %2, %%edx\n" /* %edx = n */ + "pushl %%ebx\n" + "movl %%edi, %%ebx\n" + "int $0x80\n" /* write(stderr, buf, n) */ + "popl %%ebx\n" + "movl %%eax, %0\n" /* __res = eax */ : "=mr" (__res) : "g" (buf), "g" (n) - : "eax", "ebx", "ecx", "edx" + : "eax", "edi", "ecx", "edx" ); if (__res < 0) __res = -1;