From: Julian Seward Date: Sat, 19 Nov 2005 02:02:57 +0000 (+0000) Subject: Counterpart to r5202: restore previous assembler state with .previous X-Git-Tag: svn/VALGRIND_3_1_0~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=19e8e951e58a21fdfd53779b4cd166ce5237c8b6;p=thirdparty%2Fvalgrind.git Counterpart to r5202: restore previous assembler state with .previous git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5204 --- diff --git a/coregrind/m_main.c b/coregrind/m_main.c index 71bd0e2e24..8f4b4b7c75 100644 --- a/coregrind/m_main.c +++ b/coregrind/m_main.c @@ -2801,6 +2801,7 @@ asm("\n" "\tpushl %eax\n" "\tcall _start_in_C\n" "\thlt\n" + ".previous\n" ); #elif defined(VGP_amd64_linux) asm("\n" @@ -2818,6 +2819,7 @@ asm("\n" /* call _start_in_C, passing it the startup %rsp */ "\tcall _start_in_C\n" "\thlt\n" + ".previous\n" ); #elif defined(VGP_ppc32_linux) asm("\n" @@ -2843,6 +2845,7 @@ asm("\n" "\tmr 1,16\n" "\tbl _start_in_C\n" "\ttrap\n" + ".previous\n" ); #else #error "_start: needs implementation on this platform" diff --git a/coregrind/m_signals.c b/coregrind/m_signals.c index 272887f6a5..9dcf1879fe 100644 --- a/coregrind/m_signals.c +++ b/coregrind/m_signals.c @@ -400,19 +400,22 @@ extern void my_sigreturn(void); ".text\n" \ "my_sigreturn:\n" \ " movl $" #name ", %eax\n" \ - " int $0x80\n" + " int $0x80\n" \ + ".previous\n" #elif defined(VGP_amd64_linux) # define _MYSIG(name) \ ".text\n" \ "my_sigreturn:\n" \ " movq $" #name ", %rax\n" \ - " syscall\n" + " syscall\n" \ + ".previous\n" #elif defined(VGP_ppc32_linux) # define _MYSIG(name) \ ".text\n" \ "my_sigreturn:\n" \ " li 0, " #name "\n" \ - " sc\n" + " sc\n" \ + ".previous\n" #else # error Unknown platform #endif diff --git a/coregrind/m_syscall.c b/coregrind/m_syscall.c index 084604c997..fa94a4b856 100644 --- a/coregrind/m_syscall.c +++ b/coregrind/m_syscall.c @@ -130,6 +130,7 @@ asm( " popl %edi\n" " popl %esi\n" " ret\n" +".previous\n" ); #elif defined(VGP_amd64_linux) /* Incoming args (syscall number + up to 6 args) come in %rdi, %rsi, @@ -163,6 +164,7 @@ asm( " movq 8(%rsp), %r9\n" /* last arg from stack */ " syscall\n" " ret\n" +".previous\n" ); #elif defined(VGP_ppc32_linux) /* Incoming args (syscall number + up to 6 args) come in %r0, %r3:%r8 @@ -194,6 +196,7 @@ asm( " mfcr 4\n" /* %cr -> low word of return var */ " rlwinm 4,4,4,31,31\n" /* rotate flag bit so to lsb, and mask it */ " blr\n" /* and return */ +".previous\n" ); #else # error Unknown platform diff --git a/coregrind/m_syswrap/syswrap-amd64-linux.c b/coregrind/m_syswrap/syswrap-amd64-linux.c index dd64dedfb4..11e7e65411 100644 --- a/coregrind/m_syswrap/syswrap-amd64-linux.c +++ b/coregrind/m_syswrap/syswrap-amd64-linux.c @@ -95,6 +95,7 @@ asm( " popq %rdi\n" // arg1 to correct arg reg " ret\n" // jump to f " ud2\n" // should never get here +".previous\n" ); /* @@ -171,6 +172,7 @@ asm( "1:\n" // PARENT or ERROR " ret\n" +".previous\n" ); #undef __NR_CLONE diff --git a/coregrind/m_syswrap/syswrap-ppc32-linux.c b/coregrind/m_syswrap/syswrap-ppc32-linux.c index a6160f088f..63ed323ed3 100644 --- a/coregrind/m_syswrap/syswrap-ppc32-linux.c +++ b/coregrind/m_syswrap/syswrap-ppc32-linux.c @@ -110,6 +110,7 @@ asm( " mtcr 0\n\t" // CAB: Need this? " bctr\n\t" // jump to dst " trap\n" // should never get here +".previous\n" ); @@ -206,6 +207,7 @@ asm( " lwz 31,28(1)\n" " addi 1,1,32\n" " blr\n" +".previous\n" ); #undef __NR_CLONE diff --git a/coregrind/m_syswrap/syswrap-x86-linux.c b/coregrind/m_syswrap/syswrap-x86-linux.c index d65ece209e..8f1ecf5119 100644 --- a/coregrind/m_syswrap/syswrap-x86-linux.c +++ b/coregrind/m_syswrap/syswrap-x86-linux.c @@ -95,6 +95,7 @@ asm( " movl $0, %ebp\n" " ret\n" // jump to f " ud2\n" // should never get here +".previous\n" ); @@ -178,6 +179,7 @@ asm( " pop %edi\n" " pop %ebx\n" " ret\n" +".previous\n" ); #undef FSZ