History log of /bionic/tests/dlext_test.cpp
Revision Date Author Comments
f963bc3833951e78558de87e0c8fca589572ccf8 25-Apr-2017 Zhenhua WANG <zhenhua.wang@intel.com> Compare Pss of tested library in VerifyMemorySaving

DlExtRelroSharingTest.VerifyMemorySaving verifies whether
android_dlopen_ext(ANDROID_DLEXT_USE_RELRO) really saves memory.

This patch compares Pss of the tested library rather than total
Pss of the process, in case different behavior of dlopen() and
android_dlopen_ext() introduces random Pss usage.

Test: DlExtRelroSharingTest.VerifyMemorySaving

(cherry picked from commit 81aad0058cd0961dfd9f3006dd979c1fdd6ca659)

Bug: https://issuetracker.google.com/38226388
Change-Id: I4248628fa951b38818fe2af363fdf78abf09a112
e8ffe56a9c2bacc6bd880238250ad61e2bbb257b 05-May-2017 Jiyong Park <jiyong@google.com> greylist is no longer enabled by default.

greylist is needed only for application namepaces. Since we started using
linker-namesapces for vendors and other platform apps linker should not
enable greylist workaround by default.

Bug: http://b/37731053
Bug: https://issuetracker.google.com/38146125
Test: sailfish builds and boots
Test: bionic-unit-tests and linker-unit-tests pass
Change-Id: Iee83db6fb1ae754f5ade18491321d9bca3b5ead4
ec43dd6c36d75014c4e4dc592dd67ab20033a76a 02-May-2017 Dimitry Ivanov <dimitry@google.com> Shared namespaces inherit parent ns properties

Make shared namespace inherit namespace links and
search/permitted paths from the parent namespace.

Bug: http://b/37854032
Test: bionic_unit_tests --gtest_filter=dl*:Dl*
Change-Id: I174661d4a1dd0cbe4a378179073719aa955f3592
15f1db35fa71410356925e6469d1c1a61a4207cb 24-Apr-2017 Dimitry Ivanov <dimitry@google.com> Revert "Revert "loader: enable loading libraries from tmpfs""

This reverts commit 6d59318d78553c32c8f2f43ee48ec3bebace8e86.

Bug: http://b/37245203
Bug: http://b/37590327
Test: bionic-unit-tests on angler and marlin
Test: boot an angler and make sure mediacodec does not crash
6d59318d78553c32c8f2f43ee48ec3bebace8e86 22-Apr-2017 Yin-Chia Yeh <yinchiayeh@google.com> Revert "loader: enable loading libraries from tmpfs"

This reverts commit bb8b22a087db32773f1a9cd3473061f3ad714afc.

http://b/37245203
http://b/37590327
Change-Id: I36f45697f7478b830947d641942e453ed0d5466e
bb8b22a087db32773f1a9cd3473061f3ad714afc 21-Apr-2017 Dimitry Ivanov <dimitry@google.com> loader: enable loading libraries from tmpfs

This change adds two tests for dlopen from temporary files.
1. One Uses memfd_create() can be used to load libraries directly
from memory. This requires relaxing namespace accessibility check
in order to make this work in isolated namespaces.
2. Another checks that open with O_TMPFILE works.

Bug: http://b/37245203
Test: bionic-unit-tests --gtest_filter=dl*:Dl*
Change-Id: I3be1d7198ca17e7f1ba022a0d86c64d59a493506
dedcf35bcc98e8b62fb6480022cd11ae671280ad 27-Mar-2017 Dimitry Ivanov <dimitry@google.com> Fix lookup logic for linked namespaces

When looking for already loaded libraries include
linked namespaces to the search, but check if
the library is accessible from the main namespace.

Bug: http://b/36008422
Bug: http://b/35417197
Bug: http://b/34052337
Bug: http://b/36660652
Bug: https://issuetracker.google.com/36636090
Test: run bionic-unit-tests --gtest_filter=dl*:Dl*
Change-Id: Ic7c1d48114da3ca5dc6512ef03f595dd17b6ed17
(cherry picked from commit d3e7d088453e089b3d625b0864ccdf3c74893f18)
35c8e3b1251af62897a9babd693e2b1be5676160 27-Feb-2017 Dimitry Ivanov <dimitry@google.com> Fix greylist exception to account for linked namespaces

Do not load second copy of libraries that are supposed to
be provided by linked namespaces. Also do not print
error in the log if caller tries to open shared library
using absolute path for apps targeting N+.

Bug: http://b/35454141
Bug: http://b/26833548
Bug: http://b/35338922
Test: run bionic-unit-tests --gtest_filter=dl*
Change-Id: Icf3aeedff18d287d2ba0b3df3808b100f3ef5f7a
1862314dd43ccbedbb405b8b0a5d40086cf7d9ca 21-Feb-2017 Dimitry Ivanov <dimitry@google.com> Add test for a greylisted library

Test: bionic-unit-tests --gtest_filter=dlext.ns*
Bug: http://b/35338922
Change-Id: I2f4895cb1ec458c2f565a7e4d06f7a1f6200e7aa
7a34b9d57a762ca7cd6b8d6b9f9fb45c2b991da7 03-Feb-2017 Dimitry Ivanov <dimitry@google.com> Replace public library list with shared lib sonames (part 2/2)

This commit updates interface of libdl.c.

1. android_init_namespaces is replaces with android_init_anonymous_namespace
2. added 2 arguments to android_create_namespace to specify linked namespace
and the list of shared libraries sonames.
3. symbol lookup does not get past boundary libraries (added check and test for it).

Bug: http://b/26833548
Bug: http://b/21879602
Test: bionic-unit-tests --gtest_filter=dl*:Dl*
Change-Id: I32921da487a02e5bd0d2fc528904d1228394bfb9
7d429d3c480166e1013bcdf68f4be479209aa509 02-Feb-2017 Dimitry Ivanov <dimitry@google.com> Replace public library list with shared lib sonames (part 1/2)

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
d0b5c3ad65accd2c0298edbdfd527ede63e68ba1 25-Nov-2016 Dimitry Ivanov <dimitry@google.com> Fix bionic-unit-tests-glibc

Also add another test for dlsym(RTLD_NEXT, ..)

Bug: http://b/33106624
Test: run bionic-unit-tests-glibc and bionic-unit-tests
Change-Id: I340165d66bf2360b0e3273d3561a08cb5e7bd025
5bc78c8bcd0c1e634c04029309ede3ec05f2d424 16-Nov-2016 Elliott Hughes <enh@google.com> Add and use constants for the Android API levels.

Test: bionic tests still pass
Change-Id: If1b619cfc9db1d3f5d91f14f2ace71058dca0c4a
927877c7d3173c1259732e51428f4ae38dc6bc4f 21-Sep-2016 Dimitry Ivanov <dimitry@google.com> bionic-unit-tests: remove dependency on ANDROID_DATA

Replace references to ANDROID_DATA enviroment variable with references
to g_testlib_root.

Bug: http://b/22182538
Test: build and run bionic-unit-tests --gtest_filter=dl*:Dl*
Test: make cts && cts-tradefed run singleCommand cts --skip-preconditions -m CtsBionicTestCases
Change-Id: I5667e991551cec55b9b664f2f0063039671ff34b
708589f5e8244a17d690848eed5f0fbfcce48a26 19-Sep-2016 Dimitry Ivanov <dimitry@google.com> bionic-unit-tests: Create symlinks in runtime

Instead of creating symlinks in build time and then relying
on usage of adb sync (adb push follows symlinks) - create
them in test run time.

Test: mm && run bionic-unit-tests --gtest_filter=dl*:Dl*
Bug: http://b/22182538
Change-Id: I9d2a873e3ba303533c14ba5e3b779e4a67925462
a36e59bb9973aaae2e3487e0bfadd1f79814097e 01-Sep-2016 Dimitry Ivanov <dimitry@google.com> Move test libraries under /data/nativetests

Move libraries used in bionic-unit-tests out of system partition to
/data/nativetests../bionic-loader-test-libs

Bug: http://b/22182538
Test: build bionic and run bionic-unit-tests
Change-Id: I170177bef782839d0b4970ae4418bf54d0a77836
23af6af7c205f0aff0829c08a088b2dd79e9ffe0 14-Jul-2016 Dimitry Ivanov <dimitry@google.com> Fix dlext.ns_smoke test

Check for updated error_message

Bug: http://b/31097098
Test: adb shell bionic-unit-tests32/64 --gtest_filter=dlext.ns*
(cherry picked from commit 3a6c6b3254b2033a9a0246013a2c8b486800624b)

Change-Id: I0f0dd59a6deba016d37d0ccc80113b62db86c1c2
3a6c6b3254b2033a9a0246013a2c8b486800624b 14-Jul-2016 Dimitry Ivanov <dimitry@google.com> Fix dlext.ns_smoke test

Check for updated error_message

Change-Id: I0f0dd59a6deba016d37d0ccc80113b62db86c1c2
Test: adb shell bionic-unit-tests32/64 --gtest_filter=dlext.ns*
d61ca37d35e31cae52a543e65d3ae02044abe5d3 03-Jun-2016 Chih-Hung Hsieh <chh@google.com> Fix misc-macro-parentheses warnings in bionic/tests.

Bug: 28705665
Change-Id: I532205b94e30acbdc97f3f4db0660c9a16a7de89
49cfc899a3708fae9175e44c0c02cd479fda8b36 13-May-2016 Dimitry Ivanov <dimitry@google.com> linker: Allow caller to specify parent namespace

This change enables apps to share libraries opened
with RTLD_GLOBAL between different classloader namespaces.

The new parameter to create_namespace allows native_loader
to instruct the linker to share libraries belonging to
global group from a specified namespace instead of
using the caller_ns.

Bug: http://b/28560538
Bug: https://code.google.com/p/android/issues/detail?id=208458
Change-Id: I5d0c62730bbed19cdeb16c7559c74aa262a2475f
(cherry picked from commit fc2da53440383fe1026e0eb287d643b577c2707d)
dcaef3710df817db5652a1f3ab4646f43f5cd3ee 17-May-2016 Dimitry Ivanov <dimitry@google.com> Fix dlopen of main executable by absolute path

This CL adds initialization of inode for the main executable
which enables linker to resolve the correct soinfo when
application calls dlopen with absolute path to the
main executable.

Bug: http://b/28420266
Change-Id: I102e07bde454bd44c6e46075e3faeeb5092830d8
(cherry picked from commit 2ba1cf39ae6087249a839ec7b3793d4d4fa75438)
2ba1cf39ae6087249a839ec7b3793d4d4fa75438 17-May-2016 Dimitry Ivanov <dimitry@google.com> Fix dlopen of main executable by absolute path

This CL adds initialization of inode for the main executable
which enables linker to resolve the correct soinfo when
application calls dlopen with absolute path to the
main executable.

Bug: http://b/28420266
Change-Id: I102e07bde454bd44c6e46075e3faeeb5092830d8
fc2da53440383fe1026e0eb287d643b577c2707d 13-May-2016 Dimitry Ivanov <dimitry@google.com> linker: Allow caller to specify parent namespace

This change enables apps to share libraries opened
with RTLD_GLOBAL between different classloader namespaces.

The new parameter to create_namespace allows native_loader
to instruct the linker to share libraries belonging to
global group from a specified namespace instead of
using the caller_ns.

Bug: http://b/28560538
Bug: https://code.google.com/p/android/issues/detail?id=208458
Change-Id: I5d0c62730bbed19cdeb16c7559c74aa262a2475f
19b669b00325bcbab4679c4e57c5d8d95f54decb 10-May-2016 Dimitry Ivanov <dimitry@google.com> Remove linker-namespace functions from the header

They are intended for platform use only and we shouldn't have them
in the public header file.

Bug: http://b/28174921
Change-Id: Ib9b3d0fa9442cfa2e784a693ad567d1444d774e5
(cherry picked from commit 41fd29532b52bb66e3e1f4620053713fd0299f6e)
41fd29532b52bb66e3e1f4620053713fd0299f6e 10-May-2016 Dimitry Ivanov <dimitry@google.com> Remove linker-namespace functions from the header

They are intended for platform use only and we shouldn't have them
in the public header file.

Bug: http://b/28174921
Change-Id: Ib9b3d0fa9442cfa2e784a693ad567d1444d774e5
54807617dde7c816af09517c928a6f1261148faf 21-Apr-2016 Dimitry Ivanov <dimitry@google.com> Improve error message for empty list of public libs

Change-Id: I5a3cbc99d34e05559426b521a964d1407b67a6c4
0551c1d47bad202ce6dd90757067bc0fd217497a 11-Apr-2016 Dimitry Ivanov <dimitry@google.com> Remove dangling links in secondary namespaces

linker didn't remove link to the soinfo from shared
namespaces on soinfo_unload, because it didn't keep
record of all namespaces the library is added to.

This change adds test for this and also fixes the
problem by introducing list of secondary namespaces
to soinfo, which is used to remove soinfo in
soinfo::remove_all_links().

Bug: http://b/28115950
Change-Id: Ifbf6e54f92fa6e88f86b6a8dd6dc22d4553afd22
(cherry picked from commit aca299ac4721809d6fc61e25c505bb59acd23fbc)
aca299ac4721809d6fc61e25c505bb59acd23fbc 11-Apr-2016 Dimitry Ivanov <dimitry@google.com> Remove dangling links in secondary namespaces

linker didn't remove link to the soinfo from shared
namespaces on soinfo_unload, because it didn't keep
record of all namespaces the library is added to.

This change adds test for this and also fixes the
problem by introducing list of secondary namespaces
to soinfo, which is used to remove soinfo in
soinfo::remove_all_links().

Bug: http://b/28115950
Change-Id: Ifbf6e54f92fa6e88f86b6a8dd6dc22d4553afd22
ae74e8750b9dae51b24a22fdb4b0e0a2d84f37b9 24-Mar-2016 Dimitry Ivanov <dimitry@google.com> linker: hide the pointer to soinfo

Handle no longer is a pointer to soinfo of
a corresponding library. This is done to
prevent access to linker internal fields.

Bug: http://b/25593965
Change-Id: I62bff0d0e5b2dc842e6bf0babb30fcc4c000be24
(cherry picked from commit d88e1f350111b3dfd71c6492321f0503cb5540db)
d88e1f350111b3dfd71c6492321f0503cb5540db 24-Mar-2016 Dimitry Ivanov <dimitry@google.com> linker: hide the pointer to soinfo

Handle no longer is a pointer to soinfo of
a corresponding library. This is done to
prevent access to linker internal fields.

Bug: http://b/25593965
Change-Id: I62bff0d0e5b2dc842e6bf0babb30fcc4c000be24
d17a377c49201bd5f0e4c71d84f1ce25a86642de 01-Mar-2016 Dimitry Ivanov <dimitry@google.com> linker: print "not accessible" error message to the log

Print properties of the namespace on "library is not accessible"
error to better diagnose problems with native library accessiblity

Bug: http://b/27406143
Change-Id: Icf3d6c604f09dfa015de863fdb1267d343930d2a
(cherry picked from commit 350bdad61cc6551db649fcaeb8642f4a1d6b139a)
350bdad61cc6551db649fcaeb8642f4a1d6b139a 01-Mar-2016 Dimitry Ivanov <dimitry@google.com> linker: print "not accessible" error message to the log

Print properties of the namespace on "library is not accessible"
error to better diagnose problems with native library accessiblity

Bug: http://b/27406143
Change-Id: Icf3d6c604f09dfa015de863fdb1267d343930d2a
33697a0c43c48e15c3bcf018138b9b837d0099cd 26-Jan-2016 Elliott Hughes <enh@google.com> Factor out the waiting for children in bionic tests.

Change-Id: I4a1e51b6920b33dc892d447f5bd6d10f1cb2704a
f45b0e9edee72e97106c4b3d393b9bf1582303b3 15-Jan-2016 Dimitry Ivanov <dimitry@google.com> Do not unmap reserved region on dlclose

dlclose used to unmap the part of the reserved region
for ANDROID_DLEXT_RESERVED_ADDRESS that was neccessary
to map PT_LOAD segments. With this change dlclose
replaces mapped PT_LOAD segments with a PROT_NONE,
MAP_ANONYMOUS | MAP_NORESERVE.

Previously caller was unmapping the reserved region after
the failed dlclose which led to race condition when someone
else reused the region freed by dlclose but before the unmap
by the chromium code.

Bug: http://code.google.com/p/chromium/issues/detail?id=568880
Change-Id: I0f5eaa2bf6641f83dde469b631c518482acc59a2
c0ffceccf93e1752a555086a04d1484c1df1b165 20-Jan-2016 Christopher Ferris <cferris@google.com> Remove dependency on zipalign.

Roll our own version of zipalign so that we can break the dependency
on the build tools zipalign. This breaks the transitive dependency
on androidfw so that building bionic unit tests in brillo works again.

Also modify the DlExtTest.ExtInfoUseFdWithOffset test so it dynamically
gets the offset of the shared library inside of the zip instead of
hard-coding the value.

Bug: 25446938
Change-Id: Idfb5d3089960a94eefa2c76e03da1ad2f4d7fb2f
7331fe18d7ffd550996e07b534bc7a6cf625afa5 14-Dec-2015 Dimitry Ivanov <dimitry@google.com> linker: implement shared namespaces

Shared namespaces clone the list of loaded native
libraries from the caller namespace. This allows
classloaders for bundled apps to share already loaded
libraries with default namespace.

Bug: http://b/22548808
Bug: http://b/26165097
Change-Id: I8949d45937fdb38e1f586ff0679003adac0d9dad
(cherry picked from commit e78deef364d952dd1141a2f3067a12060aaf11e6)
e78deef364d952dd1141a2f3067a12060aaf11e6 14-Dec-2015 Dimitry Ivanov <dimitry@google.com> linker: implement shared namespaces

Shared namespaces clone the list of loaded native
libraries from the caller namespace. This allows
classloaders for bundled apps to share already loaded
libraries with default namespace.

Bug: http://b/22548808
Bug: http://b/26165097
Change-Id: I8949d45937fdb38e1f586ff0679003adac0d9dad
284ae3559ed909613b189b98bdc3efab94373a30 08-Dec-2015 Dimitry Ivanov <dimitry@google.com> Add permitted_when_isolated_path to linker namespaces

The permitted_when_isolated_path is a way to white-list
directories not present in search-path. It is ignored for
not isolated namespaces.

Bug: http://b/25853516
Bug: http://b/22548808
Change-Id: Ib1538037268eea69323ea49968a34a4a1d1938a5
22840aab47763c88598b32d1edcac4d8b3ef21f0 05-Dec-2015 Dimitry Ivanov <dimitry@google.com> Allow dlopening public libs using absolute path

dlopen on isolated namespaces should be able to open
public libraries using absolute path not only soname.

Bug: http://b/25853820
Change-Id: If574a67853dc51226f0f376e9e2d108316002f84
1ffec1cc4d0e283bb1ff6f49843769a3493b8d73 23-Nov-2015 Dmitriy Ivanov <dimitry@google.com> Introduce anonymous namespace

The anonymous namespace is introduced to
handle cases when linker can not find the
caller. This usually happens when caller
code was not loaded by dynamic linker;
for example mono-generated code.

Bug: http://b/25844435
Bug: http://b/22548808
Change-Id: I9e5b1d23c1c75bc78548d68e79216a6a943a33cf
3cc35e224c6fe6bb82685ff8b2758553563e2a05 18-Nov-2015 Dmitriy Ivanov <dimitry@google.com> Ignore target sdk version for the public namespace

This fixes the bug with using the libraries loaded
prior to android_set_target_sdk_version call.

Bug: http://b/22548808
Change-Id: I3ca2d367b0fa930a437bbb65f780834803d2ef0a
42d5fcb9f494eb45de3b6bf759f4a18076e84728 30-Oct-2015 Dmitriy Ivanov <dimitry@google.com> Introducing linker namespaces

Bug: http://b/22548808
Change-Id: Ia3af3c0a167f1d16447a3d83bb045d143319b1e1
fd7a91e69263a991f65fa458ff33de0670b4fd81 06-Nov-2015 Dmitriy Ivanov <dimitry@google.com> linker: cleanup solist after unsuccessful read

Bug: http://b/25560017
Change-Id: I03c5a1d7aed34c480d341aacfb3b1afdfa037b99
126af757c6d6a6447c19236df8d98ba07f21996f 08-Oct-2015 Dmitriy Ivanov <dimitry@google.com> Implement load at fixed address feature

Bug: http://b/24683631
Change-Id: I3a39ab526c8f9e213339b60e135e5459d0f41381
a1feb117e4d5614548574f28dede3443e073512b 02-Oct-2015 Dmitriy Ivanov <dimitry@google.com> Make dt_runpath work for libraries opened from apk

This patch also fixes realpath for libraries opened directly
from apks.

Bug: http://b/21960914
Bug: http://b/21961857
Change-Id: I35ade661c87f1d448191f385811f6e9fd3cacf11
b48275045de93cce292faaf5170af3ead89b3746 29-Sep-2015 Dmitriy Ivanov <dimitry@google.com> Optimize dlopen from a zip file

This change makes dynamic linker reuse ZipArchiveHandles in
ld_library_path on dlopen to optimize the lookup of dt_needed
libraries.

Bug: http://b/21960534
Change-Id: I65f897910d46dd2ffabdcb0b7842db2f127eee30
edfc9f63a261994f2565492436607c04df980e21 03-Sep-2015 Dmitriy Ivanov <dimitry@google.com> linker: don't pass dlextinfo to dependent loads

Don't pass the parent load's dlextinfo to dependent loads, since this
causes the linker to try to load the dependencies using the same
addresses/relro/fds/etc as the main library, which is never going to
work. This was how it worked before ae69a95 which broke this.

Bug: http://b/23742664
Bug: http://b/20948231
Bug: http://b/20841817
Change-Id: I340ebae1127666d5c6c6f9c6521b89fb93f15bdd
402a75060dcd194c1991a15df2aba51f0d868ac3 09-Jun-2015 Dmitriy Ivanov <dimitry@google.com> Make path to apk compliant with jar url format

Bug: http://b/21726698
Bug: http://b/8076853
Change-Id: I8c1942a98fe3119746b4dc9f60a7ff215ea7009c
(cherry picked from commit 524f1f1efe0cb32714c61e26f21701ac952b9e42)
524f1f1efe0cb32714c61e26f21701ac952b9e42 09-Jun-2015 Dmitriy Ivanov <dimitry@google.com> Make path to apk compliant with jar url format

Bug: http://b/21726698
Bug: http://b/8076853
Change-Id: I8c1942a98fe3119746b4dc9f60a7ff215ea7009c
ef25592f14d23ce6294ea103e9edf894779d141d 08-Apr-2015 Dmitriy Ivanov <dimitry@google.com> Fix dl* tests to run-on-host

Bug: http://b/20121152
Change-Id: I1e1f41d885c75dbb26f91565a53a15d62ef72ce6
aae859cc3ca127d890e853cbf12b731e05624a22 31-Mar-2015 Dmitriy Ivanov <dimitry@google.com> Add realpath for soinfo

This change adds realpath to soinfo and
extends limit on filenames from 128 to PATH_MAX.

It also removes soinfo::name field, linker uses
dt_soname instead.

Bug: http://b/19818481
Bug: https://code.google.com/p/android/issues/detail?id=80336
Change-Id: I9cff4cb5bda3ee2bc74e1bbded9594ea7fbe2a08
9b82136b987bc01224e3b42732334ea27c97d188 03-Apr-2015 Dmitriy Ivanov <dimitry@google.com> Add ANDROID_DLEXT_FORCE_LOAD flag

This flag allows to force loading of the library
in the case when for some reason multiple ELF files
share the same filename (because the already-loaded
library has been removed and overwritten, for example).

Change-Id: I798d44409ee13d63eaa75d685e99c4d028d2b0c1
52393a56335435efc605aff66aca3145873e1e56 19-Mar-2015 Dmitriy Ivanov <dimitry@google.com> Move open from zip tests to dlext

To avoid building them for glibc.

Also replace snprintf with std::string

Change-Id: I12e1d2e4ab46ff5af6c05453da67842e0d838fc5
b1ada3dd3fbf188ced9ab1edf1ee154d119bbc02 16-Mar-2015 Dmitriy Ivanov <dimitry@google.com> Fix typo

Change-Id: Ie6dad7d09873c88f6bbb2d45c2780e3b0c618bd6
294d1e2c9e17873a0ce1c23cb2a559fc04f610be 08-Dec-2014 Yabin Cui <yabinc@google.com> better gtest runner for bionic

1. option to run each test in a separate forked process: "--isolate".
2. warnings about slow tests: "--warnline".
3. run multiple tests at the same time: "-j N".

Bug: 17589740
Change-Id: Ife5f4cafec43aa051ad7bd9c9b2b7e2e437db0de
16f7f8d2503a9033a09a4d7e857561d63471bb82 04-Nov-2014 Yabin Cui <yabinc@google.com> check invalid file offset when loading library

Bug: 18178121
Bug: 18078224

Change-Id: I5254433d54645db68e9b83d5095dc2bf9d8531bc
702ab5b37e77684ee352300d32b078606ee388d0 21-Oct-2014 Dmitriy Ivanov <dimitry@google.com> Rename library_offset to library_fd_offset

replace lseek() and use pread() instead
add test for library_fd_offset > file_size case

Bug: 17762003

(cherry picked from commit a6c1279098f24a675d0df74ce1946f5d534b425e)

Change-Id: Ie117c745081ee33d07db5341115ff6c8e98b0dec
3c5c720b0b46ecd801329c09d23bb6e7098d76d3 09-Oct-2014 Ying Wang <wangying@google.com> Build dlext_testzip as custom module.

Use $(BUILD_SYSTEM)/base_rules to build it as custom module, so that
it's exposed to utilities like mm/mmma etc.

Bug: 17887283
Bug: 17762003

(cherry picked from commit 667853d47770fbdb54aaf0b3261b0d4882725770)

Change-Id: I405797d16f20dc09e5d84b93b6727b634db2fc2c
de01780f46e4e4540c7a1ea7d0302f460c880e9d 04-Oct-2014 Dmitriy Ivanov <dimitry@google.com> Add file_offset parameter to android_extinfo

Bug: 17762003

(cherry picked from commit 07e5bc152d8a3ad4c50808bb86f3c0f2c5e2f514)

Change-Id: I72d527831384ff5dde013a4c8dfe639fbec165f5
a6c1279098f24a675d0df74ce1946f5d534b425e 21-Oct-2014 Dmitriy Ivanov <dimitry@google.com> Rename library_offset to library_fd_offset

replace lseek() and use pread() instead
add test for library_fd_offset > file_size case

Bug: 17762003
Change-Id: I4555f0be635124efe849c1f226985bcba72ffcbd
667853d47770fbdb54aaf0b3261b0d4882725770 09-Oct-2014 Ying Wang <wangying@google.com> Build dlext_testzip as custom module.

Use $(BUILD_SYSTEM)/base_rules to build it as custom module, so that
it's exposed to utilities like mm/mmma etc.

Bug: 17887283
Change-Id: Idd7b62d08e4d56331a3ff15da6aa46eae8c41898
07e5bc152d8a3ad4c50808bb86f3c0f2c5e2f514 04-Oct-2014 Dmitriy Ivanov <dimitry@google.com> Add file_offset parameter to android_extinfo

Bug: 17762003
Change-Id: I8fb267a3155acef3dba534038cf5d1ef00d7154b
69fb9f3f408b7d7f85522e3848a8ab5b87d6e377 03-Sep-2014 Dan Albert <danalbert@google.com> Don't fail a test just because we aren't root.

If the tests are not being run as root, emit a message and don't
continue with the test.

Change-Id: I352e1a4162caaeb18b81b8daf44797009756dcd9
a2c6ae6f841d088b79a2a7bbd73847b8b199a521 27-Aug-2014 Chih-Hung Hsieh <chh@google.com> Add missing type casts before comparison.

BUG: 17300548
Change-Id: Ice9868f36c8fa8cd40bb13741b0e33c8f8d354fd
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
26052616915fe2324755687c7db73d69c521b34d 02-May-2014 Torne (Richard Coles) <torne@google.com> Test that relro sharing actually saves memory.

Spawn 20 child processes, have them all load the library, and compare
the total PSS used in the case where we use dlopen() and the case where
we use android_dlopen_ext() with relro sharing. We assume we will save
at least 10% of the memory; in practise this example saves 40% or more
so this should be a reasonable threshold.

Bug: 14299541
Change-Id: Idccf6b8b0eb137abae2200f1ce68fb76b3cbdd75
26ec9679ff01fb155ae21015f31cc95bed24f670 30-Apr-2014 Torne (Richard Coles) <torne@google.com> Handle empty relro segment or incorrectly sized file.

If the file has no relro segment, the generated relro file will have
length 0, which caused mmap to fail. If the relro file has nonzero size,
but is too short (e.g. because it's for the wrong version of the
library), the linker would segfault while comparing the data. Fix both
these issues: don't try to map a zero length file, and don't try to
compare data that would be beyond the end of the file.

Improve test to explicitly generate two versions of the library: one
with -z relro, and one with -z norelro, so we can test both cases; also
explicitly test the case where the relro file has length 0.

Bug: 14299541
Change-Id: Id8b95585edda90e8bb5de452a35b70ed2d224934
53c884e28166678b2fa40cb3763d1549074628ad 23-Apr-2014 Dmitriy Ivanov <dimitry@google.com> Get ANDROID_DATA dir from enviroment

Change-Id: Ie3675bd27bbc779fc2140f95b930eadd14838753
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