OLD | NEW |
(Empty) | |
| 1 A custom dynamic linker for Android programs that adds a few interesting |
| 2 features compared to /system/bin/linker: |
| 3 |
| 4 - Supports loading a library at an explicit (page-aligned) memory |
| 5 address. The system linker always randomizes the address. |
| 6 |
| 7 - Supports loading a library from an explicit (page-aligned) file |
| 8 offset. This can be useful to load a library directly from an .apk, |
| 9 provided that it is uncompressed and at a page-aligned offset. |
| 10 |
| 11 - Support changing the library search path. The system linker, when used |
| 12 inside Android applications, is limited to the boot LD_LIBRARY_PATH |
| 13 value, that only looks into system directories, not application ones. |
| 14 |
| 15 - Support sharing of RELRO sections. When two processes load the same |
| 16 library at exactly the same address, the content of its RELRO section |
| 17 is identical. By default, each instance uses private RAM pages to host |
| 18 it, but it is possible to use a single ashmem region to share the same |
| 19 data instead. |
| 20 |
| 21 See include/crazy_linker.h for the API and its documentation. |
| 22 |
| 23 A few notes: |
| 24 |
| 25 - The crazy linker will always use the system linker to load system |
| 26 libraries (e.g. liblog.so and others). This avoids having two instances |
| 27 of the same library in the same process, and correctly resolving any |
| 28 symbols from system libraries. |
| 29 |
| 30 - Any library loaded by the crazy linker, and which uses functions of |
| 31 libdl.so will continue to work. However, calls to dlopen(), dlsym(), |
| 32 et al will be redirected to the crazy linker's own wrappers. |
| 33 |
| 34 This ensures that if a library is loaded by the crazy linker, any of |
| 35 its dependencies will be loaded by it too. |
| 36 |
| 37 BUGS & TODO: |
| 38 - At the moment, libraries loaded by the crazy linker are not visible |
| 39 by GDB or third-party tools like Breakpad. Similarly, cross-library |
| 40 stack unwinding has not been tested yet. |
| 41 |
| 42 - Libraries loaded by the crazy linker are not automatically closed when |
| 43 the process exits. |
OLD | NEW |