| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // This is the version of the Android-specific Chromium linker that uses | 5 // This is the version of the Android-specific Chromium linker that uses |
| 6 // the Android M and later system linker to load libraries. | 6 // the Android M and later system linker to load libraries. |
| 7 | 7 |
| 8 // This source code *cannot* depend on anything from base/ or the C++ | 8 // This source code *cannot* depend on anything from base/ or the C++ |
| 9 // STL, to keep the final library small, and avoid ugly dependency issues. | 9 // STL, to keep the final library small, and avoid ugly dependency issues. |
| 10 | 10 |
| 11 #include "modern_linker_jni.h" | 11 #include "modern_linker_jni.h" |
| 12 | 12 |
| 13 #include <sys/mman.h> | 13 #include <sys/mman.h> |
| 14 #include <sys/stat.h> | 14 #include <sys/stat.h> |
| 15 #include <sys/types.h> | 15 #include <sys/types.h> |
| 16 #include <dlfcn.h> | 16 #include <dlfcn.h> |
| 17 #include <errno.h> | 17 #include <errno.h> |
| 18 #include <fcntl.h> | 18 #include <fcntl.h> |
| 19 #include <jni.h> | 19 #include <jni.h> |
| 20 #include <limits.h> | 20 #include <limits.h> |
| 21 #include <link.h> | 21 #include <link.h> |
| 22 #include <stddef.h> |
| 22 #include <string.h> | 23 #include <string.h> |
| 23 | 24 |
| 24 #include "android_dlext.h" | 25 #include "android_dlext.h" |
| 25 #include "linker_jni.h" | 26 #include "linker_jni.h" |
| 26 | 27 |
| 27 #define PAGE_START(x) ((x) & PAGE_MASK) | 28 #define PAGE_START(x) ((x) & PAGE_MASK) |
| 28 #define PAGE_END(x) PAGE_START((x) + (PAGE_SIZE - 1)) | 29 #define PAGE_END(x) PAGE_START((x) + (PAGE_SIZE - 1)) |
| 29 | 30 |
| 30 namespace chromium_android_linker { | 31 namespace chromium_android_linker { |
| 31 namespace { | 32 namespace { |
| (...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 603 kNativeMethods, | 604 kNativeMethods, |
| 604 sizeof(kNativeMethods) / sizeof(kNativeMethods[0])); | 605 sizeof(kNativeMethods) / sizeof(kNativeMethods[0])); |
| 605 | 606 |
| 606 // Record the Java VM handle. | 607 // Record the Java VM handle. |
| 607 s_java_vm = vm; | 608 s_java_vm = vm; |
| 608 | 609 |
| 609 return true; | 610 return true; |
| 610 } | 611 } |
| 611 | 612 |
| 612 } // namespace chromium_android_linker | 613 } // namespace chromium_android_linker |
| OLD | NEW |