Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: tests/test_patching_input.S

Issue 8596009: Add test for patching a system call instruction (Closed) Base URL: https://seccompsandbox.googlecode.com/svn/trunk
Patch Set: Add comment Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include <asm/unistd.h>
6
7
8 // This performs a system call directly so that we can test
9 // patching this instruction sequence.
10
11 .global my_getpid
12 .global my_getpid_end
13 my_getpid:
14 mov $__NR_getpid, %eax
15 #if defined(__x86_64__)
16 syscall
17 #elif defined(__i386__)
18 int $0x80
19 #else
20 # error Unsupported target platform
21 #endif
22 ret
23 my_getpid_end:
24
25 // Tell Linux not to disable no-execute protection for the process.
26 .section .note.GNU-stack,"",@progbits
OLDNEW
« tests/test_patching.cc ('K') | « tests/test_patching.cc ('k') | tests/test_runner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698