summaryrefslogtreecommitdiffstats
path: root/tests/dlext_test.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Make path to apk compliant with jar url formatDmitriy Ivanov2015-06-091-2/+2
| | | | | | Bug: http://b/21726698 Bug: http://b/8076853 Change-Id: I8c1942a98fe3119746b4dc9f60a7ff215ea7009c
* Fix dl* tests to run-on-hostDmitriy Ivanov2015-04-091-1/+5
| | | | | Bug: http://b/20121152 Change-Id: I1e1f41d885c75dbb26f91565a53a15d62ef72ce6
* Add realpath for soinfoDmitriy Ivanov2015-04-061-2/+2
| | | | | | | | | | | | 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
* Add ANDROID_DLEXT_FORCE_LOAD flagDmitriy Ivanov2015-04-031-0/+34
| | | | | | | | | 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
* Move open from zip tests to dlextDmitriy Ivanov2015-03-181-21/+50
| | | | | | | | To avoid building them for glibc. Also replace snprintf with std::string Change-Id: I12e1d2e4ab46ff5af6c05453da67842e0d838fc5
* Fix typoDmitriy Ivanov2015-03-161-1/+1
| | | | Change-Id: Ie6dad7d09873c88f6bbb2d45c2780e3b0c618bd6
* better gtest runner for bionicYabin Cui2014-12-131-22/+26
| | | | | | | | | 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
* check invalid file offset when loading libraryYabin Cui2014-11-041-3/+17
| | | | | | | Bug: 18178121 Bug: 18078224 Change-Id: I5254433d54645db68e9b83d5095dc2bf9d8531bc
* Rename library_offset to library_fd_offsetDmitriy Ivanov2014-10-211-8/+17
| | | | | | | | replace lseek() and use pread() instead add test for library_fd_offset > file_size case Bug: 17762003 Change-Id: I4555f0be635124efe849c1f226985bcba72ffcbd
* Build dlext_testzip as custom module.Ying Wang2014-10-081-1/+1
| | | | | | | | 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
* Add file_offset parameter to android_extinfoDmitriy Ivanov2014-10-061-18/+73
| | | | | Bug: 17762003 Change-Id: I8fb267a3155acef3dba534038cf5d1ef00d7154b
* Don't fail a test just because we aren't root.Dan Albert2014-09-031-0/+5
| | | | | | | If the tests are not being run as root, emit a message and don't continue with the test. Change-Id: I352e1a4162caaeb18b81b8daf44797009756dcd9
* Add missing type casts before comparison.Chih-Hung Hsieh2014-08-271-4/+5
| | | | | BUG: 17300548 Change-Id: Ice9868f36c8fa8cd40bb13741b0e33c8f8d354fd
* Load library using file handle.Dmitriy Ivanov2014-07-021-0/+22
| | | | | | | | * This patch enables dlopen by file descriptor instead of path/name. Bug: 15984217 Change-Id: Ib39051e00567fb97070bf96d8ce63993877c0a01
* Test that relro sharing actually saves memory.Torne (Richard Coles)2014-05-061-0/+123
| | | | | | | | | | | 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
* Handle empty relro segment or incorrectly sized file.Torne (Richard Coles)2014-05-021-40/+77
| | | | | | | | | | | | | | | | 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
* Get ANDROID_DATA dir from enviromentDmitriy Ivanov2014-04-221-3/+6
| | | | Change-Id: Ie3675bd27bbc779fc2140f95b930eadd14838753
* Allow sharing the RELRO section via a file.Torne (Richard Coles)2014-04-171-0/+56
| | | | | | | | | | | | 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
* Support loading libraries to a reserved address.Torne (Richard Coles)2014-04-171-0/+136
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