OLD | NEW |
(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 |
OLD | NEW |