OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef CRAZY_LINKER_H | 5 #ifndef CRAZY_LINKER_H |
6 #define CRAZY_LINKER_H | 6 #define CRAZY_LINKER_H |
7 | 7 |
8 // This is the crazy linker, a custom dynamic linker that can be used | 8 // This is the crazy linker, a custom dynamic linker that can be used |
9 // by NDK applications to load shared libraries (not executables) with | 9 // by NDK applications to load shared libraries (not executables) with |
10 // a twist. | 10 // a twist. |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 // Note that this works even if the memory is inside a system library that | 328 // Note that this works even if the memory is inside a system library that |
329 // was not previously opened with crazy_library_open(). | 329 // was not previously opened with crazy_library_open(). |
330 // |address| is the memory address. | 330 // |address| is the memory address. |
331 // On success, returns CRAZY_STATUS_SUCCESS and sets |*library|. | 331 // On success, returns CRAZY_STATUS_SUCCESS and sets |*library|. |
332 // The caller muyst call crazy_library_close() once it's done with the | 332 // The caller muyst call crazy_library_close() once it's done with the |
333 // library. | 333 // library. |
334 crazy_status_t crazy_library_find_from_address( | 334 crazy_status_t crazy_library_find_from_address( |
335 void* address, | 335 void* address, |
336 crazy_library_t** library) _CRAZY_PUBLIC; | 336 crazy_library_t** library) _CRAZY_PUBLIC; |
337 | 337 |
| 338 // Check whether |lib_name| is page aligned in |zipfile_name|. |
| 339 crazy_status_t crazy_linker_check_library_aligned_in_zip_file( |
| 340 const char* zipfile_name, |
| 341 const char* lib_name) _CRAZY_PUBLIC; |
| 342 |
338 // Close a library. This decrements its reference count. If it reaches | 343 // Close a library. This decrements its reference count. If it reaches |
339 // zero, the library be unloaded from the process. | 344 // zero, the library be unloaded from the process. |
340 void crazy_library_close(crazy_library_t* library) _CRAZY_PUBLIC; | 345 void crazy_library_close(crazy_library_t* library) _CRAZY_PUBLIC; |
341 | 346 |
342 // Close a library, with associated context to support delayed operations. | 347 // Close a library, with associated context to support delayed operations. |
343 void crazy_library_close_with_context(crazy_library_t* library, | 348 void crazy_library_close_with_context(crazy_library_t* library, |
344 crazy_context_t* context) _CRAZY_PUBLIC; | 349 crazy_context_t* context) _CRAZY_PUBLIC; |
345 | 350 |
346 #ifdef __cplusplus | 351 #ifdef __cplusplus |
347 } /* extern "C" */ | 352 } /* extern "C" */ |
348 #endif | 353 #endif |
349 | 354 |
350 #endif /* CRAZY_LINKER_H */ | 355 #endif /* CRAZY_LINKER_H */ |
OLD | NEW |