Bug 368823 - run_a_thread_NORETURN assembly code typo for VGP_arm64_linux target
Summary: run_a_thread_NORETURN assembly code typo for VGP_arm64_linux target
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: memcheck (show other bugs)
Version: 3.11.0
Platform: Android Other
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-14 23:02 UTC by chh
Modified: 2016-10-18 17:32 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description chh 2016-09-14 23:02:27 UTC
When compiled with clang/llvm, llvm assembler reported error in run_a_thread_NORETURN assembly code. The following diff will fix the problem.

diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c
index f796969..6584c16 100644
--- a/coregrind/m_syswrap/syswrap-linux.c
+++ b/coregrind/m_syswrap/syswrap-linux.c
@@ -269,12 +269,12 @@ static void run_a_thread_NORETURN ( Word tidW )
 #elif defined(VGP_arm64_linux)
       asm volatile (
          "str  %w1, %0\n"     /* set tst->status = VgTs_Empty (32-bit store) */
-         "mov  x8,  %2\n"     /* set %r7 = __NR_exit */
-         "ldr  x0,  %3\n"     /* set %r0 = tst->os_state.exitcode */
+         "mov  x8,  %2\n"     /* set %x8 = __NR_exit */
+         "ldr  x0,  %3\n"     /* set %x0 = tst->os_state.exitcode */
          "svc  0x00000000\n"  /* exit(tst->os_state.exitcode) */
          : "=m" (tst->status)
          : "r" (VgTs_Empty), "n" (__NR_exit), "m" (tst->os_state.exitcode)
-         : "r0", "r7"
+         : "x0", "x8"
       );
 #elif defined(VGP_s390x_linux)
       asm volatile (


Reproducible: Always

Steps to Reproduce:
On Android platform, use clang/llvm to build external/valgrind for aosp_arm64-eng target.
Comment 1 Julian Seward 2016-10-18 17:32:10 UTC
Committed, r16074.  Thanks for the patch.