Relocate symbol against DF_1_GLOBAL shared libraries
loaded before this shared library. This includes
main executable, ld_preloads and other libraries
that have DF_1_GLOBAL flag set.
Bug: 2643900
Bug: 15432753
Bug: 18186310
(cherry picked from commit d225a5e652)
Change-Id: I4e889cdf2dfbf8230b0790053d311ee6b0d0ee2d
local_group includes this library and its dependencies.
Bug: 18186310
(cherry picked from commit e47b3f8456)
Change-Id: I93c2d873e924df7319569307444bf603d7d27bf0
The local group is a sequence of libraries in default (breadth-first)
order. It allows RTLD_LOCALLY loaded library to correctly relocate
symbols within its group (see test-cases).
Local group lookup is performed after main executable and ld_preloads.
Bug: 2643900
Bug: 15432753
Bug: 18186310
(cherry picked from commit cfa97f172d)
Change-Id: I5fa8c673f929e4652c738912c7ae078d7ec286d2
DT_STRSZ Implement strtab boundary checks
DT_FLAGS_1 Warn if flags other than DF_1_NOW|DF_1_GLOBAL are set
Bug: 17552334
Bug: 18186310
(cherry picked from commit 6cdeb5234d)
Change-Id: I7ffc7bc600798308a77ad949a644949b64250ae2
This reverts commit 8f61d99183
Despite the fact that static linker does all the work while linking
-Bsymbolic executables, according to the SCO doc following DT_SYMBOLIC
and DF_SYMBOLIC flags is still a requirement for the dynamic linker
as well.
(see http://www.sco.com/developers/gabi/2012-12-31/ch5.dynamic.html)
Bug: 18186310
(cherry picked from commit 96bc37f2e1)
Change-Id: Ie217be4f3305d877066e4cfe91975ae1c7768330
The debuggerd case can probably never happen, because you're crashing at this
point anyway. The system property one seems possible though.
Bug: 18186310
(cherry picked from commit 0dc39f9952)
Change-Id: I3e84488fc246f6c28cbd82e96d0cd4343a12c28a
From the elf-spec: "Symbolically bound shared objects are
identified by the .dynamic entry DT_SYMBOLIC. This tag is
informational only; the runtime linker processes symbol
lookups from these objects in the same manner as any
other object."
Bug: 18186310
(cherry picked from commit 8f61d99183)
Change-Id: I37024799ac8d1837993c8ae78780a448bedd6539
Symbols from libraries opened with RTLD_LOCAL (default)
should not be visible via dlsym(RLTD_DEFAULT/RTLD_NEXT, .)
Bug: 17512583
Bug: 18186310
(cherry picked from commit e8ba50fe0d)
Change-Id: Idf6bbe2233fb2bfc0c88677e7d1fc518fb3f7a8b
replace lseek() and use pread() instead
add test for library_fd_offset > file_size case
Bug: 17762003
(cherry picked from commit a6c1279098)
Change-Id: Ie117c745081ee33d07db5341115ff6c8e98b0dec
Get dynamic flags from phdr table's correct entry rather the first
entry, so that the following DT_DEBUG entry can be set.
Also fix the undefined reference to LoadTask::deleter issue under gcc
-O0 option.
Bug: 17524778
(cherry picked from commit e93be99da0)
Change-Id: I347792dab25c7b19c3fc690e03d20899ce1e26e0
Reset soinfo version to 0.
Disable ifunc test for arm64 because of old toolchain
in lmp-mr1-dev branch
Note: this commit should be reverted in -plus-aosp branch.
Change-Id: I2d6d996d43bc35d5d4975c745779f43a988b31e6
Expanded test for recursive libs. Fixed bug with unnecessary
soinfo_free of already loaded library.
(cherry picked from commit a6ac54a215)
Change-Id: I6907c723d9fbdf6b2777f3f236b1e29b0843edd6
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
(cherry picked from commit 9aea164457)
Change-Id: Ie19d900fc203beb93faf8943b0d06d534a6de4ad
Enable the -std=gnu++11 flag for libstdc++ static and
dynamic libs.
ScopeGuard uses DISABLE_ macros instead of '= delete';
(cherry picked from commit d9ff722661)
Change-Id: If2573d080770e18b36b56106f2369f7bb682cd3c
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
Attempt: 2
(cherry picked from commit 14669a939d)
Change-Id: Id87540c96a2242220967b6fa5d84ddcd829e2b97
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
(cherry picked from commit a3ad450a2e)
Change-Id: I1125de10272c84e4f075cbc72859c1f6b3e89943
Clang is still disabled for x86 and x86_64 long double code,
for x86_64 special assembly instruction, and the linker module.
BUG: 17163651
BUG: 17302991
BUG: 17403674
(cherry picked from commit b58db8b083)
Change-Id: I916c05056d37a9c287b0a5ae3b1a209d98c8f70e
This allows adding destructors to classes used
for global variables.
(cherry picked from commit 14241402de)
Change-Id: I1d8776130d1e01a8c53d23a2949f5010f4c96b16
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)
(cherry picked from commit 0d15094287)
Change-Id: Idf135fdd3d4826b5653f32add2adc6db5d4a4f95
ifuncs now work in i386 and x86_64 when called in the same library as
well as in a different library.
Bug:6657325
(cherry picked from commit c5a13efa9b)
Change-Id: I321d780bc2f9bd1baa749e1acacd2683aefe827b
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
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
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 042426ba63)
Change-Id: I69d59e395e8112f119343e8a4d72fe31cd449f31
dlsym(3) with handle != RTLD_DEFAULT|RTLD_NEXT performs
breadth first search through the dependency tree.
Bug: 16653281
(cherry picked from commit aa0f2bdbc2)
Change-Id: I0ba8c2034ab341f8a279cdb4e2e7e47f1aef7897