Expanded test for recursive libs. Fixed bug with unnecessary
soinfo_free of already loaded library.
Change-Id: I2cc19f2650c8b12a35feeac127ef608ebba44d88
There are number of changes in the way IFUNC related relocations are done:
1. IRELATIVE relocations are now supported for x86/x86_64 and arm64.
2. IFUNC relocations are now relying on static linker to generate
them in correct order - this removes necessety of additional
relocation pass for ifuncs.
3. Related to 2: rela?.dyn relocations are preformed before .plt ones.
4. Ifunc are resolved on symbol lookup this approach allowed to avoid
mprotect(PROT_WRITE) call on r-x program segments.
Bug: 17399706
Bug: 17177284
Change-Id: I414dd3e82bd47cc03442c5dfc7c279949aec51ed
Enable the -std=gnu++11 flag for libstdc++ static and
dynamic libs.
ScopeGuard uses DISABLE_ macros instead of '= delete';
Change-Id: I07e21b306f95fffd49345f7fa136cfdac61e0225
This patch fixes the problem with symbol search order
for dlsym(RTLD_DEFAULT/RTLD_NEXT, .) by loading libraries
and ld_preloads in correct order.
Bug: https://code.google.com/p/android/issues/detail?id=74255
Change-Id: If1ba5c807322409faa914e27ecb675e2c4541f0d
Attempt: 2
This patch fixes the problem with symbol search order
for dlsym(RTLD_DEFAULT/RTLD_NEXT, .) by loading libraries
and ld_preloads in correct order.
Bug: https://code.google.com/p/android/issues/detail?id=74255
Change-Id: I4cf84c70dbaabe99310230dfda12385ae5401859
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
(cherry picked from commit 05e190c093)
Change-Id: I5bfb58e18015b1ec5b77842dbb37fb122fa1fd1a
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
(cherry pick from commit 172955a4e3)
Change-Id: Idca9d417978403d61debfd0434aaa82fd770f33b
This includes:
1. Placing has_ifunc after fields with version = 0
2. Switch to has_min_version(v) function.
3. Minor soinfo initialization refactoring (placement new + ctor)
Change-Id: I1bf5fde4d930914012ce5f3ad5acb48217da9b2d
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
Change-Id: I1379f30ed8b06758dd1cc76b80833ac8589afa50
ifuncs now work in i386 and x86_64 when called in the same library as
well as in a different library.
Bug:6657325
Change-Id: Ic0c48b1b0a76cb90f36c20c79f68294cc3fd44a1
dlsym(3) with handle != RTLD_DEFAULT|RTLD_NEXT performs
breadth first search through the dependency tree.
Bug: 16653281
Change-Id: I017a6975d1a62abb0218a7eb59ae4deba458e324
/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 d81b3b275d.
Bug: 15086752
Bug: 15732002
Bug: 14566672
Change-Id: I832c4de01a8fa050754ea64da317d1639990265e
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
* 6275f20834
Cleanup: remove AARCH/ARM_COPY relocation support
* b906e13c55
And restricts the following patch to 64 bit only:
Remove support for non-PIE executables
* 2aebf5429b
Bug: 14566672
Bug: 15086752
Bug: 15732002
Change-Id: Ia2501aa14bd30feb4a6ce66bdb7c9f066dba0b5f
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>
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