summaryrefslogtreecommitdiff
path: root/linker/linker_main.cpp
AgeCommit message (Collapse)Author
2017-07-06The ifdef check for AT_SYSINFO_EHDR is no longer neededdimitry
AT_SYSINFO_EHDR is present in all architectures Test: make Change-Id: I0f4c115bb48e47ea156e7fca936960f5f10c618e
2017-06-28bionic: fix assorted static analyzer warningsGeorge Burgess IV
Warnings: bionic/libc/bionic/fts.c:722:5: warning: Null passed to a callee that requires a non-null 1st parameter bionic/libc/bionic/sched_cpualloc.c:34:25: warning: Result of 'malloc' is converted to a pointer of type 'cpu_set_t', which is incompatible with sizeof operand type 'unsigned long' bionic/linker/linker_main.cpp:315:7: warning: Access to field 'e_type' results in a dereference of a null pointer (loaded from variable 'elf_hdr') bionic/linker/linker_main.cpp:493:66: warning: Access to field 'e_phoff' results in a dereference of a null pointer (loaded from variable 'elf_hdr') bionic/linker/linker_main.cpp:90:14: warning: Access to field 'next' results in a dereference of a null pointer (loaded from variable 'prev') Bug: None Test: mma; analyzer warnings are gone. CtsBionicTestCases pass. Change-Id: I699a60c2c6f64c50b9ea06848a680c98a8abb44a
2017-05-31Make dl_iterate_phdr return correct name for first entryDimitry Ivanov
Test: bionic-unit-tests --gtest_filter=link* Change-Id: Ib3f1e0fbc76fed9a5f27ffdd9bbf847a3e8d3665
2017-05-03Move libc_log code into libasync_safe.Christopher Ferris
This library is used by a number of different libraries in the system. Make it easy for platform libraries to use this library and create an actual exported include file. Change the names of the functions to reflect the new name of the library. Run clang_format on the async_safe_log.cpp file since the formatting is all over the place. Bug: 31919199 Test: Compiled for angler/bullhead, and booted. Test: Ran bionic unit tests. Test: Ran the malloc debug tests. Change-Id: I8071bf690c17b0ea3bc8dc5749cdd5b6ad58478a
2017-03-25Merge "Load namespace configuration from ld.config.txt"Treehugger Robot
2017-03-24Load namespace configuration from ld.config.txtDimitry Ivanov
This change allows customization of default namespace configuration for different executables. It also enables target_sdk_version setup for binaries (note that this option should explicitly be enabled in ld.config.txt). Bug: http://b/30706810 Bug: http://b/30435785 Test: run linker-unit-tests/bionic-unit-tests, boot angler Change-Id: Ibbe87209acf1538fc9cec04944f3d22a190c38f1
2017-03-23loader: stop relying on AT_BASEDimitry Ivanov
android loader should not rely on the fact that AT_BASE is set because kernel currently does not set it when linker is run standalone (The linker does not have PT_INTERP set) This commit replaces AT_BASE with calculated value. Bug: http://b/30739481 Bug: http://b/35890756 Test: run bionic-unit-tests --gtest_filter=dl* Change-Id: Ic2eb73e4452624b1f2e05f46e99e4c17df0bbc3f
2017-02-24loader: set PT_INTERP to itselfDimitry Ivanov
Some versions of kernel set AT_BASE to 0 if dynamic loader does not have PT_INTERP set. Bug: http://b/30739481 Test: run /system/bin/linker64 and /system/bin/linker Change-Id: I1b67777166fe917d3ee1a97277045ca6f5db0084
2017-02-09Replace public library list with shared lib sonames (part 1/2)Dimitry Ivanov
Replace public library list with shared lib sonames which are property of a link between namespaces This change does not touch any external interfaces so from outside it behaves almost as it was before One significant difference is that there is no longer need to preload public libraries. Bug: http://b/26833548 Test: bionic-unit-tests --gtest_filter=dl*:Dl* Change-Id: I57e44e18a9b4f07dcd6556436346be52f52b79d7
2017-01-31Exit failure if trying to load non-PIE.Dan Albert
Amazingly this was actually breaking the NDK's ability to build libstdc++ for x86. Test: mma Bug: None Change-Id: Iafa55c31fdeb35caca7d7d7a39a3e7afa0713557
2017-01-18Merge "Runtime support for CFI"Evgenii Stepanov
2017-01-18Runtime support for CFIEvgenii Stepanov
Control Flow Integrity support in bionic. General design: http://clang.llvm.org/docs/ControlFlowIntegrityDesign.html#shared-library-support This CL implements subsections "CFI Shadow" and "CFI_SlowPath" in the above document. Bug: 22033465 Test: bionic device tests Change-Id: I14dfea630de468eb5620e7f55f92b1397ba06217
2017-01-17Rename libdebuggerd_client to libdebuggerd_handler.Josh Gao
Bug: http://b/30705528 Test: debuggerd_test Change-Id: I625a9a2e7304d172873ba9344b74efa57ad7bdad
2017-01-09Dynamic linker errors should go to stderr.Elliott Hughes
Also add the missing \n to the end of the error. Addresses review comment. Bug: N/A Test: manual Change-Id: I7c997a71e6e02381d21ac762595ba90370db9d05
2017-01-07Exit rather than abort if asked to run a non-PIE executable.Elliott Hughes
Each release we're asked to investigate tombstones from code that hasn't been allowed to run on Android since L. This is just wasting our time, and clearly the "obviousness" of aborting rather than exiting hasn't ensured that all app developers rebuild their old binaries. In some cases it seems like they run them "just in case" and don't care if they fail. Bug: http://b/34112178 Test: ran libsupervisor.so from com.ss.android.article.news Change-Id: I8a3f196c4755601a3888281566fbb7b817f01dca
2016-12-09Bionic loader is no longer hijacking libdl.soDimitry Ivanov
Do not hijack libdl.so methods but make libdl proxy calls to loader instead. This will be replaces by calls to libc.so once loader functionality is migrated. Also add a lock to dl_unwind_find_exidx function call. Test: bionic-unit-tests --gtest_filter=dl*:Dl* Bug: http://b/27106625 Change-Id: Ic33a7109a86f4262798d63a35f4c61d15b0068bb
2016-12-06Revert "Bionic loader is no longer hijacking libdl.so"Andreas Gampe
This reverts commit c12acef96bd80c419654e159e1dc24a69513a86d. Breaks the Mips build. Bug: 27106625 Change-Id: I27edb7114065c36e1b618e387530d58189cdb184
2016-12-05Bionic loader is no longer hijacking libdl.soDimitry Ivanov
Do not hijack libdl.so methods but make libdl proxy calls to loader instead. This will be replaces by calls to libc.so once loader functionality is migrated. Also add a lock to dl_unwind_find_exidx function call. Test: bionic-unit-tests --gtest_filter=dl*:Dl* Bug: http://b/27106625 Change-Id: I9e666e771e4bbca52151cfa7fc4c8677e1480818
2016-11-29Enable libc/libdl/libm/linker for host bionicDan Willemsen
Disables debuggerd integration unless building for android. Bug: 31559095 Test: Diff out/soong/build.ninja before/after, only change is moving linker's libdebuggerd_client static lib to the beginning of the list. Test: lunch aosp_arm64-eng; mmma -j bionic Change-Id: I62e725f7a9b98b7fe31637d0a835fd5846b0aff0
2016-09-13linker: Refactoring step 3 of manyDimitry Ivanov
Extract linker executable specific code to linker_main.cpp; this part of code does not have a place in libdl.a/so. Bug: http://b/14998480 Bug: http://b/30706810 Test: mm && run bionic-unit-tests Change-Id: I90f7475e93a919b0f9525da22928089ad35b8f6c