Add arm64 do_syscall_WRK implementation to memcheck/tests/leak-segv-jmp.

On arm64-linux memcheck/tests/leak-segv-jmp would fail because there
was no do_syscall_WRK implementation for that architecture. Implement
and adjust line numbers in .exp file to make it PASS.
This commit is contained in:
Mark Wielaard 2019-04-07 22:27:52 +02:00
parent 19906dc4d9
commit 06d1d39fdc
2 changed files with 32 additions and 10 deletions

View File

@ -108,6 +108,24 @@ asm(
".previous\n"
);
#elif defined(VGP_arm64_linux)
extern UWord do_syscall_WRK (
UWord a1, UWord a2, UWord a3,
UWord a4, UWord a5, UWord a6,
UWord syscall_no
);
asm(
".text\n"
".globl do_syscall_WRK\n"
"do_syscall_WRK:\n"
" mov x8, x6\n"
" mov x6, 0\n"
" mov x7, 0\n"
" svc 0\n"
" ret\n"
".previous\n"
);
#elif defined(VGP_s390x_linux)
UWord do_syscall_WRK (
UWord syscall_no,
@ -238,6 +256,10 @@ static void non_simd_mprotect (long tid, void* addr, long len)
&err);
if (err)
mprotect_result = -1;
#elif defined(VGP_arm64_linux)
mprotect_result = do_syscall_WRK((UWord) addr, len, PROT_NONE,
0, 0, 0,
__NR_mprotect);
#else
mprotect_result = do_syscall_WRK(__NR_mprotect,
(UWord) addr, len, PROT_NONE,

View File

@ -14,8 +14,8 @@ To see them, rerun with: --leak-check=full --show-leak-kinds=all
expecting a leak
1,000 bytes in 1 blocks are definitely lost in loss record ... of ...
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: f (leak-segv-jmp.c:271)
by 0x........: main (leak-segv-jmp.c:346)
by 0x........: f (leak-segv-jmp.c:293)
by 0x........: main (leak-segv-jmp.c:368)
LEAK SUMMARY:
definitely lost: 1,000 bytes in 1 blocks
@ -30,8 +30,8 @@ mprotect result 0
expecting a leak again
1,000 bytes in 1 blocks are definitely lost in loss record ... of ...
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: f (leak-segv-jmp.c:271)
by 0x........: main (leak-segv-jmp.c:346)
by 0x........: f (leak-segv-jmp.c:293)
by 0x........: main (leak-segv-jmp.c:368)
LEAK SUMMARY:
definitely lost: 1,000 bytes in 1 blocks
@ -46,8 +46,8 @@ full mprotect result 0
expecting a leak again after full mprotect
1,000 bytes in 1 blocks are definitely lost in loss record ... of ...
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: f (leak-segv-jmp.c:271)
by 0x........: main (leak-segv-jmp.c:346)
by 0x........: f (leak-segv-jmp.c:293)
by 0x........: main (leak-segv-jmp.c:368)
LEAK SUMMARY:
definitely lost: 1,000 bytes in 1 blocks
@ -62,13 +62,13 @@ mprotect result 0
expecting heuristic not to crash after full mprotect
1,000 bytes in 1 blocks are definitely lost in loss record ... of ...
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: f (leak-segv-jmp.c:271)
by 0x........: main (leak-segv-jmp.c:346)
by 0x........: f (leak-segv-jmp.c:293)
by 0x........: main (leak-segv-jmp.c:368)
200,000 bytes in 1 blocks are possibly lost in loss record ... of ...
at 0x........: calloc (vg_replace_malloc.c:...)
by 0x........: f (leak-segv-jmp.c:318)
by 0x........: main (leak-segv-jmp.c:346)
by 0x........: f (leak-segv-jmp.c:340)
by 0x........: main (leak-segv-jmp.c:368)
LEAK SUMMARY:
definitely lost: 1,000 bytes in 1 blocks