Commit graph

150 commits

Author SHA1 Message Date
Dan Willemsen
6b3be172d6 Prevent dependency cycle due to system_shared_libs expansion
It was discovered that we were building some objects inconsistently due
to an optimization in cc_library to only build objects once and use them
for both the static and shared libraries. But static libraries didn't
get system_shared_libs set automatically, and we didn't notice that we
would have built the objects differently.

So static libraries now get the default system_shared_libs, we allow
adjusting that for static vs shared in a cc_library, and we disable the
optimization if the linked libraries are configured differently between
static and shared in a single cc_library.

This triggers dependency cycles for static libraries that libc/libdl
use, so fix those cycles here.

Test: treehugger
Change-Id: I3cf7fda161a05ec32e0c1e871999720d12a4d38e
2018-12-03 15:41:56 -08:00
Elliott Hughes
c0f4656452 Make android_get_application_target_sdk_version available to the NDK.
Also move this and android_get_device_api_level into <android/api-level.h>
so that they're always available.

This involves cleaning up <sys/cdefs.h> slightly.

Bug: N/A
Test: builds
Change-Id: I25435c55f3549cd0d827a7581bee75ea8228028b
2018-11-15 11:07:30 -08:00
Elliott Hughes
ff1428a48e Move API levels from uint32_t to int.
(cherrypick of a6c71a09670ca636cca5cfea9d74b03a951e2b5e.)

Bug: N/A
Test: builds
Change-Id: I9c414e30e3c4fe2a4e16a2fe4ce18eae85fe4844
2018-11-13 21:25:07 -08:00
Dan Willemsen
17b35598f5 Allow host bionic to use libdl_static
Bug: 31559095
Test: attempt to build host bionic
Change-Id: If057681a3e098efcf79f9d8a74608b10b1ac20da
2018-10-11 23:35:18 -07:00
Yi Kong
7786a344ce Exclude libclang_rt.builtins symbols
Similar to libgcc, libclang_rt.builtins symbols need to be excluded.

Bug: 29275768
Change-Id: Iaf7381de3b4dbd92997abd03667dea0baaab98e1
2018-10-03 10:07:13 +00:00
Chih-Hung Hsieh
ecbff8382d Work around b/24465209, do not pack relocation table.
Global flag --pack-dyn-relocs=android is used with clang lld.
For b/24465209, we need to override that with --pack-dyn-relocs=none.

Bug: 80093890
Bug: 24465209
Test: build with USE_CLANG_LLD=true and run dlext.compat_elf_hash_and_relocation_tables
Change-Id: Ic3837446ff0deccf4e66425b39d3b062abcacc5e
2018-05-23 18:45:53 -07:00
Chih-Hung Hsieh
0fc5df0fde Work around b/24465209, do not use clang lld
See longer explanation in b/80093890.
Clang lld does not generate expected DT_REL and DT_RELA tags
with --hash-style=both and --pack-dyn-relocs=android.
I am not sure about the extent of b/24465209, so
I would rather not to use lld for these .so files for now.

Bug: 80093890
Bug: 24465209
Test: build with USE_CLANG_LLD=true and run dlext.compat_elf_hash_and_relocation_tables
Change-Id: I94e9fe8d687daeadb0182ae26596ca11d3f8bd9b
2018-05-23 17:14:22 +00:00
Jiyong Park
5603c6e6b9 Mark as recovery_available: true
Libraries that are direct or indirect dependencies of modules installed
to recovery partition (e.g. toybox) are marked as recovery_available:
true. This allows a recovery variant of the lib is created when it is
depended by other recovery or recovery_available modules.

Bug: 67916654
Bug: 64960723
Bug: 63673171
Bug: 29921292
Test: m -j
Change-Id: I59bf859a10a218af6591025a0fe7d1853e328405
2018-05-14 18:08:01 +09:00
Elliott Hughes
b7fd08cad7 Merge "Support getting/setting API level in static binaries." 2018-04-04 15:24:46 +00:00
Elliott Hughes
46a943c833 Support getting/setting API level in static binaries.
Bug: http://b/27917272
Test: fixes static semaphore.sem_wait_no_EINTR_in_sdk_less_equal_than_23 test
Change-Id: Ifeeff20772ff0308aab9417d48671b604a3e9665
2018-04-03 21:53:29 -07:00
Ryan Prichard
470b66644b Break libdl.so and ld-android.so's dependency on libc.so.
* Specify "nocrt: true" to avoid calling __cxa_finalize.

 * Define a dummy __aeabi_unwind_cpp_pr0 for arm32.

Bug: b/62815515
Bug: b/73873002
Test: boot AOSP hikey960-userdebug
Test: run ndk_cxa_example in special /system/bin/debug namespace
Test: run Bionic unit tests
Change-Id: I59bcb100a2753286b59c51a47d7a183507219a07
2018-03-30 13:56:03 -07:00
Elliott Hughes
d50a1de565 Run bpfmt manually.
Bug: N/A
Test: builds
Change-Id: I0cf145c3b699ac8ef170a63366832f63a9cc1a91
2018-02-05 17:30:57 -08:00
dimitry
321476a3ec Test ld-android.so directly
This CL addresses review comments from
https://android-review.googlesource.com/c/platform/bionic/+/595067

Test: bionic-unit-tests --gtest_filter=dl*
Change-Id: I2c0fdf2a89fe6ff134308e202fb99a74080ee0ed
2018-01-29 15:32:37 +01:00
Logan Chien
9ee4591cb4 linker: Allow link namespaces without name filters
This commit allows users to create a link without soname filters between
two linker namespaces.

The motivation is to establish one-way shared library isolation.  For
example, assume that there are two linker namespaces `default` and
`vndk`.  We would like to limit the shared libraries that can be used by
the `default` namespace.  In the meanwhile, we would like to allow the
`vndk` namespace to use shared libs from the `default` namespace if the
soname cannot be find in the search path or loaded sonames of the `vndk`
namespace.

          shared_libs  = %VNDK_CORE_LIBRARIES%
          shared_libs += %VNDK_SAMEPROCESS_LIBRARIES%
    vndk <-------------------------------------------- default
       \_______________________________________________/^
                allow_all_shared_libs = true

android_link_namespaces_all_libs() is added to libdl, but it is
versioned as LIBC_PRIVATE.  android_link_namespaces_all_libs() is only
for unit tests.

Bug: 69824336

Test: adb shell /data/nativetest/linker-unit-tests/linker-unit-tests32
Test: adb shell /data/nativetest64/linker-unit-tests/linker-unit-tests64

Test: adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests
Test: adb shell /data/nativetest64/bionic-unit-tests/bionic-unit-tests

Test: Update /system/etc/ld.config*.txt and check whether the vndk
linker namespace of the vendor process can access the shared libs from
the default linker namespace.

Change-Id: I2879f0c5f5af60c7e56f8f743ebd2872e552286b
2018-01-25 14:45:29 +08:00
Dan Albert
40f15ec4b1 Package bionic static libraries in the NDK.
Test: build/soong/scripts/build-ndk-prebuilts.sh
Bug: https://github.com/android-ndk/ndk/issues/272
Change-Id: Ibb21d799fdcf230ed45db0b809e20dd86d2d8e52
2018-01-22 12:40:56 -08:00
Ian Pedowitz
b6310c2aa7 Fixing app compat issue b/72143978
This is a squash revert of a4a4854 and 1b0f2b4

  Revert "Remove a test for backwards compatibility we no longer support."

  This reverts commit a4a485454a.

  # This is the commit message #2:

  Revert "Remove obsolete workaround."

  This reverts commit 1b0f2b49d5.

Bug: 72143978
Bug: 24465209
Test: Tested failing case on sailfish, reverted back all CL's since
Test: 3471433 for b/24465209 and apps open
2018-01-18 16:26:45 -08:00
Elliott Hughes
1b0f2b49d5 Remove obsolete workaround.
Bug: http://b/24465209
Test: manually ran the app.
Change-Id: I1e2a498864c74ff3a9886b97f7dc60ad7f6dfa44
2018-01-10 11:05:19 -08:00
dimitry
11da1dcd8c Move ld-android.so build under linker/
This will allow us to apply linker's version script to the "fake"
version of ld-android.so.

Test: make
Change-Id: I55645cc0fc90e6c65e2269ba2340a908aeed1eaa
2018-01-09 11:13:40 +01:00
Elliott Hughes
b48746fb57 libdl.cpp doesn't need <stdbool.h> like libdl.c did.
Bug: N/A
Test: builds
Change-Id: I2f43fa60c8128b2b40de63748b5568fa4c9e351d
2017-10-19 14:39:41 -07:00
Josh Gao
dfcc6e4f8a Rename libdl.c to libdl.cpp.
The no-arg function definitions in libdl.c weren't strictly correct,
because they should have taken void. Rename .c to .cpp instead of
fixing them.

Test: mma
Change-Id: I9e3528c836ffc8625a6a4d529034263b19b9fb3a
2017-10-16 21:31:37 -07:00
dimitry
c5ea3ebd71 Make libdl symbols weak.
Also make a static library which can be used to override these symbols
in other implementations of libdl.so

Test: make
Change-Id: Id433bb07ecbfc4955c3fb7591ace971c2cda7862
2017-10-05 18:27:00 +02:00
Elliott Hughes
a5c316fe0c Don't repeat ourselves unnecessarily in the maps.
We can mark a whole version "introduced=" rather than doing every line
separately.

Bug: N/A
Test: builds
Change-Id: I3219edc755a42ce5ff6258efb744fb5e05967a3a
2017-10-02 10:10:15 -07:00
Jiyong Park
8664a05637 Fix API level of cfi_* symbols to 27
API level of O-MR1 is 27.

Bug: 63053790
Test: bionic tests passes

Change-Id: I78f0bd8af106954326394d60bf4d0cf5e10f7f17
2017-10-02 08:15:34 -07:00
Evgenii Stepanov
ded4524cb0 [cfi] Fix __cfi_check address calculation.
The current code is incorrect when the target address is 18 bit aligned.

Test: stops random (and extremely rare) crashes in media.extractor
Bug: 63400743
Bug: 65590288

Change-Id: I65b45ff0c4b57a7ff08d3f5b3d80f41167d3c0f8
2017-09-15 14:15:54 -07:00
dimitry
dc7cc6258a Restore dummy libdl.a implementation
Bug: http://b/36206043
Test: bionic-unit-tests-static
Change-Id: If0400b72b51570e5ca0d70ec0bd9fb77664b9210
2017-08-30 10:52:19 +02:00
Evgenii Stepanov
97c16f8dca [cfi] Export __cfi_shadow_size.
__cfi_shadow_size returns the size of the CFI shadow mapping, or 0 if
CFI is not (yet) used in this process. This can be used to adjust
RLIMIT_AS setting.

Test: device bionic tests
Bug: 64293803
Change-Id: Icd7164f96aa7115b3585c21c0f68529cd2f07c11
2017-08-03 14:04:15 -07:00
Jiyong Park
f1cee9662f __cfi_slowpath[_diag] are available to NDK and VNDK clients
When a vendor lib (or vendor-available platform lib) is built with
sanitizer on, __cfi_slowpath_diag is required. However, when building
for those libs, the llndk stub of libdl.so is provided for them and
__cfi_slowpath_diag is not exposed to the stub. In order to make the
sanitizing build successful, expose the symbol.

These symbols are also exposed to NDK clients since we may want to CFI
for unbundled apps.

Bug: 63053790
Bug: 63342219
Test: BOARD_VNDK_VERSION=current m -j libstagefright_foundation.vendor

Change-Id: I081deddb4f66354aaecec4b395d4e17e5566c578
2017-07-13 10:18:56 +09:00
Treehugger Robot
87a47e1bb2 Merge "linker: add android_get_exported_namespace" 2017-05-02 01:37:04 +00:00
Jiyong Park
01de74e76d linker: add android_get_exported_namespace
Depending on how ld.config.txt is configured, there can be multiple
built-in namespaces created by the linker from the beginning of a
process. android_get_exported_namespace is a platform only API for
getting a handle (android_namespace_t*) to one of the built-in namespaces
with given name. The returned namespace can then be given to
android_dlopen_ext in order to explicitly specify the target namespace
where the library is searched and loaded from.

Note that this function only returns 'exported' namespaces created via
ld.config.txt file. In order to export a namespace, the visible property
should be set to true:

namespace.<name>.visible = true

Namespaces are hidden by default. Hidden namespaces and namespaces
that are created programmatically, notably 'classloader-namespace',
aren't returned by this function.

Bug: 36851137
Test: confirmed that namespaces created with ld.config.txt is retrieved.
Test: linker-unit-tests passes
Merged-in: I714b510fa24f77e42c3dfc4c827b3befa8bb2951
Change-Id: I0d05fa7e0e116009edf8ea362ab46774bc617cbf
(cherry picked from commit d7c4832e6a)
2017-04-28 10:14:28 +09:00
Dan Albert
db98fed03d Make dl_iterate_phdr weak in libdl.
This needs to be defined as weak because it is also defined in libc.a.
Without this, static executables will have a multiple definition
error.

Test: make checkbuild
Bug: None
Change-Id: If2024ef4191c8ab7cf087d21d76fefdc92b58da1
2017-04-25 15:42:42 -07:00
Dan Willemsen
51a9bf1673 Remove .(ll)ndk suffix from (ll)ndk_library
Soong handles these automatically now.

Bug: 33241851
Test: Android-aosp_arm.mk is the same before/after
Test: build.ninja is the same before/after
Test: build-aosp_arm.ninja is the same before/after
Merged-In: Ibfe4cf5db732d9007b1cc12dbc523c427de1b23d
Change-Id: Ibfe4cf5db732d9007b1cc12dbc523c427de1b23d
2017-04-11 15:15:30 +00:00
Dan Willemsen
b8f7fde4bd Add LLNDK stub libraries for the VNDK
The stub libraries are the same as the (equivalent version) NDK, but
they also contain symbols tagged with 'vndk'. Except there are none of
those in Bionic currently.

For headers, the LLNDK/VNDK isn't using a sysroot like the NDK. Nor is
it hardcoding an explicit source path list like the platform. Instead it
runs the bionic/libc/include directory through versioner like the NDK,
then exports those generated headers and the kernel headers from the
stub library like any other exported header. Except it uses -isystem
instead of -I due to export_headers_as_system.

Test: aosp_arm; m -j
Test: Enable BOARD_VNDK_VERSION on aosp_arm; m -j
Test: Inspect out/soong/build.ninja before/after (w/o vndk)
Change-Id: Ief58a73907a83053b408b1d4b62999cba470d61c
2017-04-05 22:42:08 +00:00
Dan Willemsen
8229596d41 Enable ld-android on linux_bionic builds
Bug: 31559095
Test: Enable host bionic, run soong
Change-Id: If94927c66c0c2dc74c213ca403d45e73508b0025
2017-03-15 14:24:40 -07:00
Dimitry Ivanov
7a34b9d57a 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
2017-02-09 23:26:44 -08:00
Evgenii Stepanov
68ecec1965 Fix CFI initialization crash on x86.
Third try.

Bug: 34752378
Test: bionic tests
Change-Id: I247c127489a8ee38404e104f28d916a704e35f36
2017-02-02 14:44:46 -08:00
Evgenii Stepanov
beb3eb1790 Revert "Fix CFI initialization crash on x86."
Breaks aosp-master/sdk.

This reverts commit 4ccd4317f9.
2017-01-31 17:10:03 -08:00
Evgenii Stepanov
4ccd4317f9 Fix CFI initialization crash on x86.
Second try.

Bug: 34752378
Test: bionic tests
Change-Id: I0a7453154671918b2e6e72f0bb9074c29ceb0f34
2017-01-31 13:44:55 -08:00
Alex Cheung
6fcd7a7d28 Revert "Fix CFI initialization crash on x86."
This reverts commit be46d3871c.

Reverting due to broken build:

https://android-build.googleplex.com/builds/branch-dashboard/aosp-master?build_id=3687823

Change-Id: I30968398edd9a094fce878839ba0a002ed487a77
2017-01-31 04:19:50 +00:00
Evgenii Stepanov
be46d3871c Fix CFI initialization crash on x86.
Bug: 34752378
Test: bionic tests
Change-Id: If8e33f76a1a2d83356d818fed506ea624f579860
2017-01-30 14:29:48 -08:00
Evgenii Stepanov
0a3637d3eb Runtime support for CFI
Control Flow Integrity support in bionic.

General design:
http://clang.llvm.org/docs/ControlFlowIntegrityDesign.html#shared-library-support

This CL implements subsections "CFI Shadow" and "CFI_SlowPath" in the above document.

Bug: 22033465
Test: bionic device tests
Change-Id: I14dfea630de468eb5620e7f55f92b1397ba06217
2017-01-18 13:13:52 -08:00
Dimitry Ivanov
ac4bd2f793 Add test for elf-hash and packed relocations
This adds CTS test for system libraries to support
workaround for http://b/24465209: some apps require
a subset of system libs to have elf-hash and not to
use packed relocations.

Bug: http://b/32917341
Bug: http://b/24465209
Test: bionic-unit-tests --gtest_filter=Dl*:dl*
Change-Id: Ia0bc28506b1f1f97d4cf902d73b0769e2815fed3
2016-12-14 11:16:21 -08:00
Dimitry Ivanov
4e84d5e4fa Repair dlwarning toast
This was introduced by d9e427cf41
where libdl.c android_dlwarning method implementation was
not updated.

This makes it delegate the call to ld-android.so

Bug: http://b/33530622
Test: build, flash and launch test app
Change-Id: I8a379442de94724280638db73e5f7934f2ea394e
2016-12-12 16:21:46 -08:00
Dimitry Ivanov
d9e427cf41 Bionic loader is no longer hijacking libdl.so
Do not hijack libdl.so methods but make libdl proxy calls to
loader instead. This will be replaces by calls to libc.so
once loader functionality is migrated.

Also add a lock to dl_unwind_find_exidx function call.

Test: bionic-unit-tests --gtest_filter=dl*:Dl*
Bug: http://b/27106625
Change-Id: Ic33a7109a86f4262798d63a35f4c61d15b0068bb
2016-12-09 14:53:59 -08:00
Andreas Gampe
dcb846cb49 Revert "Bionic loader is no longer hijacking libdl.so"
This reverts commit c12acef96b.

Breaks the Mips build.

Bug: 27106625
Change-Id: I27edb7114065c36e1b618e387530d58189cdb184
2016-12-06 02:10:13 +00:00
Dimitry Ivanov
c12acef96b Bionic loader is no longer hijacking libdl.so
Do not hijack libdl.so methods but make libdl proxy calls to
loader instead. This will be replaces by calls to libc.so
once loader functionality is migrated.

Also add a lock to dl_unwind_find_exidx function call.

Test: bionic-unit-tests --gtest_filter=dl*:Dl*
Bug: http://b/27106625
Change-Id: I9e666e771e4bbca52151cfa7fc4c8677e1480818
2016-12-05 11:19:19 -08:00
Dan Willemsen
7ec52b12ef Enable libc/libdl/libm/linker for host bionic
Disables debuggerd integration unless building for android.

Bug: 31559095
Test: Diff out/soong/build.ninja before/after, only change is moving
      linker's libdebuggerd_client static lib to the beginning of the
      list.
Test: lunch aosp_arm64-eng; mmma -j bionic
Change-Id: I62e725f7a9b98b7fe31637d0a835fd5846b0aff0
2016-11-29 21:09:05 +00:00
Dan Albert
c30862fdbc One NOTICE file to rule them all.
Generate a single NOTICE file rather than one per library. All the
headers come from libc these days anyway.

Test: tools/update_notice.sh
Bug: None
Change-Id: I127da185fdabc2815042e19aea74c507ec108f46
2016-10-20 11:48:55 -07:00
Treehugger Robot
166f875eab Merge "dlerror returns char*, not const char*." 2016-08-11 23:16:59 +00:00
Elliott Hughes
5e071a18ce dlerror returns char*, not const char*.
http://pubs.opengroup.org/onlinepubs/9699919799/functions/dlerror.html:

    char *dlerror(void);
    ...
    The application shall not modify the string returned.

Change-Id: I5e684bfd3930c39a2a30ea6fd005a5d5d3e5b181
2016-08-11 15:02:45 -07:00
Treehugger Robot
4519a4d182 Merge "Add ndk_library for libdl." 2016-08-11 01:33:31 +00:00
Elliott Hughes
77a3e28e2e Update NOTICE files.
Change-Id: I591dc91b54804aebc05ba6f9974ef9add660ecfe
2016-08-08 12:39:56 -07:00
Dan Albert
e8a9108b4b Add ndk_library for libdl.
Test: make checkbuild
Bug: http://b/30465923
Change-Id: I8acf82f319d3b22948868bc5c4c377f2348af266
2016-08-05 09:36:48 -07:00
Dan Albert
c8a95a3b15 Run genversion-scripts.py.
Change-Id: I01c4d9a85d3397b02b00b4d33fafe6d9ae692ed7
2016-08-04 15:39:21 -07:00
Dan Albert
1bcaf53d20 Annotate libdl.map.txt.
Test: readelf diff between soong generated stubs and prebuilts/ndk
Bug: http://b/30465923
Change-Id: Ic34734b40870c8b628449458798c0343648e4e97
2016-08-04 13:43:20 -07:00
Dan Albert
37ba9052b0 Run genversion-scripts.py.
Change-Id: Iecc1b127c67a96aecc4e86582c1cc3291a4acf00
2016-08-02 15:33:53 -07:00
Dimitry Ivanov
769b33fadf Sync linker with internal branch
This change includes dlwarning implementation and
the compatibility greylist for apps targeting pre-N.

Change-Id: Ibf02a07cc58cbbb1a5aef4ac34558c5d43e4305f
Test: Run bionic-unit-tests --gtest_filter=dl*:Dl*
2016-08-01 19:47:27 +00:00
Colin Cross
7510c33b61 Remove deprecated Android.mk files
These directories all have Android.bp files that are always used now,
delete the Android.mk files.

Change-Id: Ib0ba2d28bff88483b505426ba61606da314e03ab
2016-05-26 16:41:57 -07:00
Colin Cross
27c43c505e Update sanitize property format
Change-Id: I2fd35d6d85c7da7e96ffcefcd81350c836f0db9c
2016-04-15 16:36:13 -07:00
Dimitry Ivanov
7a622dacf1 Move linker-namespace functions to LIBC_PLATFORM
Bug: http://b/28174921
Change-Id: I089dbeeea813fc2128b9c2f6268a578d23a1954a
(cherry picked from commit 7095da8d3c)
2016-04-13 16:41:31 -07:00
Greg Hackmann
e5c872ffb7 genversion-scripts: fix script name in autogenerated comment
Change-Id: I2a304818cfc54d08a08d2e621e4cf74e7ce465dd
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2016-03-23 16:25:42 -07:00
Dimitry Ivanov
98cdef39dc libdl: Rename LIBC_PRIVATE to LIBC_PLATFORM
Bug: http://b/26386014
Change-Id: I3255faac66a96867aed302e205e3644b40ce7750
2016-03-02 11:41:22 -08:00
Elliott Hughes
b4931cee76 Update NOTICE files.
Change-Id: I6c4628534c5842c9835ead1bfff6582c5dce38e3
2016-02-08 17:00:12 -08:00
Dimitry Ivanov
7331fe18d7 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 e78deef364)
2015-12-19 23:38:27 -08:00
Dimitry Ivanov
9cf99cbad8 linker: add dlvsym(3)
This changes implements dlvsym - dlsym for versioned symbols.

Bug: http://b/22865643
Change-Id: Ic90a60d512104261a1416c43f9100f0d88e3b46f
2015-12-16 15:24:13 -08:00
Dimitry Ivanov
284ae3559e 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
2015-12-09 13:54:01 -08:00
Dmitriy Ivanov
1ffec1cc4d 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
2015-11-23 16:13:10 -08:00
Dmitriy Ivanov
42d5fcb9f4 Introducing linker namespaces
Bug: http://b/22548808
Change-Id: Ia3af3c0a167f1d16447a3d83bb045d143319b1e1
2015-11-15 12:09:16 -08:00
Dan Willemsen
9e6f98fe9d Update Android.bp with arch-specific version scripts
Change-Id: I59b34f21b54e8a2084bb318a08c4092064f48083
2015-11-03 14:30:57 -08:00
Dmitriy Ivanov
bc75047a1b Generate libdl.so per-architecture version script
Bug: http://b/24767418
Change-Id: I3d5775ba44d4c8e7fc5f2fbebae10e022100f1e2
2015-10-30 17:43:27 -07:00
Dan Willemsen
208ae17e5f Add Android.bp for libc/libm/libdl
Change-Id: I3537363849ba1244348996ff17c5ace1b95dbeee
2015-09-16 16:50:01 -07:00
Elliott Hughes
44ead71726 Regenerate NOTICE files.
Change-Id: Ia5c340220bb75e4e3166cc483ea77d19cfb08a71
2015-08-28 20:23:52 -07:00
Dan Albert
11ea08c5cb Use new sanitizer option.
Change-Id: I21b04a1f3be3b10ee557bf9e0caa5db638686364
2015-06-16 13:57:54 -07:00
Dmitriy Ivanov
79fd668bb4 Add functions to provide target sdk version
Bug: http://b/21364029
Change-Id: I8648d1bff6c8fd6e7cd12da7f128e048b9f2829a
2015-05-27 14:31:36 -07:00
Dan Albert
da194780b1 Disable ASAN for more of our libraries.
Since ASAN depends on these libraries, we need to exclude them from
being instrumented.

Change-Id: I62005b6d04ee7b2283c4bd54ace5304386c67358
2014-12-18 08:03:49 -08:00
Dan Albert
a4ed64d4c3 Add a dummy libdl.a.
Change-Id: I4b30b8875f14352bae2948ab8cf544ae818795ab
2014-09-26 15:23:07 -07:00
Dan Albert
3ec67de051 Exclude libstdc++ from linked libraries.
Also explicitly add libstdc++ includes for necessary targets.

Change-Id: If712ba0ae7908d8147a69e29da5c453a183d6540
2014-09-17 14:22:36 -07:00
Elliott Hughes
d286796fce Turn on -Wunused and fix the mistakes it uncovers.
Change-Id: I023d2d8b547fbc21d4124bb7510d42b06a0dc501
2014-06-03 15:22:34 -07:00
Torne (Richard Coles)
012cb4583a Add android_dlopen_ext() interface to linker.
Add a function "android_dlopen_ext()", defined in <android/dlext.h>.
This is an extended version of dlopen() which takes a struct for passing
additional parameters for Android-specific functionality. This will be
used to support RELRO section sharing between separate processes.

Bug: 13005501
Change-Id: I9c99b2f2a02ee329dedaeba09ef3a1113b17b2d6
2014-04-17 13:50:55 +01:00
Ying Wang
1682c63d77 Use arch-specific variable to set up the x86 ld flags.
Bug: 11654773
Change-Id: I9e9075bac1303cfa39b0f717dd74625ce1dd5fa5
2014-01-24 16:50:16 -08:00
Elliott Hughes
7ac975146e Fix libdl build warnings, turn on -Werror.
Change-Id: I71c39b77ac1e9a92482ce71a829449100945ec86
2014-01-14 17:25:13 -08:00
Elliott Hughes
a4aafd1560 Make it possible for code to query the dynamic linker's default search path.
We're not going to have init(1) set LD_LIBRARY_PATH globally on 64-bit.
This patch makes it possible for libnativehelper to set LD_LIBRARY_PATH
in each Java VM (to support System.loadLibrary) without also hard-coding
the default search path there.

Change-Id: If13961fae976e06dd80d5ef522f31e8b7eb01154
2014-01-13 16:37:47 -08:00
Pavel Chupin
a567a8e4bd x86_64: Update Makefiles for x86_64 targets and add symlinks
Use basic .c versions of all functions for x86_64 until they are
manually optimized and .s versions released.

Change-Id: I59bba08931e894822db485c8803c2665c226234a
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
2013-10-01 15:36:08 -07:00
Christopher Ferris
24053a461e Add the dl_iterate_phdr function to libdl for arm.
Bug: 8410085

Merge from internal master.

(cherry-picked from cb491bc66d)

Change-Id: I94ed51bc5d4c626df7552c0e85c31ccee2d6568f
2013-09-06 09:53:54 -07:00
Kito Cheng
8f7120bbac Drop unnecessary execution permission for .cpp/.c/.h
Change-Id: I9ac2b9d8f6bdb4fab8962210c5ec8f9c3e8c0ebf
2013-03-22 10:28:15 +08:00
Elliott Hughes
cade4c36e7 Support System.loadLibrary for libraries with transitive dependencies.
Also fix the FLAG_ERROR annoyance --- it's not helpful to cache failures.

Bug: 7896159
Bug: http://code.google.com/p/android/issues/detail?id=34416
Bug: http://code.google.com/p/android/issues/detail?id=22143
Change-Id: I60f235edb4ea4756e1f7ce56f7739f18e8a50789
2012-12-20 14:42:14 -08:00
Elliott Hughes
22d629211d Make the dlfcn mutex static.
More style fixes too, and removal of yet another lingering SH reference!

Change-Id: Iebc34a46475dd11845ad172b9108bb6ddd7585bb
2012-10-12 10:50:21 -07:00
Elliott Hughes
32dbc03c73 Regenerate all NOTICE files with the latest version of the script.
This sorts every entry, so we should have more stability and fewer
merge conflicts in future.

Change-Id: Ifc5347dc53352da22c82d41ca59b483966fcfc6b
2012-08-15 15:43:13 -07:00
Elliott Hughes
ae5c64413b Add dependencies on all the makefiles.
This should help prevent broken builds next time I'm messing with
assembler/compiler/linker flags...

Change-Id: I30f15a3ce3c3f3c60cad7bc59aaba9f42d792224
2012-08-13 14:06:05 -07:00
Elliott Hughes
387d4b7de9 Auto-generate a complete NOTICE file.
Remove the hand-collated ones, and switch to a script that pulls the
copyright headers out of every file and collects the unique ones.

Change-Id: Ied3b98b3f56241df97166c410ff81de4e0157c9d
2012-08-09 16:05:31 -07:00
Elliott Hughes
e33af61c70 Remove the last references to SuperH.
Change-Id: Icb44c1f94cb178d90b4c2b1e8f6d175586aec4e1
2012-05-15 17:08:41 -07:00
Chris Dearman
726800e8f4 MIPS support to libm, libdl and libthread_db
Change-Id: I9106721af7fe0cd45df82976250db0d300a20117
Signed-off-by: Raghu Gandham <raghu@mips.com>
2012-05-04 11:34:40 -07:00
Mathias Agopian
bda5da074e fix prototype of dladdr
this breaks C++ source code in particular.

Change-Id: Ie06b5d31d23b5455e6950c470adc64dd5e7784df
2011-09-28 12:17:34 -07:00
Jeff Brown
7e5d19c055 Remove the simulator target from all makefiles.
Bug: 5010576

Change-Id: I9064e3221582fcf3d4210d67f1cf0a96e7e3aa86
2011-07-11 22:11:41 -07:00
Matt Fischer
e2a8b1fd19 Added support for dladdr()
dladdr() is a GNU extension function, which allows the caller to retrieve
symbol information for a specified memory address.  It is useful for things
like generating backtrace information at runtime.

Change-Id: I3a1def1a6c9c666d93e1e97b7d260dfa5b9b79a9
2010-03-17 16:11:37 -05:00
Shin-ichiro KAWASAKI
efecfde19a added and modified libdl to support SuperH architecture 2009-08-31 16:39:32 +09:00
The Android Open Source Project
1dc9e472e1 auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
The Android Open Source Project
1767f908af auto import from //depot/cupcake/@135843 2009-03-03 18:28:13 -08:00
The Android Open Source Project
9f65adf2ba auto import from //branches/cupcake/...@130745 2009-02-10 15:43:56 -08:00
The Android Open Source Project
4e468ed2eb Code drop from //branches/cupcake/...@124589 2008-12-17 18:03:48 -08:00
The Android Open Source Project
a27d2baa0c Initial Contribution 2008-10-21 07:00:00 -07:00