05e190c093ad5b04691ed87100a711ef91f380b0 |
|
29-Aug-2014 |
Dmitriy Ivanov <dimitry@google.com> |
Look into ld_preloads before current library Change lookup order during relocation so that ld_preloads always precede caller (unless caller is main executable). Asan needs this change in order to intercept libc->libc calls. Bug: 15432753 Change-Id: If69aa16efe59aa35bb30e96feb83d08f1efbec86
|
20dc3f8fa4b192d902d58f496ae15ff33faa78ac |
|
27-Aug-2014 |
Christopher Ferris <cferris@google.com> |
Replace snprintf calls in linker. When enabling debug malloc, the snprintf calls in the linker fails to update the buffer. The problem is that snprintf makes a call to pthread_getspecific that returns a valid pointer, but the data it points to is zero. This should never happen and causes the snprintf to stop and do nothing. Temporarily replace snprintf with a different implementation to work around this issue. Bug: 16874447 Bug: 17302493 Change-Id: I7a500f28adf153150cf2812fae745ff41f1c48d3
|
172955a4e30b88ce8239a7ef426b4e8903e9923c |
|
27-Aug-2014 |
Christopher Ferris <cferris@google.com> |
Replace snprintf calls in linker. When enabling debug malloc, the snprintf calls in the linker fails to update the buffer. The problem is that snprintf makes a call to pthread_getspecific that returns a valid pointer, but the data it points to is zero. This should never happen and causes the snprintf to stop and do nothing. Temporarily replace snprintf with a different implementation to work around this issue. Bug: 16874447 Bug: 17302493 Change-Id: I7a500f28adf153150cf2812fae745ff41f1c48d3
|
9419420919ea846bbad5510850c7aaec95021648 |
|
19-Aug-2014 |
Dmitriy Ivanov <dimitry@google.com> |
Revert "Add support for protected local symbol lookup." This reverts commit d97e9f546ea195686a78e539315b273393609b9e. Bug: 17107521 Change-Id: I2b81ce2b5a4a2d166133a2626e49d81b6aef3672
|
8a84d383fb74135e928d341baa180c55854f2f42 |
|
13-Aug-2014 |
Dmitriy Ivanov <dimitry@google.com> |
Optimize symbol lookup Do not run symbol lookup on already visited soinfos Not taking into account already visited libraries dramatically slows down dlsym in cases when there are multiple occurrences of a large library in dependency tree. Bug: 16977077 (cherry picked from commit 042426ba6375f5c145379e598486ec6d675533c9) Change-Id: I69d59e395e8112f119343e8a4d72fe31cd449f31
|
db7a17d4ff56a05af01ee2fee1f3c55245bfc630 |
|
05-Aug-2014 |
Dmitriy Ivanov <dimitry@google.com> |
Revert "Revert "Fix dlsym(3) to do breadth first search."" This reverts commit 1b1966d9448e979d1503a3d8843708bfa8880dc6. Change-Id: I05d6d3481aaf8f3e260d2e5e950248519a1d347f
|
1b1966d9448e979d1503a3d8843708bfa8880dc6 |
|
04-Aug-2014 |
Dmitriy Ivanov <dimitry@google.com> |
Revert "Fix dlsym(3) to do breadth first search." This reverts commit 422106a24d620af4be58e8d92a2e9b7b6167b72d. Change-Id: I9e26a6933d10eb30438b521450f2010997ca5aee
|
5febb0da6f6d7106c403e6809917d89d6ee081ad |
|
29-Jul-2014 |
Dmitriy Ivanov <dimitry@google.com> |
Fix 'adb shell /system/bin/linker' crash Bug: https://code.google.com/p/android/issues/detail?id=63174 (cherry picked from commit efe13832dccf2cec2898b89ca4418a6aac29d3eb) Change-Id: I43629e4a14870f67abc2dd5ff2e3040c47b2168d
|
422106a24d620af4be58e8d92a2e9b7b6167b72d |
|
29-Jul-2014 |
Dmitriy Ivanov <dimitry@google.com> |
Fix dlsym(3) to do breadth first search. dlsym(3) with handle != RTLD_DEFAULT|RTLD_NEXT performs breadth first search through the dependency tree. Bug: 16653281 (cherry picked from commit aa0f2bdbc22d4b7aec5d3f8f5f01eaeaa13414c2) Change-Id: I0ba8c2034ab341f8a279cdb4e2e7e47f1aef7897
|
65549969488bbce7f5d1b57714ba32c466943470 |
|
25-Jul-2014 |
Dmitriy Ivanov <dimitry@google.com> |
Fix global variable initialization for linker Linker now calls init functions for itself. (cherry picked from commit 4151ea73b75e274d1ff80b42d9d457a783208516) Change-Id: I3300fe22de8ad8466a5b1c2d551429769a42852d
|
3a8646fc5d9f1a9304251a1d1c8ff9e523d81b40 |
|
08-Jul-2014 |
Dmitriy Ivanov <dimitry@google.com> |
Change android_dlextinfo flags to uint64_t Change-Id: Id27e8f8e58dbcf6ae79644f2ad3af3dd0aef9ae7
|
d38306694179962f2d784fd1828afd4af1d8a4ec |
|
03-Jul-2014 |
Dmitriy Ivanov <dimitry@google.com> |
Build fix Change-Id: Ib43e0f055e3c5f07b50393bfcab9738454835ac3
|
76e289c026f11126fc88841b3019fd5bb419bb67 |
|
03-Jul-2014 |
Nick Kralevich <nnk@google.com> |
Revert "Reenable support for non-PIE executables" /system/bin/tf_daemon on Nakasi has been updated so it's a PIE executable. We can now drop non-PIE support. This reverts commit d81b3b275dff99561cbe5905ca63a1c72fa54a17. Bug: 15086752 Bug: 15732002 Bug: 14566672 Change-Id: I832c4de01a8fa050754ea64da317d1639990265e
|
04dc91ae763adc403a14c88b4c46f77b3d2d71a3 |
|
01-Jul-2014 |
Dmitriy Ivanov <dimitry@google.com> |
Load library using file handle. * This patch enables dlopen by file descriptor instead of path/name. Bug: 15984217 Change-Id: Ib39051e00567fb97070bf96d8ce63993877c0a01
|
12bf3bcdeeaa0dcdc7a4f4e4d11bc2fc3bf6bd7a |
|
01-Jul-2014 |
Dmitriy Ivanov <dimitry@google.com> |
Write message to stderr on __libc_fatal() Change-Id: Ia8d6e256768fa51786d0139d3f3b6e9e4bebe027
|
d97e9f546ea195686a78e539315b273393609b9e |
|
29-Jun-2014 |
Dmitriy Ivanov <dimitry@google.com> |
Add support for protected local symbol lookup. Bug: http://code.google.com/p/android/issues/detail?id=66048 Change-Id: Ib334223df27adad9477fb241ab099c5e26df4a7d
|
e43c4a7a665032a29cb5ec15d4adbf81ea199220 |
|
29-Jun-2014 |
Dmitriy Ivanov <dimitry@google.com> |
Disallow dlopen("egl/blah.so") on LP64 Bug: 7465467 Change-Id: Ibd3a4f1a6095f4397bde4f656e3c11b67f7edd47
|
aa836f731016f7f1099d6a6ce47a35f1ec17dd4e |
|
30-Jun-2014 |
Elliott Hughes <enh@google.com> |
Reinstate the x86 dynamic linker warning for text relocations. Bug: 11358761 Change-Id: I4fc56ce7d76c9703a307ddd4d371d5e98bc6f51d
|
d81b3b275dff99561cbe5905ca63a1c72fa54a17 |
|
19-Jun-2014 |
Nick Kralevich <nnk@google.com> |
Reenable support for non-PIE executables On Nakasi builds, /system/bin/tf_daemon is a pre-compiled vendor supplied binary. When support for non-PIE executables was removed, that daemon failed to start, which induced a number of bugs. * keystore is broken * CTS runs will hang after a certain period of time Temporarily reenable non-PIE support for 32-bit platforms until Nakasi is fixed. This rolls back the following commits: Cleanup: updated comments * 6275f2083415d22a6ce0de55645079cd47e0cc80 Cleanup: remove AARCH/ARM_COPY relocation support * b906e13c55c9fe9b4157ba548534a0230434882b And restricts the following patch to 64 bit only: Remove support for non-PIE executables * 2aebf5429bb1241a3298b5b642d38f73124c2026 Bug: 14566672 Bug: 15086752 Bug: 15732002 Change-Id: Ia2501aa14bd30feb4a6ce66bdb7c9f066dba0b5f
|
1a586293400d0e1d73e6eb82f7dfe9d2d9ed3c4b |
|
04-Jun-2014 |
Elliott Hughes <enh@google.com> |
Remove an unused parameter from the dlopen implementation. Change-Id: I9297913a743bb570b48ebbe594ff711a481e89e0
|
d286796fce1e6fff407b719a53eb2afbeb96c327 |
|
04-Jun-2014 |
Elliott Hughes <enh@google.com> |
Turn on -Wunused and fix the mistakes it uncovers. Change-Id: I023d2d8b547fbc21d4124bb7510d42b06a0dc501
|
3c005d60194aadd92584258118c06782c9deab11 |
|
23-May-2014 |
Bjorn Andersson <bjorn.andersson@sonymobile.com> |
Do not add arcs to the soinfo graph on dlopen While introducing RTLD_NOLOAD in b648a8a5 a change in how soinfo structs are connected was also introduced. When calling dlopen the library that is loaded is added as a child to the soinfo from which the caller comes - i.e. building a dependency graph. Unfortunately this shows issues upon unloading, such as blowing the stack if there are loops in the graph. This change reverts that part of b648a8a5, keeping everything as a child of the root soinfo. Change-Id: I604ee9210613b19f693a568158e69707620a95db Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
|
2ea60ff0b415ad5b135f498a38c4b56ea75215aa |
|
22-May-2014 |
Elliott Hughes <enh@google.com> |
Remove unnecessary #includes of <sys/atomics.h>. Bug: 14903517 Change-Id: I7b5bcebe58774a441da986cc02376dd88e00ea0e
|
b648a8a57ee42533a5bf127225a252f73ca2cbbc |
|
20-May-2014 |
Dmitriy Ivanov <dimitry@google.com> |
Add RTLD_NOLOAD support and some related changes. * Aligned RTLD_ values with glibc for lp64 * dlopen supports RTLD_NOLOAD flag * soinfo_unload calls find_library(.., RTLD_NOLOAD) instead of naive find_loaded_library_by_name() * dlopen changed to add child to caller soinfo instead of somain. Bug: https://code.google.com/p/android/issues/detail?id=64069 Change-Id: I1a65f2c34f3e0edc6d2c41a2e408b58195feb640
|
bb5bb2046fa0759d94995cbfb4f41137cd0b2a91 |
|
16-May-2014 |
Pavel Chupin <pavel.v.chupin@intel.com> |
Add R_X86_64_64 to the list of possible weak relocs Change-Id: I768a5948d89701a1719734954a3524d3c7187e6a Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
|
489e498434f53269c44e3c13039eb630e86e1fd9 |
|
20-May-2014 |
Dmitriy Ivanov <dimitry@google.com> |
Fix lookup-by-base-name for lp64 Bug:https://code.google.com/p/android/issues/detail?id=6670 Change-Id: I5b70e7cde7f40799148aca0a91fb2bb08e0f2b54
|
d59e50063ad708509f3ad83350be33f5612c4f54 |
|
09-May-2014 |
Dmitriy Ivanov <dimitry@google.com> |
Improve detection of already loaded libraries Linker is now able to resolve symlinked libraries correctly. soinfo is extended to save the graph of dependencies during load/unload. Dependencies are used only in CallConstructor. Bug: 9741592 Change-Id: Id9c48a74c46aa89bcdf3d54ec2f8ba3d398130b1
|
1728b2396591853345507a063ed6075dfd251706 |
|
14-May-2014 |
Elliott Hughes <enh@google.com> |
Switch to g_ for globals. That's what the Google style guide recommends, and we're starting to get a mix. Change-Id: Ib0c53a890bb5deed5c679e887541a715faea91fc
|
d597d263bc32422402d4810ce4ec070f0227c2f7 |
|
06-May-2014 |
Dmitriy Ivanov <dimitry@google.com> |
Refactor linker allocator Makes it reusable for different fixed sized and not very big structures (<PAGE_SIZE). Change-Id: Id5ec13fc6541b1935ef7fe3671c22b98685abbae
|
6275f2083415d22a6ce0de55645079cd47e0cc80 |
|
12-May-2014 |
Dmitriy Ivanov <dimitry@google.com> |
Cleanup: updated comments Bug: 14566672 Change-Id: I49ad28e3914b7d559db1e98542fee919db768f49
|
b906e13c55c9fe9b4157ba548534a0230434882b |
|
12-May-2014 |
Dmitriy Ivanov <dimitry@google.com> |
Cleanup: remove AARCH/ARM_COPY relocation support They are only legal for ET_EXEC binaries and these are no longer supported. Bug: 14566672 Change-Id: I99e0ff47e8c572db474bc5e52df870a72269abb3
|
2aebf5429bb1241a3298b5b642d38f73124c2026 |
|
07-May-2014 |
Nick Kralevich <nnk@google.com> |
Remove support for non-PIE executables Don't support the dynamic linker loading ET_EXEC executables. Only support ET_DYN executables. Bug: 14566672 Change-Id: Ia1f2bfffe7ea867c1cd62e67d7fd637c60c0728d
|
5ca7ed9005ea16733d7c87d7154473b7a500be0c |
|
03-May-2014 |
Dmitriy Ivanov <dimitry@google.com> |
Disallow dlopen("egl/blah.so") on LP64 Change-Id: I9a563a9dada6522129b1890bc1292667230e80a5
|
0dcf06f976670b5d05286b184d150f61b71c1184 |
|
22-Apr-2014 |
Torne (Richard Coles) <torne@google.com> |
Fix arm64/x86 build. Add missing second param to soinfo_link_image in a section that's not compiled on ARM. Bug: 13005501 Change-Id: Id0ede8e03da4e05b25c0aeb24a840f868031d4e8
|
865119efd47ae3cae5a0c09c6a9cc184a10614c1 |
|
18-Apr-2014 |
Du Chenyang <chenyang.du@intel.com> |
Temporarily disable text relocation warnings for x86 libraries Too many such warnings will cause CTS failed. This issue still exists in some x86 version libraries: libdvm.so/libart.so. $scanelf -qT out/target/product/generic_x86/system/lib/libdvm.so libdvm.so: (memory/data?) [0x2BAC7] in (optimized out: previous dvmAsmInstructionStartCode) [0x2B2F8] libdvm.so: (memory/data?) [0x2BB98] in (optimized out: previous dvmAsmInstructionStartCode) [0x2B2F8] libdvm.so: (memory/data?) [0x2EB28] in (optimized out: previous dvmAsmInstructionStartCode) [0x2B2F8] libdvm.so: (memory/data?) [0x2EF87] in (optimized out: previous dvmAsmInstructionEndCode) [0x2EF63] libdvm.so: (memory/data?) [0x2EFAF] in (optimized out: previous dvmAsmInstructionEndCode) [0x2EF63] libdvm.so: (memory/data?) [0x2EFD7] in (optimized out: previous dvmAsmInstructionEndCode) [0x2EF63] libdvm.so: (memory/data?) [0x2EFFF] in (optimized out: previous dvmAsmInstructionEndCode) [0x2EF63] libdvm.so: (memory/data?) [0x2F027] in (optimized out: previous dvmAsmInstructionEndCode) [0x2EF63] Bug: https://code.google.com/p/android/issues/detail?id=68431 Change-Id: I11ecac282f1163e49a82156fce2a76cc2d619960
|
183ad9df536ab04ef35a397a1f4724e4e401d11f |
|
27-Feb-2014 |
Torne (Richard Coles) <torne@google.com> |
Allow sharing the RELRO section via a file. Add flags and a file descriptor to android_dlopen_ext() to allow writing the RELRO section of the loaded library to a file after relocation processing, and to allow mapping identical pages from the file over the top of relocated memory in another process. Explicitly comparing the pages is required in case a page contains a reference to a symbol defined in another library loaded at a random base address. Bug: 13005501 Change-Id: Ibb5b2d384edfaa5acf3e97a5f8b6115c10497a1e
|
12bbb9164578b6512b8b07a3fb093858244b7c7b |
|
06-Feb-2014 |
Torne (Richard Coles) <torne@google.com> |
Support loading libraries to a reserved address. Add flags and parameters to android_dlopen_ext() to allow loading a library at an already-reserved fixed address. If the library to be loaded will not fit within the space reserved, then the linker will either fail, or allocate its own address space as usual, according to which flag has been specified. This behaviour only applies to the specific library requested; any other libraries loaded as dependencies will be loaded in the normal fashion. There is a new gtest included to cover the functionality added. Bug: 13005501 Change-Id: I5d1810375b20fc51ba6a9b3191a25f9792c687f1
|
012cb4583a5f8564059142bb1900ea3a31e7cfa9 |
|
06-Feb-2014 |
Torne (Richard Coles) <torne@google.com> |
Add android_dlopen_ext() interface to linker. Add a function "android_dlopen_ext()", defined in <android/dlext.h>. This is an extended version of dlopen() which takes a struct for passing additional parameters for Android-specific functionality. This will be used to support RELRO section sharing between separate processes. Bug: 13005501 Change-Id: I9c99b2f2a02ee329dedaeba09ef3a1113b17b2d6
|
812fd4263a005b88f3b4222baa910114f938d594 |
|
25-Mar-2014 |
Kito Cheng <kito@0xlab.org> |
Use __unused instead of UNUSED in linker.cpp - sys/cdefs.h already define __unused, just use it instead of define a local one. Change-Id: Iacf3da9193e65e1f34b12760b28bcb64b67cb790
|
006f9ad8910c945cd50e54f6c34d8c27b11c1193 |
|
19-Feb-2014 |
Benjamin Adolphi <b.adolphi@gmail.com> |
Linker writes to wrong memory location when processing DT_MIPS_RLD_MAP When bionic's dynamic linker processes the .dynamic section of a MIPS ELF binary and encounters the DT_MIPS_RLD_MAP dynamic array tag, it calculates the address of where to write a pointer to the _r_debug structure. The current implementation simply reads the value given in the d_ptr field and writes the pointer address to that location. However, this value has to be adjusted to reflect the real load address of the binary. Otherwise the linker will write to a faulty location possibly resulting in a crash when linking a MIPS binary that includes DT_MIPS_RLD_MAP. This change corrects that problem. Change-Id: I1a91874f7ab47289001fe72d9016660c14c70362 Signed-off-by: Benjamin Adolphi <b.adolphi@gmail.com>
|
c62b8a4d3f73b070099d9aa594a261b5250d6cc9 |
|
13-Feb-2014 |
Elliott Hughes <enh@google.com> |
Remove unused variables not spotted by GCC. Change-Id: I49a16096bc0f41f3ad0007249161e8bdfcf3438c
|
faf05bacd45719291b371f24b1b89543881b37f6 |
|
12-Feb-2014 |
Elliott Hughes <enh@google.com> |
Clean up all the lint cpplint can find in the dynamic linker. Change-Id: Ic9ee7153817c22a252cc4b309283e355b623cab9
|
9918665a45095ad135576f005c0e5307feb366a1 |
|
07-Feb-2014 |
Chris Dearman <chris.dearman@imgtec.com> |
[MIPS64] Dynamic linker Change-Id: I937c7c776cae3d66e214798d5217a922cd106bfc Signed-off-by: Chris Dearman <chris.dearman@imgtec.com> Signed-off-by: Duane Sand <duane.sand@imgtec.com>
|
0266ae5f884d72da58f33a072e865ba131234a5e |
|
11-Feb-2014 |
Elliott Hughes <enh@google.com> |
Switch <elf.h> over to linux uapi under the covers. Remove the linker's reliance on BSD cruft and use the glibc-style ElfW macro. (Other code too, but the linker contains the majority of the code that needs to work for Elf32 and Elf64.) All platforms need dl_iterate_phdr_static, so it doesn't make sense to have that part of the per-architecture configuration. Bug: 12476126 Change-Id: I1d7f918f1303a392794a6cd8b3512ff56bd6e487
|
3a9c5d66dc8d41272f51482b713717af7049697e |
|
10-Feb-2014 |
Elliott Hughes <enh@google.com> |
Fix <link.h>. Also move some of the stuff that should be in <link.h> out of the private "linker.h", to make it clearer that these are public API known to gdb that we can't change. Bug: 12554197 Change-Id: I830e1260d3d8b833ed99bc1518f1c6b6102be8af
|
5ceb889ac9a36e74e4e00c34c57cbb58d73e228c |
|
03-Dec-2013 |
Weiwu Chen <weiwu.chen@intel.com> |
bionic: Change the type of soinfo's size to size_t Some system functions like munmap expect soinfo's size to be size_t, but currently it is unsigned. Change it to size_t to fit 64bit's portability. Change-Id: I0bf6d522b38b0cd9bf1db05b004b5326217412a2 Signed-off-by: Weiwu Chen <weiwu.chen@intel.com> Signed-off-by: Qiming Shi <qiming.shi@intel.com>
|
a4aafd156068ee174012f28cd894dbecf0e4ab90 |
|
14-Jan-2014 |
Elliott Hughes <enh@google.com> |
Make it possible for code to query the dynamic linker's default search path. We're not going to have init(1) set LD_LIBRARY_PATH globally on 64-bit. This patch makes it possible for libnativehelper to set LD_LIBRARY_PATH in each Java VM (to support System.loadLibrary) without also hard-coding the default search path there. Change-Id: If13961fae976e06dd80d5ef522f31e8b7eb01154
|
b93702a0463fa0b87bf25d7ae9bdb09a35ea6a50 |
|
22-Dec-2013 |
Elliott Hughes <enh@google.com> |
Improve dynamic linker diagnostics for internal errors. If the linker can't resolve its own internal references to symbols, we currently exit silently (albeit with EXIT_FAILURE). Not very helpful. Change-Id: I1614fc970dee4560b38832ede1987b65a8e53a1e
|
e365f9d6543bc6607864ef61257505239dde15d1 |
|
10-Oct-2013 |
Marcus Oakland <marcus.oakland@arm.com> |
AArch64: Linker64 support for AArch64 Addition of support for AArch64 in the linker64 target. Change-Id: I8dfd9711278f6706063e91f626b6007ea7a3dd6e Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>
|
5407eed84b98056a5af7d95007d8d511ebad60e4 |
|
09-Dec-2013 |
Pavel Chupin <pavel.v.chupin@intel.com> |
Fix debugging issues in vdso handling Under valgrind ehdr_vdso is null and causing segfault. Adding debug info for vdso producing plenty of issues on debugging through gdbserver, removing it. It doesn't seem it should be here. Unwinding through vdso test still works. Change-Id: I1a7e233c493f2268d725fa8d7279822d07decc49 Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
|
ebd506c69e12b6dcaf5be94cc8ed1b53af299f9f |
|
31-Oct-2013 |
Sergey Melnikov <sergey.melnikov@intel.com> |
Fix linker crashes during unknown symbol lookup Integration of kernel VDSO into internal bionic data structures using common functions. Fix for dl_iterate_phdr function: the function provides incorrect address of object in case of nonzero virtual and base addresses. Location in address space of a particular program header should be calculated using the formula: addr = base_addr + virtual_addr. Signed-off-by: Sergey Melnikov <sergey.melnikov@intel.com> Change-Id: Ie2ab4257fd456242aab8afed0bd5bd6b29e81d6d
|
e4d792adb8d6f9228b9ac9dc1ad7f43b271f085f |
|
28-Oct-2013 |
Elliott Hughes <enh@google.com> |
Don't allow text relocations on 64-bit. I've also updated our <sys/exec_elf.h> to match upstream. Change-Id: I52f9fce3167541811208d273ff23ceaa112f7135
|
4eeb1f12a8b63afc0d0ad4d466b16fbffb21cd5a |
|
26-Oct-2013 |
Elliott Hughes <enh@google.com> |
Clean up linker architecture macros. We don't need our own architecture macros; the standard ones will do. This patch also fixes some __x86_64__ tests to be USE_RELA tests instead, because they're not actually x86_64-specific. I've cleaned up architecture-specific code slightly so where possible all the code corresponding to a particular architecture is together. This patch also fixes a bug in LP64 DT_PLTGOT handling, which should be an error rather than falling through into DT_DEBUG! There was another #ifdef bug where we'd only report unexpected DT_ entries on MIPS. Change-Id: Id1d04e372611f641c1aa278a18e379f28af9eaf5
|
b8b0b6b412267e514c99a6d3636aefa3c7715673 |
|
25-Oct-2013 |
Elliott Hughes <enh@google.com> |
Revert "Don't warn about x86 text relocations. They're too prevalent." This reverts commit 5be2c5998c996ff9d5efb94c127d9b832a295822. Change-Id: I3fc8ca530cdbd74c834fb9cfabe812c9386419fc
|
5be2c5998c996ff9d5efb94c127d9b832a295822 |
|
23-Oct-2013 |
Elliott Hughes <enh@google.com> |
Don't warn about x86 text relocations. They're too prevalent. We should fix this (and disallow it for x86_64), but for now let's get CTS running again. libdvm.so and libcutils.so are the main problems. $ scanelf -qT out/target/product/generic_x86/symbols/system/lib/libcutils.so libcutils.so: (memory/data?) [0x4125] in (optimized out: previous android_memset16) [0x4100] libcutils.so: (memory/data?) [0x424F] in (optimized out: previous android_memset16) [0x4100] libcutils.so: (memory/data?) [0x42F8] in (optimized out: previous android_memset16) [0x4100] libcutils.so: (memory/data?) [0x4349] in (optimized out: previous android_memset16) [0x4100] libcutils.so: (memory/data?) [0x4406] in (optimized out: previous android_memset16) [0x4100] libcutils.so: (memory/data?) [0x45AC] in (optimized out: previous android_memset32) [0x4590] libcutils.so: (memory/data?) [0x4650] in (optimized out: previous android_memset32) [0x4590] libcutils.so: (memory/data?) [0x46F9] in (optimized out: previous android_memset32) [0x4590] libcutils.so: (memory/data?) [0x474A] in (optimized out: previous android_memset32) [0x4590] libcutils.so: (memory/data?) [0x4807] in (optimized out: previous android_memset32) [0x4590] Bug: 11353056 Change-Id: Id4a76b310be7fe858a8a60d0d260b09913b66be9
|
3d4470c14a57b0b9ae74060370be53469e95d6a1 |
|
22-Oct-2013 |
Nick Kralevich <nnk@google.com> |
change wording on text relocation message. The current message is too alarmist. Change-Id: I53e8eadca239f867b4e6b9c193eba96e267950c3
|
c075c18537d18ccb6760ba1f5727ce2c0890285a |
|
16-Oct-2013 |
Pavel Chupin <pavel.v.chupin@intel.com> |
x86_64: Add R_X86_64_64 relocation handling Change-Id: I86ffc56fa6a9053bed44e92a579530c2beb8eb2c Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
|
1a57f9f75c5752d990a2749b000ec4ceace94b54 |
|
06-Feb-2013 |
Pavel Chupin <pavel.v.chupin@intel.com> |
x86_64: Rename 64-bit linker to linker64 That's for having both on the same system. Change-Id: Ic2bc2c015e6486e8b6a7576f7b28d2d027534368 Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
|
eb847bc8666842a3cfc9c06e8458ad1abebebaf0 |
|
10-Oct-2013 |
Elliott Hughes <enh@google.com> |
Fix x86_64 build, clean up intermediate libraries. The x86_64 build was failing because clone.S had a call to __thread_entry which was being added to a different intermediate .a on the way to making libc.so, and the linker couldn't guarantee statically that such a relocation would be possible. ld: error: out/target/product/generic_x86_64/obj/STATIC_LIBRARIES/libc_common_intermediates/libc_common.a(clone.o): requires dynamic R_X86_64_PC32 reloc against '__thread_entry' which may overflow at runtime; recompile with -fPIC This patch addresses that by ensuring that the caller and callee end up in the same intermediate .a. While I'm here, I've tried to clean up some of the mess that led to this situation too. In particular, this removes libc/private/ from the default include path (except for the DNS code), and splits out the DNS code into its own library (since it's a weird special case of upstream NetBSD code that's diverged so heavily it's unlikely ever to get back in sync). There's more cleanup of the DNS situation possible, but this is definitely a step in the right direction, and it's more than enough to get x86_64 building cleanly. Change-Id: I00425a7245b7a2573df16cc38798187d0729e7c4
|
011bc0ba45a8b7766a205cb21269dbafb32294b6 |
|
08-Oct-2013 |
Elliott Hughes <enh@google.com> |
Use /system/lib64 and /vendor/lib64 for 64-bit libraries. Change-Id: I4886aeb3070bf97b4cfe8053388ecb1bda288017
|
c00f2cb587630d5e954c7f548749f1e3170b3cb1 |
|
05-Oct-2013 |
Elliott Hughes <enh@google.com> |
x86_64 linker. Based on I8dc3e2cb596f75dc58ae82e4dc58f8c177dd3323 by Pavel Chupin <pavel.v.chupin@intel.com>. Change-Id: Icd582d277cbe273477b450f2848343d72c86ec9f
|
c620059479c47a78d57086d73726c9adc2f337ad |
|
01-Oct-2013 |
Elliott Hughes <enh@google.com> |
Remove 32-bit assumptions from the ELF code. Change-Id: I2c1f3d34c33685799aade8866eec44479ff9f963
|
24053a461e7a20f34002262c1bb122023134989d |
|
20-Aug-2013 |
Christopher Ferris <cferris@google.com> |
Add the dl_iterate_phdr function to libdl for arm. Bug: 8410085 Merge from internal master. (cherry-picked from cb491bc66dc0abc145930b09086eb9189a30f6c2) Change-Id: I94ed51bc5d4c626df7552c0e85c31ccee2d6568f
|
cb491bc66dc0abc145930b09086eb9189a30f6c2 |
|
20-Aug-2013 |
Christopher Ferris <cferris@google.com> |
Add the dl_iterate_phdr function to libdl for arm. Bug: 8410085 Change-Id: I94ed51bc5d4c626df7552c0e85c31ccee2d6568f
|
9ef1fbb644bf85fa211588853316efa4848547c6 |
|
21-Aug-2013 |
Brian Carlstrom <bdc@google.com> |
Make mips_relocate_got tolerate a missing got Bug: 10094803 (cherry picked from commit 7ee26878065abb494600595349ce58b2b2db3709) Change-Id: I9fbb65d20011f2f625fde3b15ac8c6887dd03ae4
|
87c358524e479235aa6241736d2ce325f89daafc |
|
21-Aug-2013 |
Brian Carlstrom <bdc@google.com> |
Make mips_relocate_got tolerate a missing got Bug: 10094803 (cherry picked from commit 7ee26878065abb494600595349ce58b2b2db3709) Change-Id: Ib15bccecaee421dc463d46a3956b054051708759
|
c45087bffa528c0809f0df2e0a3708eba7018b33 |
|
25-Jan-2013 |
Sergey Melnikov <sergey.melnikov@intel.com> |
Kernel dso support for 'dl_iterate_phdr' function Kernel provides virtual DSO for stack unwinding/exception handlind info for signal usage case. Stack unwinding routines use 'dl_iterate_phdr' function for additional DWARF info gathering from DSOs. Patch enables virtual DSO enumeration via dl_iterate_phdr function. Signed-off-by: Sergey Melnikov <sergey.melnikov@intel.com> Change-Id: Ic2882b28f40b456a088bc1e63c50cbfda7e4a102
|
c9084427aa15259c8bfb9b13b979597a4abd1805 |
|
21-Jun-2013 |
Nick Kralevich <nnk@google.com> |
linker: Emit a warning on text relocations Text relocations unnecessarily mark pages as dirty, preventing them from being swapped out, wasting memory. Also, text relocations prevent the code from running on certain hardened systems. Print a message in logcat and stderr when we see a text relocation, to encourage developers to fix their code. Change-Id: I6051a7463911e090ae5727a355397d539669d5b9
|
7e5a8cc5230dcc027686813e51a1b001cee4c602 |
|
18-Jun-2013 |
Elliott Hughes <enh@google.com> |
Make LD_PRELOAD failures just warnings. This matches glibc and makes life easier for developers who want to sometimes preload a library from init (which has no conditionals); they can simply move/remove the library to disable. Change-Id: I579b8633f958235af6e46bb53b378b9e363afb1f
|
6bec5b792a5f034089a942cb28cab26d36408235 |
|
04-Jun-2013 |
Christopher Ferris <cferris@google.com> |
Small cleanup of soinfo_elf_lookup. - Remove unnecessary line. - Move declarations to first use. Change-Id: I1d8398d6c13f7cb86bffe0b68af849e35a4b234d
|
738370d9387396922c10910edb61272e585be107 |
|
09-May-2013 |
Elliott Hughes <enh@google.com> |
Don't fail to run DT_INIT and DT_INIT_ARRAY constructors if a shared library has DT_PREINIT_ARRAY constructors. The GNU dynamic linker silently ignores a DT_PREINIT_ARRAY section in a shared library. We had ineffectual code that tried to report an error, which I tried to fix but got wrong --- my version still wouldn't report the error to the caller, but would prevent us from continuing to call constructors. Bug: 8825226 (cherry picked from commit 8147d3c284932896ab6095232b355979b9eb33d3) Change-Id: Iad8e7e3743d1a5e6bd1d44ef40b1ab3499cb64f2
|
8147d3c284932896ab6095232b355979b9eb33d3 |
|
09-May-2013 |
Elliott Hughes <enh@google.com> |
Don't fail to run DT_INIT and DT_INIT_ARRAY constructors if a shared library has DT_PREINIT_ARRAY constructors. The GNU dynamic linker silently ignores a DT_PREINIT_ARRAY section in a shared library. We had ineffectual code that tried to report an error, which I tried to fix but got wrong --- my version still wouldn't report the error to the caller, but would prevent us from continuing to call constructors. Bug: 8825226 Change-Id: I4fd8450ecc44d8767a1cb808aeecfbfbfc77c070
|
8d3e91d4f842911366155845afb3cfbdad0b4cad |
|
25-Apr-2013 |
Nick Kralevich <nnk@google.com> |
linker: only re-open std* for setuid programs. get_AT_SECURE() was getting called before linker_env_init() had been called, and returning the default value ("true"). This was causing us to reopen closed stdin, stdout, and stderr for ALL processes, not just privileged (setuid) processes. Calling path: - __linker_init - soinfo_link_image - get_AT_SECURE - __linker_init_post_relocation - linker_env_init This change restores the intended behavior of only re-opening stdin, stdout, and stderr for privileged processes. Change-Id: I8b085ea6597710ac4c1a3c93f1bf8b81eecb08c0
|
7b4d77e400d321ccc7cdadd1cd225ebb1a69d358 |
|
04-Apr-2013 |
Elliott Hughes <enh@google.com> |
Make abort messages available to debuggerd. This adds __libc_fatal, cleans up the internal logging code a bit more, and switches suitable callers over to __libc_fatal. In addition to logging, __libc_fatal stashes the message somewhere that the debuggerd signal handler can find it before calling abort. In the debuggerd signal handler, we pass this address to debuggerd so that it can come back with ptrace to read the message and present it to the user. Bug: 8531731 (cherry picked from commit 0d787c1fa18c6a1f29ef9840e28a68cf077be1de) Change-Id: I5daeeaa36c1fc23f7f437d73a19808d9d558dd4d
|
0d787c1fa18c6a1f29ef9840e28a68cf077be1de |
|
04-Apr-2013 |
Elliott Hughes <enh@google.com> |
Make abort messages available to debuggerd. This adds __libc_fatal, cleans up the internal logging code a bit more, and switches suitable callers over to __libc_fatal. In addition to logging, __libc_fatal stashes the message somewhere that the debuggerd signal handler can find it before calling abort. In the debuggerd signal handler, we pass this address to debuggerd so that it can come back with ptrace to read the message and present it to the user. Bug: 8531731 Change-Id: I416ec1da38a8a1b0d0a582ccd7c8aaa681ed4a29
|
8f7120bbacb0bb7a8aca1102f76f64a462f40231 |
|
22-Mar-2013 |
Kito Cheng <kito@0xlab.org> |
Drop unnecessary execution permission for .cpp/.c/.h Change-Id: I9ac2b9d8f6bdb4fab8962210c5ec8f9c3e8c0ebf
|
8f2a5a0b40fc82126c691d5c30131d908772aab7 |
|
15-Mar-2013 |
Elliott Hughes <enh@google.com> |
Clean up internal libc logging. We only need one logging API, and I prefer the one that does no allocation and is thus safe to use in any context. Also use O_CLOEXEC when opening the /dev/log files. Move everything logging-related into one header file. Change-Id: Ic1e3ea8e9b910dc29df351bff6c0aa4db26fbb58
|
ca0c11bd823f37f03cc8067cb182876827d5275a |
|
12-Mar-2013 |
Elliott Hughes <enh@google.com> |
Use more types than just 'unsigned' in the linker. Still chipping away at the situation where every variable in the linker was of type 'unsigned'. This patch switches counts over to being size_t and adds an explicit type for init/fini function pointers and arrays of function pointers. Also improve logging from CallArray. Also remove trailing "\n"s from log messages. Change-Id: Ie036d2622caac50f4d29f0570888bb527661d77e
|
fa8c05dc00bb41ae8fe5cb5e4f82816e30f7f7b2 |
|
12-Mar-2013 |
Kito Cheng <kito@0xlab.org> |
Use Elf32_Addr instead of unsigned in linker Change-Id: I52dcbb4b0ff0a4052e0ad7a9bbeb2df65c9d2f66
|
2d4b9b7cff78b9a378d7fc0f28c702dc43002020 |
|
07-Mar-2013 |
Brian Carlstrom <bdc@google.com> |
Fix typo of DT_NEEDED for DT_NULL (cherry-pick of 138b205ea9efc117fe522c2d7191378023a6e2cd) Change-Id: Ia895cb3018df55554627f1f61dcdfdada4a961ce
|
5e2492eb89b778ee71e37e7406fe290d986ece70 |
|
06-Mar-2013 |
Kito Cheng <kito@0xlab.org> |
Fix TIMING/STATS/COUNT_PAGES dynamic linker build Change-Id: I6432ac378816da253b83d1c7fb1d3fb64647b89e
|
43cc7f795b48e9c13a54e15af829369805f11652 |
|
06-Mar-2013 |
Brian Carlstrom <bdc@google.com> |
Fix MIPS linker build (cherry-picked from 8c7d8c2057e303985f78eab96da747ddaa013c78) Change-Id: Idcf62ab95f8fccbc2d7c3e771a4cfbe768a1555e
|
650be4e584eeab3591b9e273bfd6d169eea60853 |
|
06-Mar-2013 |
Elliott Hughes <enh@google.com> |
More linker cleanup. Change-Id: I9fb3c7c0d4b4ffef0eeaf092d4e30ffe63a08671
|
d4ee82dfa3ba01baa10e3ca48fcb31a27b8a4e81 |
|
01-Mar-2013 |
Brian Carlstrom <bdc@google.com> |
Minor linker cleanup, primarily to use Elf32_Dyn Change-Id: Ifa9408e9859c6f79444715bed4808b7c13fdced5
|
d3920b3a996b358e48232f417aa0a1e44a60f155 |
|
08-Feb-2013 |
Elliott Hughes <enh@google.com> |
Switch to using AT_RANDOM for the stack guards. Bug: 7959813 Change-Id: I8db4b8912ba649bfe668c6f22aa44690ddd401a2
|
42b2c6a5eed5e4ef35315b8cd32d1355f12a69b6 |
|
07-Feb-2013 |
Elliott Hughes <enh@google.com> |
Clean up the argc/argv/envp/auxv handling. There's now only one place where we deal with this stuff, it only needs to be parsed once by the dynamic linker (rather than by each recipient), and it's now easier for us to get hold of auxv data early on. Change-Id: I6314224257c736547aac2e2a650e66f2ea53bef5
|
d2b1a7311f023a1c532b5b418fc4bc7bd835be34 |
|
06-Feb-2013 |
Elliott Hughes <enh@google.com> |
Remove partial implementation of MIPS non-PIC support. Change-Id: I3c287e52aae10559508174e73113367aea40e5c2
|
1e980b6bc8315d00a07312b25486531247abd98c |
|
18-Jan-2013 |
Elliott Hughes <enh@google.com> |
Fix the duplication in the debugging code. We had two copies of the backtrace code, and two copies of the libcorkscrew /proc/pid/maps code. This patch gets us down to one. We also had hacks so we could log in the malloc debugging code. This patch pulls the non-allocating "printf" code out of the dynamic linker so everyone can share. This patch also makes the leak diagnostics easier to read, and makes it possible to paste them directly into the 'stack' tool (by using relative PCs). This patch also fixes the stdio standard stream leak that was causing a leak warning every time tf_daemon ran. Bug: 7291287 Change-Id: I66e4083ac2c5606c8d2737cb45c8ac8a32c7cfe8
|
36bd371e26c716cbc18e11801b13eff0352d91b0 |
|
16-Jan-2013 |
Nick Kralevich <nnk@google.com> |
Revert "stack protector: use AT_RANDOM" The AT_RANDOM changes broke setuid / setgid executables such as "ping". When the linker executes a setuid program, it cleans the environment, removing any invalid environment entries, and adding "NULL"s to the end of the environment array for each removed variable. Later on, we try to determine the location of the aux environment variable, and get tripped up by these extra NULLs. Reverting this patch will get setuid executables working again, but getauxval() is still broken for setuid programs because of this bug. This reverts commit e3a49a8661125f24aec8a1453e54b3b78005e21e. Change-Id: I05c58a896b1fe32cfb5d95d43b096045cda0aa4a
|
e3a49a8661125f24aec8a1453e54b3b78005e21e |
|
14-Jan-2013 |
Nick Kralevich <nnk@google.com> |
stack protector: use AT_RANDOM Populate the stack canaries from the kernel supplied AT_RANDOM value, which doesn't involve any system calls. This is slightly faster (6 fewer syscalls) and avoids unnecessarily reading /dev/urandom, which depletes entropy. Bug: 7959813 Change-Id: If2b43100a2a9929666df3de56b6139fed969e0f1
|
99c32055cb50443f722c55914869c1f6bb941959 |
|
14-Jan-2013 |
Elliott Hughes <enh@google.com> |
Fix my git mistake. This was the formatting change that was supposed to be in cf23905a4bcc7bfdd109be5b6d69ad06877aa217. Change-Id: Ib79fa031b68f6f541f532507eb589afeaedb831f
|
cf23905a4bcc7bfdd109be5b6d69ad06877aa217 |
|
12-Jan-2013 |
Chris Dearman <chris@mips.com> |
[MIPS] Set DT_DEBUG dyntab entry if it is writable This is primarily for MIPS exutables that do not have a DT_MIPS_RLD_MAP entry. Change-Id: I4c221d92debcfed961eeee2515123f3fb21ec8e6 Signed-off-by: Chris Dearman <chris@mips.com>
|
db492b3ca753c4ef688d0daf648294de0c89145e |
|
04-Jan-2013 |
Elliott Hughes <enh@google.com> |
Fix debug malloc. ...which has been broken since the linker data structures went read-only. Bug: 7941716 Change-Id: If28f6bac0fcb13e371e4d85b064544f561c8d692
|
cade4c36e7c9c62db3f476a0f9cfc329bac9acb7 |
|
20-Dec-2012 |
Elliott Hughes <enh@google.com> |
Support System.loadLibrary for libraries with transitive dependencies. Also fix the FLAG_ERROR annoyance --- it's not helpful to cache failures. Bug: 7896159 Bug: http://code.google.com/p/android/issues/detail?id=34416 Bug: http://code.google.com/p/android/issues/detail?id=22143 Change-Id: I60f235edb4ea4756e1f7ce56f7739f18e8a50789
|
e66190d2a97a713ae4b4786e60ca3d67ab8aa192 |
|
19-Dec-2012 |
Elliott Hughes <enh@google.com> |
Check for unknown flags passed to dlopen(3). Change-Id: I56f4aab0e5a1487bc32d2c4d231e8bd15c4ac8da
|
20a24403bc333cd92996cd43cef2e6a79c72d055 |
|
31-Oct-2012 |
Chris Dearman <chris@mips.com> |
Do not include '\0' when writing error messages to stderr Change-Id: I6adc806c3920e5a4ae61ca55c40613fcf338b18c Signed-off-by: Chris Dearman <chris@mips.com>
|
c5db969aa4a24a76fc0964f2ff89533e832b47a6 |
|
15-Nov-2012 |
Chao-Ying Fu <fu@mips.com> |
We should use load_bias. This patch fixes MIPS NDK device exception test failures. Change-Id: I4b718c36666e66062c1f13e4deea1ec7a7951c54
|
9c94fc9fbefe55836c1e1b949850f7726e64c118 |
|
05-Nov-2012 |
Elliott Hughes <enh@google.com> |
Tone down some of the overly-verbose linker logging. We don't need to see every dlopen(3)/dlsym(3) failure unless LD_DEBUG is on. Change-Id: I1edfe8b72f32ff54dd30e1acf32e20d470d5e9f7
|
61a9ccb41eba8c35cae6e21318aca7160a402c5b |
|
02-Nov-2012 |
Elliott Hughes <enh@google.com> |
Make dynamic linker debugging always available. If you need to build your own linker to get debugging, the debugging is never available when you need it. Change-Id: I5ff7e55753459d49a2990f25d9aa155e0b8602e0
|
c77c434149959e135ba21d1dd8a78a408fef2489 |
|
31-Oct-2012 |
Pavel Chupin <pavel.v.chupin@intel.com> |
Adjust symbol lookup for DT_SYMBOLIC case According ELF spec re. DT_SYMBOLIC: This element's presence in a shared object library alters the dynamic linker's symbol resolution algorithm for references within the library. Instead of starting a symbol search with the executable file, the dynamic linker starts from the shared object itself. If the shared object fails to supply the referenced symbol, the dynamic linker then searches the executable file and other shared objects as usual. This change implements the last part. Change-Id: Iae95d53d455313a4306f11733941bcd3596ac85f Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
|
6971fe4ca52ebdaa85ba676a044412b01d2ef1bf |
|
02-Nov-2012 |
Elliott Hughes <enh@google.com> |
Allow dlopen("egl/blah.so"). NVIDIA binary blobs construct strings to pass to dlopen(3) that contain '/' but require that we fall back to LD_LIBRARY_PATH. Change-Id: Iad831899986baace6962f4b335eeb288250a1e22
|
d23736e4f228e46304b7cbc674a1d0094d73e0f5 |
|
01-Nov-2012 |
Elliott Hughes <enh@google.com> |
Keep the dynamic linker's soinfo pools mostly read-only. We'll need a lot more refactoring of this code before we can reduce the granularity, but this is a step forward. Change-Id: I07061720e734b571a8399c1d5b4f2f35cd681307
|
1a6961650c82168864afe040dbdc05977db701df |
|
01-Nov-2012 |
Elliott Hughes <enh@google.com> |
Stop defining our own PAGE_SIZE and PAGE_MASK, and test dlclose(3) too. Also remove an unnecessary #include and a now-obsolete TODO. Change-Id: I36d923721e349a286934b9534090a67ce0786e7b
|
ba98d9237b0eabc1d8caf2600fd787b988645249 |
|
12-Sep-2012 |
Magnus Malmborn <magnus.malmborn@sonymobile.com> |
Dynamically allocate soinfo-structs in linker Request memory from the system when needed instead of having a fixed array for soinfo structs. Note that malloc() et al can't be used in linker, so use mmap() instead. Change-Id: I4b495995931d7752b0e8c944e64d1fe41b9f7144
|
124fae9eabd7a25d80dfa8c3b56bed0f0fba16f1 |
|
31-Oct-2012 |
Elliott Hughes <enh@google.com> |
Reject .so files with no sysv hash table. Also ensure that dlopen(3) errors always include the name of the library we failed to open. Also fix a bug where we'd fall back to searching LD_LIBRARY_PATH and the built-in paths for names that include slashes. Bug: http://code.google.com/p/android/issues/detail?id=38479 Change-Id: Ib2c009ed083344a7a012749d58f8679db2f26c78
|
5ae44f302b7d1d19f25c4c6f125e32dc369961d9 |
|
30-Aug-2012 |
Ard Biesheuvel <ard.biesheuvel@gmail.com> |
linker: handle R_ARM_COPY relocations in a proper way If an executable contain copy relocations, other references to the symbol it points to should be preempted and made to point to the copy instead. Also, the linker should make sure the target area has sufficient space to contain the copy. It also checks whether the library that supplies the symbol is built with -Bsymbolic, and errors out if this is the case. Change-Id: If135c83590092741cfd8f82f54816f363a4a4a3b Signed-off-by: Ard Biesheuvel <ard.biesheuvel@gmail.com>
|
18a206c81d9743481e364384affd43306911283d |
|
30-Oct-2012 |
Elliott Hughes <enh@google.com> |
More dynamic linker cleanup. I still want to break linker_format out into its own library so we can reuse it for malloc debugging and so forth. (There are many similar pieces of code in bionic, but the linker's one seems to be the most complete/functional.) Change-Id: If3721853d28937c8e821ca1d23cf200e228a409a
|
5419b9474753d25dff947c7740532f86d130c0be |
|
17-Oct-2012 |
Elliott Hughes <enh@google.com> |
Make dlerror(3) thread-safe. I gave up trying to use the usual thread-local buffer idiom; calls to calloc(3) and free(3) from any of the "dl" functions -- which live in the dynamic linker -- end up resolving to the dynamic linker's stubs. I tried to work around that, but was just making things more complicated. This alternative costs us a well-known TLS slot (instead of the dynamically-allocated TLS slot we'd have used otherwise, so no difference there), plus an extra buffer inside every pthread_internal_t. Bug: 5404023 Change-Id: Ie9614edd05b6d1eeaf7bf9172792d616c6361767
|
3b297c40794b23d50cb5240f9b03f6ef25fd98db |
|
12-Oct-2012 |
Elliott Hughes <enh@google.com> |
Fix dlerror(3). Add unit tests for dlerror(3) in various situations. I think We're at least as good as glibc now. Also factor out the ScopedPthreadMutexLock and use it here too. Bug: http://code.google.com/p/android/issues/detail?id=38398 Change-Id: I040938b4366ab836e3df46d1d8055b92f4ea6ed8
|
9c3449ecd9d5e9cdb1e995e35e53334a4a288a5e |
|
13-Sep-2012 |
Xiaokang Qin <xiaokang.qin@intel.com> |
bionic: linker: Need update the map->l_addr for execution. Currently, linker doesn't update the map->l_addr for execution. Which could break the Unwind_Backtrace with PT_GNU_EH_FRAME enabled in new toolchain. Change-Id: Ifbd853134da64a962f7e4c4105e56a3f20def1b2 Author: Fengwei Yin <fengwei.yin@intel.com> Signed-off-by: Jack Ren <jack.ren@intel.com> Author-tracking-BZ: 57077
|
e9b6fc6f82276188404a2839e31a2f4c19f6c336 |
|
29-Aug-2012 |
Elliott Hughes <enh@google.com> |
Improve the dynamic linker diagnostics. Lose the pid, only show the name of the function (not its whole signature), and include the name of the library we failed to load. (I hadn't noticed that the library name was missing before because in Java we add that into the UnsatisfiedLinkError detail message.) The new output looks like this: Cannot load library: soinfo_relocate(linker.cpp:968): cannot locate symbol "__libc_malloc_default_dispatch" referenced by "libc_malloc_debug_leak.so"... Change-Id: I3bb5c9780d9aaf3a9e4418ea55bc98122a81f80f
|
d39c3abd5ad8600fb1d79a0b95a58197197087e0 |
|
24-Aug-2012 |
Nick Kralevich <nnk@google.com> |
linker: Fix ARM_R_COPY relocations Per http://infocenter.arm.com/help/topic/com.arm.doc.ihi0044d/IHI0044D_aaelf.pdf Section 4.7.1.10, ARM_R_COPY relocations are only suppose to reference shared libraries, not the executable itself. When resolving an R_ARM_COPY symbol, ensure we don't look in our own symbol. This partially addresses http://code.google.com/p/android/issues/detail?id=28598 . After this patch, the printfs generated by the test program are: global = 0x42 (0x401c7000) global = 0x42 (0x11000) before, the output was: global = 0x42 (0x40071000) global = 0x0 (0x11000) I'm still not very happy with this patch, but I think it's an improvement over where we were at before. This change was modeled after https://android-review.googlesource.com/38871 Change-Id: Id7ad921e58395e76a36875bcc742ec5eeba53f08
|
bedfe38b8ba512dd6236c00e8b4a9b01c2bd1281 |
|
14-Aug-2012 |
Elliott Hughes <enh@google.com> |
More cleanup. Make more stuff static, remove some dead code, and fix a few typos. Change-Id: I010b0eadeaf61e2899c37014ad1e7082c70bd510
|
12c78bbded8ec03f821dfa09174464c04836e4ea |
|
14-Aug-2012 |
Ard Biesheuvel <ard.biesheuvel@gmail.com> |
linker: avoid clobbering the .dynamic section of shared libs This patch removes the DT_NEEDED hack which stores pointers to soinfo structs in the .dynamic section of the library being loaded. Instead, it caches the soinfo struct pointers on the stack during relocation time. After relocation time, i.e. when calling constructors and destructors of the shared library and its dependencies, uncached access is used instead, doing lookups using the string table entries pointed to by the DT_NEEDED entries. By removing this hack, it is no longer needed to undo the PT_GNURELRO protection, i.e., all non-writable mappings can remain non-writable during their entire lifespan. Even though, strictly speaking, the algorithmic complexity has increased somewhat, the real-world adverse effect is negligible on the systems I have tested. Change-Id: I2361502560b96b5878f7f94a8e8a215350d70d64 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@gmail.com>
|
9181a5dcfe69199415c7aebf93524cc3dd6f8a6f |
|
13-Aug-2012 |
Evgeniy Stepanov <eugenis@google.com> |
Fix module constructor order. .preinit_array goes before the constructors of LD_PRELOAD-ed libraries. Change-Id: I1af32ce29eaf3ca4351ae8a0f7f5da5165853216
|
5135b3ae6ebc460418f7917bd36b368340e48d5a |
|
11-Aug-2012 |
Nick Kralevich <nnk@google.com> |
linker: don't perform unnecessary mprotects The linker only needs to mark the text segment as writable iff the file has text relocations. Unnecessarily calling mprotect when it isn't necessary is slow, and some security enhanced kernels don't like it. Pages which are simultaneously writable and executable are considered a no-no. The vast majority of executables / shared libraries on Android do NOT have text relocations. Change-Id: Ic38ce30a99b7e33ecf21efd9c108547a58eafa35
|
06f0e74a2b957db93fed3fdd49fe939ab2fe1595 |
|
11-Aug-2012 |
Ben Cheng <bccheng@google.com> |
Set the dynamic field in the link map for the linker itself. Otherwise gdb will print a spurious warning each time gdb is used: warning: .dynamic section for "/system/bin/linker" is not at the expected address (wrong library or version mismatch?) BUG:6946614 Change-Id: Ib21b8db0615751189c1601140deb43bc089289b6
|
4688279db5dcc4004941e7f133c4a1c3617d842c |
|
04-Aug-2012 |
Elliott Hughes <enh@google.com> |
Clean up the linker a bit, remove prelinking support. Also make the errors more readable, since none of us seemed to know what they actually meant. The new style is still as verbose as the old, but that's probably necessary in the absence of chained exceptions in C. Here's what you'd see if you try to boot after removing libsurfaceflinger.so: 32267 32267 E AndroidRuntime: java.lang.UnsatisfiedLinkError: Cannot load library: (linker.c:1629, pid 32259) soinfo_link_image: could not load library "libsystem_server.so" needed by "libandroid_servers.so"; caused by (linker.c:1629, pid 32259) soinfo_link_image: could not load library "libsurfaceflinger.so" needed by "libsystem_server.so"; caused by (linker.c:709, pid 32259) load_library: library "libsurfaceflinger.so" not found This patch also fixes almost all of the compiler warnings. Change-Id: I64bb59aed6d4e039c15ea45be2367f319ef879f8
|