1d53e3197d
Author: Christopher R. Palmer <crpalmer@gmail.com> Date: Tue Nov 3 16:44:44 2015 -0500 linker: Add support for dynamic "shim" libs Add a new environment variable LD_SHIM_LIBS that is a colon (":") separated list of vertical bar ("|") separated pairs. The pairs are the name for a soinfo reference (executable or shared library) followed by the name of the shim library to load. For example: LD_SHIM_LIBS=rmt_storage|libshim_ioprio.so:/system/lib/libicuuv.so|libshim_icu53.so will instruct the linker to load the dynamic library libshim_ioprio.so whenver rmt_storage is executed [*] and will load libshim_icu53.so whenever any executable or other shared library links against /system/lib/libicuuv.so. There are no restrictions against circular references. In this example, libshim_icu53.so can link against libicuuv.so which provides a simple and convenient means of adding compatibility symbols. [*] Note that the absolute path is not available to the linker and therefore using the name of executables does depend on the invocation and therefore should only be used if absolutely necessary. That is, running /system/bin/rmt_storage would not load any shim libs in this example because it does not match the name of the invocation of the command. If you have trouble determining the sonames being loaded, you can also set the environment variable LD_DEBUG=1 which will cause additional information to be logged to help trace the detection of the shim libs. Change-Id: I0ef80fa466167f7bcb7dac90842bef1c3cf879b6 Author: Christopher R. Palmer <crpalmer@gmail.com> Date: Sun Nov 15 14:26:32 2015 -0500 linker: Fix the fact that shim libs do not properly call constructors Change-Id: I34333e13443a154e675b853fa41442351bc4243a Author: Christopher R. Palmer <crpalmer@gmail.com> Date: Tue Dec 1 07:10:36 2015 -0500 linker: Don't try to walk the g_active_shim_libs when doing dlsym This is a bug in the original shim_lib implementation which was doing the shim lib resolution both when loading the libraries and when doing the dynamic symbol resolution. Change-Id: Ib2df0498cf551b3bbd37d7c351410b9908eb1795 Author: Christopher R. Palmer <crpalmer@gmail.com> Date: Sun Nov 29 08:28:10 2015 -0500 linker: Reset the active shim libs each time we do a dlopen We use the active libs to avoid recursively trying to load the same library: A -> shimlibs add B -> depends on A -> shimlibs add B -> ... However, when we repeatedly dlopen the same library we need to reset the active shim libs to avoid failing to add B the second time we dlopen A. Change-Id: I27580e3d6a53858e8bca025d6c85f981cffbea06 Author: Danny Baumann <dannybaumann@web.de> Date: Fri Dec 11 10:29:16 2015 +0100 Make shim lib load failure non-fatal. Instead, print an appropriate warning message. Aborting symbol resolution on shim lib load failure leads to weird symbol lookup failures, because symbols in libraries referenced after the one loading the shim won't be loaded anymore without a log message stating why that happened. Change-Id: Ic3ad7095ddae7ea1039cb6a18603d5cde8a16143 Author: Christopher R. Palmer <crpalmer@gmail.com> Date: Sat Dec 12 06:10:09 2015 -0500 bionic: Do not allow LD_SHIM_LIBS for setuid executables That's really not safe... Change-Id: If79af951830966fc21812cd0f60a8998a752a941 Author: Christopher R. Palmer <crpalmer@gmail.com> Date: Sun Feb 14 11:38:44 2016 -0500 bionic: linker: Load shim libs *before* the self-linked libs By loading them earlier, this allows us to override a symbol in a library that is being directly linked. I believe this explains why some people have had problems shimming one lib but when the changet he shim to be against a different lib it magically works. It also makes it possible to override some symbols that were nearly impossible to override before this change. For example, it is pretty much impossible to override a symbol in libutils without this change because it's loaded almost everywhere so no matter where you try to place the shimming, it will be too late and the other symbol will have priority. In particularly, this is necessary to be able to correctly shim the VectorImpl symbols for dlx. Change-Id: I461ca416bc288e28035352da00fde5f34f8d9ffa Author: Chirayu Desai <chirayudesai1@gmail.com> Date: Thu Aug 25 19:02:41 2016 +0530 linker: Update find_library call for shimlibs commits |
||
---|---|---|
.. | ||
arch | ||
testdata | ||
Android.bp | ||
dlfcn.cpp | ||
ld.config.format.md | ||
ld_android.cpp | ||
ldd.sh | ||
linked_list.h | ||
linked_list_test.cpp | ||
linker.arm.map | ||
linker.cpp | ||
linker.generic.map | ||
linker.h | ||
linker_auxv.cpp | ||
linker_auxv.h | ||
linker_block_allocator.cpp | ||
linker_block_allocator.h | ||
linker_block_allocator_test.cpp | ||
linker_cfi.cpp | ||
linker_cfi.h | ||
linker_common_types.h | ||
linker_config.cpp | ||
linker_config.h | ||
linker_config_test.cpp | ||
linker_crt_pad_segment_test.cpp | ||
linker_debug.cpp | ||
linker_debug.h | ||
linker_debuggerd.h | ||
linker_debuggerd_android.cpp | ||
linker_debuggerd_stub.cpp | ||
linker_dlwarning.cpp | ||
linker_dlwarning.h | ||
linker_gdb_support.cpp | ||
linker_gdb_support.h | ||
linker_globals.cpp | ||
linker_globals.h | ||
linker_gnu_hash.h | ||
linker_gnu_hash_benchmark.cpp | ||
linker_gnu_hash_test.cpp | ||
linker_libc_support.c | ||
linker_libcxx_support.cpp | ||
linker_logger.cpp | ||
linker_logger.h | ||
linker_main.cpp | ||
linker_main.h | ||
linker_mapped_file_fragment.cpp | ||
linker_mapped_file_fragment.h | ||
linker_memory.cpp | ||
linker_namespaces.cpp | ||
linker_namespaces.h | ||
linker_note_gnu_property.cpp | ||
linker_note_gnu_property.h | ||
linker_note_gnu_property_test.cpp | ||
linker_phdr.cpp | ||
linker_phdr.h | ||
linker_reloc_iterators.h | ||
linker_relocate.cpp | ||
linker_relocate.h | ||
linker_relocs.h | ||
linker_sdk_versions.cpp | ||
linker_sleb128.h | ||
linker_sleb128_test.cpp | ||
linker_soinfo.cpp | ||
linker_soinfo.h | ||
linker_test_globals.cpp | ||
linker_tls.cpp | ||
linker_tls.h | ||
linker_translate_path.cpp | ||
linker_translate_path.h | ||
linker_transparent_hugepage_support.cpp | ||
linker_utils.cpp | ||
linker_utils.h | ||
linker_utils_test.cpp | ||
linker_wrapper.cpp | ||
MODULE_LICENSE_BSD | ||
NOTICE | ||
rt.cpp |