OSDN Git Service

bionic: linker: Load shim libs *before* the self-linked libs
authorChristopher R. Palmer <crpalmer@gmail.com>
Sun, 14 Feb 2016 16:38:44 +0000 (11:38 -0500)
committerChristopher R. Palmer <crpalmer@gmail.com>
Sun, 14 Feb 2016 16:42:41 +0000 (11:42 -0500)
commit02b1d48d51ffed14442390c80e773f3ac89396ff
treeb57eff8785b74c55db2dca17d5f74364d9b9371a
parent51ad57b30d5cb808bca20e0a6d25139435069283
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
linker/linker.cpp