Compare commits

...

76 Commits

Author SHA1 Message Date
Elliott Hughes
195b85a80f Merge "Defend against -fstack-protector in libc startup." 2016-01-08 18:54:01 +00:00
Dimitry Ivanov
2afe5af77f Merge "Move __aeabi* symbols to LIBC_N version" 2016-01-08 18:50:13 +00:00
Dimitry Ivanov
6d142bcf34 Move __aeabi* symbols to LIBC_N version
We had these symbols incorrectly versioned as LIBC_PRIVATE
in M release. This change moves __aeabi* symbols from LIBC
to LIBC_N and adds __gnu_Unwind_Find_exidx to the list

Bug: https://github.com/android-ndk/ndk/issues/1
Change-Id: I0b353012adeacb00ae29ea10c63b9d1cf1cadbe7
2016-01-08 10:13:16 -08:00
Elliott Hughes
42d949ff9d Defend against -fstack-protector in libc startup.
Exactly which functions get a stack protector is up to the compiler, so
let's separate the code that sets up the environment stack protection
requires and explicitly build it with -fno-stack-protector.

Bug: http://b/26276517
Change-Id: I8719e23ead1f1e81715c32c1335da868f68369b5
2016-01-06 20:06:08 -08:00
Josh Gao
988e71b2b2 Merge "Kill BOARD_MALLOC_ALIGNMENT." 2016-01-06 22:49:30 +00:00
Josh Gao
63a42070fc Kill BOARD_MALLOC_ALIGNMENT.
Bug: http://b/26403338
Change-Id: Iba4006277fdb7c7ca60542c517634ae86c847b4f
2016-01-06 14:30:26 -08:00
Josh Gao
e1f8c66d0b Merge "Replace MALLOC_IMPL with MALLOC_SVELTE." 2016-01-06 20:08:13 +00:00
Elliott Hughes
32388ba4dc Merge "Temporary hack to avoid stack protector crashes." 2016-01-06 19:52:43 +00:00
Tom Cherry
9353089262 Merge "Revert "system_properties.cpp: special case ro.* properties"" 2016-01-06 19:16:31 +00:00
Tom Cherry
e97ce31fe7 Revert "system_properties.cpp: special case ro.* properties"
This reverts commit c5fd81ab2524a06be907d9c5234e79346bbbbd7c.

Bug: 26416032

Change-Id: Id2d6761fdf55efa28c0b08b597daaa5cd381d758
2016-01-06 19:13:54 +00:00
Elliott Hughes
2489161ce5 Temporary hack to avoid stack protector crashes.
It'll take me a while to refactor things cleanly, but if we just want
something that boots for testing...

Bug: http://b/26276517
Change-Id: I24729d3dc546e36e0eff383f0d1d05c3aa1f2e0b
2016-01-06 11:12:06 -08:00
Elliott Hughes
1464f6d8d9 Merge "Remove mktime_tz." 2016-01-06 19:02:19 +00:00
Dimitry Ivanov
4664c14fa4 Merge "Temporary move __udivdi3 back to LIBC for x86" 2016-01-06 18:37:19 +00:00
Dimitry Ivanov
bc02fb964a Temporary move __udivdi3 back to LIBC for x86
Bug: http://b/26289334
Bug: http://b/26413821
Change-Id: Ifb0eb6f16aca54cb4a9184a6394992ee57dd3408
2016-01-06 18:36:40 +00:00
Elliott Hughes
76dfa6e351 Remove mktime_tz.
Bug: http://b/15765976
Change-Id: Ifc8cd19ae621e611d66173ae927ef9a0445965c1
2016-01-06 09:15:02 -08:00
Dimitry Ivanov
74d7aa1c34 Merge "Fix gcc+arm builds" 2016-01-06 04:43:26 +00:00
Dimitry Ivanov
6f72fdede8 Fix gcc+arm builds
gcc requires unique names of symbols for .symver

Bug: http://b/26391427
Change-Id: I6392e34a45a37245fd4e53fb54243be73f443313
2016-01-05 20:41:06 -08:00
Dimitry Ivanov
52fd4ca0a0 Merge "Deprecate bzero" 2016-01-06 02:33:41 +00:00
Dimitry Ivanov
609156e266 Merge "Export public __aeabi* symbols as LIBC_PRIVATE" 2016-01-06 02:19:27 +00:00
Dimitry Ivanov
d90d067312 Export public __aeabi* symbols as LIBC_PRIVATE
But keep LIBC as default version for them

Bug: http://b/26391427
Bug: http://b/26410625
Change-Id: I819e354bbba482d1f983d9be15c23fcce10e5dd9
2016-01-05 18:18:33 -08:00
Elliott Hughes
031dfe198b Merge "Fix a broken link in a comment." 2016-01-06 01:27:09 +00:00
Elliott Hughes
7d27b68ef4 Merge "Tidy up KernelArgumentBlock::getauxval." 2016-01-06 01:24:37 +00:00
Dimitry Ivanov
6134ed8b8f Deprecate bzero
bzero is hashdefined to memset in strings.h and it
was removed from POSIX 2008.

Bug: http://b/26407170
Change-Id: Ia6d54f0e314dc7f5f3fbad0e9b00344f49f77d43
2016-01-05 17:06:45 -08:00
Nick Kralevich
ffa54cd7ba Merge "system_properties.cpp: special case ro.* properties" 2016-01-06 00:43:48 +00:00
Elliott Hughes
40c2bf6cf6 Fix a broken link in a comment.
Bug: https://code.google.com/p/android/issues/detail?id=197784
Change-Id: I2f9e5bc2dd2b8a6992c7c55bc856e4a323c7c8a8
2016-01-05 16:33:33 -08:00
Nick Kralevich
c5fd81ab25 system_properties.cpp: special case ro.* properties
Currently, reads of ro.* properties are treated differently than
writes of ro.* properties. When writing an ro.* property, we ignore
the "ro." portion of the property, and base the security decision
on the label of the remaining portion.

See e7a9e52740/init/property_service.cpp
line 120-126

For example, for writing, the label associated with
"ro.build.fingerprint" comes from the /property_contexts file
entry:

  # ro.build.fingerprint is either set in /system/build.prop, or is
  # set at runtime by system_server.
  build.fingerprint       u:object_r:fingerprint_prop:s0

However, we fail to follow this same special case when sorting
properties into files. Instead, ro.build.fingerprint is assigned
u:object_r:default_prop:s0 instead of u:object_r:fingerprint_prop:s0

Ignore the "ro." portion when sorting properties into files.
This will make reads and writes of properties use the same label.

Bug: 21852512
Change-Id: Ie88ffc6b78b31fc8ddf370ae27c218546fb25a83
2016-01-05 16:30:17 -08:00
Elliott Hughes
63fbb233cb Tidy up KernelArgumentBlock::getauxval.
Correct the comment, and remove the unused functionality. getauxval(3) does
now set errno to let you know it failed to find anything, but since none of
this function's callers care anyway it seems safer to leave errno untouched
until we actually have a demonstrated need for it.

Bug: https://code.google.com/p/android/issues/detail?id=198111
Change-Id: I232a42dc5a02c8faab94c7d69bef610408276c23
2016-01-05 16:29:33 -08:00
Dan Willemsen
507d6f2a51 Merge "libc: Update Android.bp with recent changes" 2016-01-05 23:14:43 +00:00
Dan Willemsen
9b59acc9c7 libc: Update Android.bp with recent changes
Change-Id: I54047df9db95169452bbac6d52c75161d2f3bb64
2016-01-05 14:32:54 -08:00
Dimitry Ivanov
e647db7485 Merge "Move __aeabi_ which are not in libgcc.a to LIBC" 2016-01-05 22:07:02 +00:00
Dimitry Ivanov
bb5730ecdb Move __aeabi_ which are not in libgcc.a to LIBC
The following arm symbols should be exported by libc.so:
    __aeabi_atexit; # arm
    __aeabi_memclr; # arm
    __aeabi_memclr4; # arm
    __aeabi_memclr8; # arm
    __aeabi_memcpy; # arm
    __aeabi_memcpy4; # arm
    __aeabi_memcpy8; # arm
    __aeabi_memmove; # arm
    __aeabi_memmove4; # arm
    __aeabi_memmove8; # arm
    __aeabi_memset; # arm
    __aeabi_memset4; # arm
    __aeabi_memset8; # arm

Bug: https://github.com/android-ndk/ndk/issues/1
Change-Id: I542d1ad023b8aece5dc05a28a9ca549cb51455b4
2016-01-05 13:59:20 -08:00
Josh Gao
09f4651c0e Replace MALLOC_IMPL with MALLOC_SVELTE.
Bug: http://b/26390299
Change-Id: I665f64bff4d598607e1eb7c4078819fe1d400feb
2016-01-05 11:45:45 -08:00
Elliott Hughes
c6c3b47be2 Merge "Clarify which linker we are." 2016-01-05 19:38:47 +00:00
Elliott Hughes
116b5698d4 Clarify which linker we are.
Also, we're not a debugger.

Also include LD_LIBRARY_PATH and LD_PRELOAD because they would have helped
diagnose a recent issue.

Change-Id: I7237a7236b7140ab49483c02efa705317d07bd3f
2016-01-05 11:06:50 -08:00
Dimitry Ivanov
ff164ef661 Merge "Temporary apply LIBC version to __pthread_gettid" 2016-01-05 08:22:24 +00:00
Dimitry Ivanov
0ef1d121b5 Temporary apply LIBC version to __pthread_gettid
This is workaround for http://b/26391427

Bug: http://b/26391427
Change-Id: Ibf5c611cf4c04dfa595644225e6d9503089a18da
2016-01-05 00:19:13 -08:00
Dimitry Ivanov
c1113a3fc7 Merge "Revert "Temporary apply LIBC version to __pthread_gettid"" 2016-01-05 08:04:17 +00:00
Dimitry Ivanov
c8bb96a163 Revert "Temporary apply LIBC version to __pthread_gettid"
This reverts commit eb90e91cb5872f6aac7008b0c83e103d396be196.

Change-Id: I63450087b6d3c23218b77d5eee37965f254a82d6
2016-01-05 08:03:56 +00:00
Dimitry Ivanov
56ecf28014 Merge "Temporary apply LIBC version to __pthread_gettid" 2016-01-05 07:02:15 +00:00
Dimitry Ivanov
eb90e91cb5 Temporary apply LIBC version to __pthread_gettid
This is workaround for http://b/26391427

Bug: http://b/26391427
Change-Id: I4ccc56e8b1bd2597f267df9706a33bb635abcfcb
2016-01-04 22:36:18 -08:00
Dimitry Ivanov
04673ee997 Merge changes I4fc241e6,Idca71396
* changes:
  Move __system_property* to LIBC_PRIVATE for lp64 libc
  Move ndk-cruft symbols to LIBC_PRIVATE
2016-01-04 22:52:21 +00:00
Dimitry Ivanov
ff14fb5a1f Move __system_property* to LIBC_PRIVATE for lp64 libc
Bug: http://b/26367254
Change-Id: I4fc241e69444a4b5641dfdf09576fe3ce5c1169e
2016-01-04 14:39:42 -08:00
Dimitry Ivanov
eac1d371f6 Move ndk-cruft symbols to LIBC_PRIVATE
Bug: http://b/26385283
Change-Id: Idca71396f9de4141eefc4e1851ba92ebff1ac792
2016-01-04 13:48:47 -08:00
Elliott Hughes
e13434f9da Merge "Revert "Revert "Implement getifaddrs(3)/freeifaddrs(3).""" 2016-01-04 21:03:48 +00:00
Elliott Hughes
9cddb482b4 Revert "Revert "Implement getifaddrs(3)/freeifaddrs(3).""
This reverts commit 76814a8250fd5e1502909ef5e10e4d166cc96c0e.

This differs from the original in fixing the GCC -Werror build:

  bionic/libc/bionic/ifaddrs.cpp: In function 'void __handle_netlink_response(ifaddrs**, nlmsghdr*)':
  bionic/libc/bionic/ifaddrs.cpp:113:62: error: use of old-style cast [-Werror=old-style-cast]
       ifinfomsg* ifi = reinterpret_cast<ifinfomsg*>(NLMSG_DATA(hdr));

This appears to be a GCC bug; the GCC command-line correctly uses -isystem,
and manually adding #pragma GCC system_header doesn't help. So just turn the
warning off for GCC for now. We won't need to worry about building with GCC
soon anyway.

Bug: http://b/26238832
Change-Id: I01615bd335edf11baf487b1c83a9157cd780f4a1
2016-01-04 13:00:39 -08:00
Dimitry Ivanov
2fed6aa9f0 Merge changes Ic66f6519,Ic16acea5
* changes:
  Make some of unwanted symbols LIBC_PRIVATE
  Make symbols exported via libgcc.a LIBC_PRIVATE
2016-01-04 18:55:42 +00:00
Nick Kralevich
fa8b9312d9 Merge "Add tests for /proc/self/fd and /proc/self/task/TID/fd access" 2015-12-24 04:02:47 +00:00
Nick Kralevich
bd4d45d55b Add tests for /proc/self/fd and /proc/self/task/TID/fd access
Add tests to ensure that the following kernel patches are present:

  __ptrace_may_access() should not deny sub-threads
  * https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=73af963f9f3036dffed55c3a2898598186db1045

  proc: make proc_fd_permission() thread-friendly
  * https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=96d0df79f2644fc823f26c06491e182d87a90c2a

  proc: actually make proc_fd_permission() thread-friendly
  * https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=54708d2858e79a2bdda10bf8a20c80eb96c20613

Bug: 26110743
Bug: 24912743
Bug: 26016905
Change-Id: I7eab002ddfade9e4bfe51908e190231c8dde2cc7
2015-12-23 17:42:29 -08:00
Yi Kong
b62e633ff6 Merge "Revert "Implement getifaddrs(3)/freeifaddrs(3)."" 2015-12-22 17:48:21 +00:00
Yi Kong
76814a8250 Revert "Implement getifaddrs(3)/freeifaddrs(3)."
Werror build broken. Revert while working on a fix.

This reverts commit 0945ed5cc5921243724fed4465d20881f4891a8d.

Change-Id: I67edab7a7a3b9aa673ce9d14aa95380f947838a1
2015-12-22 17:47:54 +00:00
Yi Kong
71417caa92 Merge "Implement getifaddrs(3)/freeifaddrs(3)." 2015-12-22 17:11:59 +00:00
Dimitry Ivanov
788a2bc756 Make some of unwanted symbols LIBC_PRIVATE
Bug: http://b/26274444
Change-Id: Ic66f6519a974b72779071235c1d0dd36655fd1b9
2015-12-21 23:26:53 -08:00
Dimitry Ivanov
5ce79b0af3 Make symbols exported via libgcc.a LIBC_PRIVATE
Bug: http://b/26298172
Change-Id: Ic16acea56624680d48c0b190fbe5a6142a3fca2b
2015-12-21 22:54:35 -08:00
Dimitry Ivanov
be7c7fe218 Merge "linker: implement shared namespaces" 2015-12-21 23:10:49 +00: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 e78deef364d952dd1141a2f3067a12060aaf11e6)
2015-12-19 23:38:27 -08:00
Elliott Hughes
0945ed5cc5 Implement getifaddrs(3)/freeifaddrs(3).
Time to dust off the old libcore implementation from gingerbread and add it
to bionic. Unlike the original, this actually looks at both RTM_NEWLINK and
RTM_NEWADDR.

Bug: http://b/26238832
Change-Id: I7bb4b432deb766065b66b9c9ff36ed68249aba82
2015-12-19 14:49:09 -08:00
Elliott Hughes
4afd635be1 Merge "Improve the 32-bit ABI documentation." 2015-12-19 21:47:07 +00:00
Elliott Hughes
59fc2e8557 Improve the 32-bit ABI documentation.
Change-Id: Ie5bfc8d6f7f3946100f653de0e006072e56e18d6
2015-12-19 09:36:16 -08:00
Tom Cherry
dd57119ced Merge "Reset access to system properties on reinitialization" 2015-12-17 17:54:05 +00:00
Elliott Hughes
7cb3c4af13 Merge "sem_timedwait with a null timeout doesn't mean "forever"." 2015-12-17 01:15:15 +00:00
Dimitry Ivanov
d4f86aed42 Merge "linker: add dlvsym(3)" 2015-12-17 00:40:13 +00:00
Christopher Ferris
27032a39dd Merge "Fix missing parentheses." 2015-12-17 00:30:59 +00:00
Christopher Ferris
0b13f29b2c Fix missing parentheses.
The BIONIC_ROUND_UP_POWER_OF_2 macro did not have parentheses around
the whole expression. This lead to the wrong value being computed when
used as part of a mathematical expression such as this:

  value = BIONIC_ROUND_UP_POWER_OF_2(value) - 1;

This only happens on 64 bit abis.

Change-Id: I6f8afbdaf16fe64a88fa0246d074b3534c9159c1
2015-12-16 16:11:04 -08:00
Christopher Ferris
9f20db1c94 Merge "Fix bug in dlmalloc's version of calloc." 2015-12-17 00:06:03 +00: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
Elliott Hughes
dd586f2ebd sem_timedwait with a null timeout doesn't mean "forever".
It actually means "crash immediately". Well, it's an error. And callers are
much more likely to realize their mistake if we crash immediately rather
than return EINVAL. Historically, glibc has crashed and bionic -- before
the recent changes -- returned EINVAL, so this is a behavior change.

Change-Id: I0c2373a6703b20b8a97aacc1e66368a5885e8c51
2015-12-16 15:15:58 -08:00
Christopher Ferris
ad33ebead8 Fix bug in dlmalloc's version of calloc.
Under some circumstances, doing a calloc will make sure that the memory
returned will be zero up to the size of the requested size. However, if
there is more usable size than the requested size, that extra part
of the allocation will not be zeroed. This change fixes it so that the
entire usable memory is always zeroed.

Change-Id: I8a66d6767c074023c4ba3568bf2705e1886740fc
2015-12-16 14:48:03 -08:00
Dimitry Ivanov
d3e5301a75 Merge "Revert "Revert "Remove remaining ndk_cruft from LP64 platforms""" 2015-12-16 19:06:09 +00:00
Dimitry Ivanov
bc2e88a85d Revert "Revert "Remove remaining ndk_cruft from LP64 platforms""
This reverts commit 23af25b747b5e7b0ca513a87b32f1f6a3cb99698.

Bug: http://b/26164862
Change-Id: I201bf49530f33f8ba6a1a35b79723afb9e84c7a5
2015-12-16 19:02:04 +00:00
Elliott Hughes
4d57e669dc Merge "Add a few missing pthread tests." 2015-12-15 01:38:24 +00:00
Dimitry Ivanov
52a05f3ce7 Merge "Revert "Remove remaining ndk_cruft from LP64 platforms"" 2015-12-15 01:36:19 +00:00
Elliott Hughes
d31d4c1cc6 Add a few missing pthread tests.
This seems to be all that's tested by system/extras/tests/bionic that isn't
already better tested here.

Change-Id: Id0aa985cefd4047a6007ba9804f541069d9e92ed
2015-12-14 17:35:10 -08:00
Dimitry Ivanov
23af25b747 Revert "Remove remaining ndk_cruft from LP64 platforms"
This reverts commit b1d0a2ae7790f882d8f1ab24d7ef15e2b90c8ca2.

Change-Id: I1da06be0b78a4f2a4cad7e4a19a3ee755f55a813
2015-12-15 01:34:14 +00:00
Dimitry Ivanov
b34ae08cc6 Merge "Remove remaining ndk_cruft from LP64 platforms" 2015-12-14 23:55:55 +00:00
Dimitry Ivanov
b1d0a2ae77 Remove remaining ndk_cruft from LP64 platforms
This change removes endpwent, dlmalloc_inspect_all, dlmalloc_trim
from lp64 libc.so. It also removed necessety of having brillo
version scripts for lp64 platforms.

Bug: http://b/26164862
Change-Id: I4e9b38907bb1dc410f0eb6d2f5d5944fe713da51
2015-12-14 15:49:28 -08:00
Tom Cherry
b417169d80 Reset access to system properties on reinitialization
Treat subsequent calls to __system_properties_init() as a
reinitialization of system properties and revoke access to prop files
that have been previously mapped but that the process's current context
does not have access to.  Additionally reset the no_access_ flag in
case permissions have loosened and previously unaccessible files can now
be accessed.

This is meant to work around an issue that setcon() does not revoke
mmap() mappings, so we must manually revoke them after a successful
setcon() call.

Bug 26114086

Change-Id: I4d690abb6817283ca64ac26ea4c1dad398a98fbc
2015-12-11 11:16:21 -08:00
62 changed files with 1806 additions and 4467 deletions

View File

@ -169,9 +169,10 @@ As mentioned above, this is currently a two-step process:
Updating tzdata
---------------
This is fully automated:
This is fully automated (and these days handled by the libcore team, because
they own icu, and that needs to be updated in sync with bionic):
1. Run update-tzdata.py.
1. Run update-tzdata.py in external/icu/tools/.
Verifying changes
@ -268,18 +269,22 @@ However, this also makes it difficult to run the tests under GDB. To prevent
each test from being forked, run the tests with the flag `--no-isolate`.
LP32 ABI bugs
-------------
32-bit ABI bugs
---------------
This probably belongs in the NDK documentation rather than here, but these
are the known ABI bugs in LP32:
are the known ABI bugs in the 32-bit ABI:
* `time_t` is 32-bit. <http://b/5819737>
* `time_t` is 32-bit. <http://b/5819737>. In the 64-bit ABI, time_t is
64-bit.
* `off_t` is 32-bit. There is `off64_t`, but no `_FILE_OFFSET_BITS` support.
Many of the `off64_t` functions are missing in older releases, and
stdio uses 32-bit offsets, so there's no way to fully implement
`_FILE_OFFSET_BITS`.
* `off_t` is 32-bit. There is `off64_t`, and in newer releases there is
almost-complete support for `_FILE_OFFSET_BITS`. Unfortunately our stdio
implementation uses 32-bit offsets and -- worse -- function pointers to
functions that use 32-bit offsets, so there's no good way to implement
the last few pieces <http://b/24807045>. In the 64-bit ABI, off_t is
off64_t.
* `sigset_t` is too small on ARM and x86 (but correct on MIPS), so support
for real-time signals is broken. <http://b/5828899>
for real-time signals is broken. <http://b/5828899> In the 64-bit ABI,
`sigset_t` is the correct size for every architecture.

View File

@ -112,11 +112,6 @@ cc_defaults {
device_uses_dlmalloc: {
cflags: ["-DUSE_DLMALLOC"],
},
// To customize dlmalloc's alignment, set BOARD_MALLOC_ALIGNMENT in
// the appropriate BoardConfig.mk file.
dlmalloc_alignment: {
cflags: ["-DMALLOC_ALIGNMENT=%d"],
},
},
// Clang/llvm has incompatible long double (fp128) for x86_64.
// https://llvm.org/bugs/show_bug.cgi?id=23897
@ -1348,6 +1343,7 @@ cc_library_static {
"bionic/getpid.cpp",
"bionic/gettid.cpp",
"bionic/__gnu_basename.cpp",
"bionic/ifaddrs.cpp",
"bionic/inotify_init.cpp",
"bionic/ioctl.cpp",
"bionic/lchown.cpp",
@ -1766,7 +1762,6 @@ cc_library {
nocrt: true,
// special for arm
arch: {
arm: {
//TODO: This is to work around b/24465209. Remove after root cause is fixed
@ -1774,6 +1769,11 @@ cc_library {
// Don't re-export new/delete and friends, even if the compiler really wants to.
version_script: "libc.arm.map",
product_variables: {
brillo: {
version_script: "libc.arm.brillo.map",
},
},
shared: {
srcs: ["arch-arm/bionic/exidx_dynamic.c"],
@ -1781,6 +1781,8 @@ cc_library {
static: {
srcs: ["arch-arm/bionic/exidx_static.c"],
},
// special for arm
cflags: ["-DCRT_LEGACY_WORKAROUND"],
srcs: [
"arch-arm/bionic/atexit_legacy.c",
@ -1793,6 +1795,11 @@ cc_library {
mips: {
// Don't re-export new/delete and friends, even if the compiler really wants to.
version_script: "libc.mips.map",
product_variables: {
brillo: {
version_script: "libc.mips.brillo.map",
},
},
},
mips64: {
// Don't re-export new/delete and friends, even if the compiler really wants to.
@ -1804,6 +1811,11 @@ cc_library {
// Don't re-export new/delete and friends, even if the compiler really wants to.
version_script: "libc.x86.map",
product_variables: {
brillo: {
version_script: "libc.x86.brillo.map",
},
},
},
x86_64: {
// Don't re-export new/delete and friends, even if the compiler really wants to.

View File

@ -149,6 +149,7 @@ libc_bionic_ndk_src_files := \
bionic/getpid.cpp \
bionic/gettid.cpp \
bionic/__gnu_basename.cpp \
bionic/ifaddrs.cpp \
bionic/inotify_init.cpp \
bionic/ioctl.cpp \
bionic/lchown.cpp \
@ -644,7 +645,7 @@ ifeq ($(strip $(DEBUG_BIONIC_LIBC)),true)
libc_common_cflags += -DDEBUG
endif
ifeq ($(MALLOC_IMPL),dlmalloc)
ifeq ($(MALLOC_SVELTE),true)
libc_common_cflags += -DUSE_DLMALLOC
libc_malloc_src := bionic/dlmalloc.c
else
@ -653,13 +654,6 @@ else
libc_common_c_includes += external/jemalloc/include
endif
# To customize dlmalloc's alignment, set BOARD_MALLOC_ALIGNMENT in
# the appropriate BoardConfig.mk file.
#
ifneq ($(BOARD_MALLOC_ALIGNMENT),)
libc_common_cflags += -DMALLOC_ALIGNMENT=$(BOARD_MALLOC_ALIGNMENT)
endif
# Define some common conlyflags
libc_common_conlyflags := \
-std=gnu99
@ -690,16 +684,21 @@ endef
# libc_stack_protector.a - stack protector code
# ========================================================
#
# The stack protector code needs to be compiled
# with -fno-stack-protector, since it modifies the
# stack canary.
# Code that implements the stack protector (or that runs
# before TLS has been set up) needs to be compiled with
# -fno-stack-protector, since it accesses the stack canary
# TLS slot.
include $(CLEAR_VARS)
LOCAL_SRC_FILES := bionic/__stack_chk_fail.cpp
# On x86, the __set_tls implementation is complex enough that
# -fstack-protector-strong inserts a check.
LOCAL_SRC_FILES := \
bionic/__libc_init_main_thread.cpp \
bionic/__stack_chk_fail.cpp \
LOCAL_SRC_FILES_arm64 := arch-arm64/bionic/__set_tls.c
LOCAL_SRC_FILES_x86 := arch-x86/bionic/__set_tls.c
LOCAL_SRC_FILES_x86_64 := arch-x86_64/bionic/__set_tls.c
LOCAL_CFLAGS := $(libc_common_cflags) -fno-stack-protector
LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
LOCAL_CPPFLAGS := $(libc_common_cppflags)
@ -716,6 +715,30 @@ $(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags))
include $(BUILD_STATIC_LIBRARY)
# libc_init_static.cpp also needs to be built without stack protector,
# because it's responsible for setting up TLS for static executables.
# This isn't the case for dynamic executables because the dynamic linker
# has already set up the main thread's TLS.
include $(CLEAR_VARS)
LOCAL_SRC_FILES := bionic/libc_init_static.cpp
LOCAL_CFLAGS := $(libc_common_cflags) -fno-stack-protector
LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
LOCAL_CPPFLAGS := $(libc_common_cppflags)
LOCAL_C_INCLUDES := $(libc_common_c_includes)
LOCAL_MODULE := libc_init_static
LOCAL_CLANG := $(use_clang)
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
LOCAL_CXX_STL := none
LOCAL_SYSTEM_SHARED_LIBRARIES :=
LOCAL_SANITIZE := never
LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags))
include $(BUILD_STATIC_LIBRARY)
# ========================================================
# libc_tzcode.a - upstream 'tzcode' code
# ========================================================
@ -1205,7 +1228,7 @@ LOCAL_WHOLE_STATIC_LIBRARIES := \
LOCAL_WHOLE_STATIC_LIBRARIES_arm := libc_aeabi
LOCAL_CXX_STL := none
ifneq ($(MALLOC_IMPL),dlmalloc)
ifneq ($(MALLOC_SVELTE),true)
LOCAL_WHOLE_STATIC_LIBRARIES += libjemalloc
endif
@ -1277,7 +1300,6 @@ include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
$(libc_arch_static_src_files) \
bionic/libc_init_static.cpp
LOCAL_C_INCLUDES := $(libc_common_c_includes)
LOCAL_CFLAGS := $(libc_common_cflags) \
@ -1289,7 +1311,7 @@ LOCAL_CPPFLAGS := $(libc_common_cppflags)
LOCAL_MODULE := libc_nomalloc
LOCAL_CLANG := $(use_clang)
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
LOCAL_WHOLE_STATIC_LIBRARIES := libc_common
LOCAL_WHOLE_STATIC_LIBRARIES := libc_common libc_init_static
LOCAL_CXX_STL := none
LOCAL_SYSTEM_SHARED_LIBRARIES :=
LOCAL_SANITIZE := never
@ -1329,7 +1351,6 @@ include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
$(libc_arch_static_src_files) \
bionic/malloc_debug_common.cpp \
bionic/libc_init_static.cpp \
LOCAL_CFLAGS := $(libc_common_cflags) \
-DLIBC_STATIC \
@ -1340,9 +1361,9 @@ LOCAL_C_INCLUDES := $(libc_common_c_includes)
LOCAL_MODULE := libc
LOCAL_CLANG := $(use_clang)
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
LOCAL_WHOLE_STATIC_LIBRARIES := libc_common
LOCAL_WHOLE_STATIC_LIBRARIES := libc_common libc_init_static
ifneq ($(MALLOC_IMPL),dlmalloc)
ifneq ($(MALLOC_SVELTE),true)
LOCAL_WHOLE_STATIC_LIBRARIES += libjemalloc
endif
@ -1387,11 +1408,8 @@ LOCAL_ADDITIONAL_DEPENDENCIES := \
$(LOCAL_PATH)/libc.x86.map \
$(LOCAL_PATH)/libc.x86_64.map \
$(LOCAL_PATH)/libc.arm.brillo.map \
$(LOCAL_PATH)/libc.arm64.brillo.map \
$(LOCAL_PATH)/libc.mips.brillo.map \
$(LOCAL_PATH)/libc.mips64.brillo.map \
$(LOCAL_PATH)/libc.x86.brillo.map \
$(LOCAL_PATH)/libc.x86_64.brillo.map \
# Leave the symbols in the shared library so that stack unwinders can produce
# meaningful name resolution.
@ -1411,7 +1429,7 @@ LOCAL_PACK_MODULE_RELOCATIONS := false
LOCAL_SHARED_LIBRARIES := libdl
LOCAL_WHOLE_STATIC_LIBRARIES := libc_common
ifneq ($(MALLOC_IMPL),dlmalloc)
ifneq ($(MALLOC_SVELTE),true)
LOCAL_WHOLE_STATIC_LIBRARIES += libjemalloc
endif
@ -1427,17 +1445,15 @@ ifdef BRILLO
LOCAL_LDFLAGS_arm += -Wl,--version-script,$(LOCAL_PATH)/libc.arm.brillo.map
LOCAL_LDFLAGS_mips += -Wl,--version-script,$(LOCAL_PATH)/libc.mips.brillo.map
LOCAL_LDFLAGS_x86 += -Wl,--version-script,$(LOCAL_PATH)/libc.x86.brillo.map
LOCAL_LDFLAGS_arm64 += -Wl,--version-script,$(LOCAL_PATH)/libc.arm64.brillo.map
LOCAL_LDFLAGS_mips64 += -Wl,--version-script,$(LOCAL_PATH)/libc.mips64.brillo.map
LOCAL_LDFLAGS_x86_64 += -Wl,--version-script,$(LOCAL_PATH)/libc.x86_64.brillo.map
else
LOCAL_LDFLAGS_arm += -Wl,--version-script,$(LOCAL_PATH)/libc.arm.map
LOCAL_LDFLAGS_mips += -Wl,--version-script,$(LOCAL_PATH)/libc.mips.map
LOCAL_LDFLAGS_x86 += -Wl,--version-script,$(LOCAL_PATH)/libc.x86.map
endif
LOCAL_LDFLAGS_arm64 += -Wl,--version-script,$(LOCAL_PATH)/libc.arm64.map
LOCAL_LDFLAGS_mips64 += -Wl,--version-script,$(LOCAL_PATH)/libc.mips64.map
LOCAL_LDFLAGS_x86_64 += -Wl,--version-script,$(LOCAL_PATH)/libc.x86_64.map
endif
# We'd really like to do this for all architectures, but since this wasn't done
# before, these symbols must continue to be exported on LP32 for binary

View File

@ -51,34 +51,62 @@ extern int __cxa_atexit(void (*)(void*), void*, void*);
*/
int __attribute__((weak))
__aeabi_atexit(void *object, void (*destructor) (void *), void *dso_handle) {
__aeabi_atexit_impl(void *object, void (*destructor) (void *), void *dso_handle) {
return __cxa_atexit(destructor, object, dso_handle);
}
int __attribute__((weak))
__aeabi_atexit_impl2(void *object, void (*destructor) (void *), void *dso_handle) {
return __cxa_atexit(destructor, object, dso_handle);
}
void __attribute__((weak))
__aeabi_memcpy8(void *dest, const void *src, size_t n) {
void __attribute__((weak)) __aeabi_memcpy8_impl(void *dest, const void *src, size_t n) {
memcpy(dest, src, n);
}
void __attribute__((weak)) __aeabi_memcpy4(void *dest, const void *src, size_t n) {
void __attribute__((weak)) __aeabi_memcpy4_impl(void *dest, const void *src, size_t n) {
memcpy(dest, src, n);
}
void __attribute__((weak)) __aeabi_memcpy(void *dest, const void *src, size_t n) {
void __attribute__((weak)) __aeabi_memcpy_impl(void *dest, const void *src, size_t n) {
memcpy(dest, src, n);
}
void __attribute__((weak)) __aeabi_memcpy8_impl2(void *dest, const void *src, size_t n) {
memcpy(dest, src, n);
}
void __attribute__((weak)) __aeabi_memcpy4_impl2(void *dest, const void *src, size_t n) {
memcpy(dest, src, n);
}
void __attribute__((weak)) __aeabi_memcpy_impl2(void *dest, const void *src, size_t n) {
memcpy(dest, src, n);
}
void __attribute__((weak)) __aeabi_memmove8(void *dest, const void *src, size_t n) {
void __attribute__((weak)) __aeabi_memmove8_impl(void *dest, const void *src, size_t n) {
memmove(dest, src, n);
}
void __attribute__((weak)) __aeabi_memmove4(void *dest, const void *src, size_t n) {
void __attribute__((weak)) __aeabi_memmove4_impl(void *dest, const void *src, size_t n) {
memmove(dest, src, n);
}
void __attribute__((weak)) __aeabi_memmove(void *dest, const void *src, size_t n) {
void __attribute__((weak)) __aeabi_memmove_impl(void *dest, const void *src, size_t n) {
memmove(dest, src, n);
}
void __attribute__((weak)) __aeabi_memmove8_impl2(void *dest, const void *src, size_t n) {
memmove(dest, src, n);
}
void __attribute__((weak)) __aeabi_memmove4_impl2(void *dest, const void *src, size_t n) {
memmove(dest, src, n);
}
void __attribute__((weak)) __aeabi_memmove_impl2(void *dest, const void *src, size_t n) {
memmove(dest, src, n);
}
@ -87,27 +115,71 @@ void __attribute__((weak)) __aeabi_memmove(void *dest, const void *src, size_t n
* This allows __aeabi_memclr to tail-call __aeabi_memset
*/
void __attribute__((weak)) __aeabi_memset8(void *dest, size_t n, int c) {
void __attribute__((weak)) __aeabi_memset8_impl(void *dest, size_t n, int c) {
memset(dest, c, n);
}
void __attribute__((weak)) __aeabi_memset4(void *dest, size_t n, int c) {
void __attribute__((weak)) __aeabi_memset4_impl(void *dest, size_t n, int c) {
memset(dest, c, n);
}
void __attribute__((weak)) __aeabi_memset(void *dest, size_t n, int c) {
void __attribute__((weak)) __aeabi_memset_impl(void *dest, size_t n, int c) {
memset(dest, c, n);
}
void __attribute__((weak)) __aeabi_memset8_impl2(void *dest, size_t n, int c) {
memset(dest, c, n);
}
void __attribute__((weak)) __aeabi_memset4_impl2(void *dest, size_t n, int c) {
memset(dest, c, n);
}
void __attribute__((weak)) __aeabi_memset_impl2(void *dest, size_t n, int c) {
memset(dest, c, n);
}
void __attribute__((weak)) __aeabi_memclr8(void *dest, size_t n) {
__aeabi_memset8(dest, n, 0);
void __attribute__((weak)) __aeabi_memclr8_impl(void *dest, size_t n) {
__aeabi_memset8_impl(dest, n, 0);
}
void __attribute__((weak)) __aeabi_memclr4(void *dest, size_t n) {
__aeabi_memset4(dest, n, 0);
void __attribute__((weak)) __aeabi_memclr4_impl(void *dest, size_t n) {
__aeabi_memset4_impl(dest, n, 0);
}
void __attribute__((weak)) __aeabi_memclr(void *dest, size_t n) {
__aeabi_memset(dest, n, 0);
void __attribute__((weak)) __aeabi_memclr_impl(void *dest, size_t n) {
__aeabi_memset_impl(dest, n, 0);
}
void __attribute__((weak)) __aeabi_memclr8_impl2(void *dest, size_t n) {
__aeabi_memset8_impl(dest, n, 0);
}
void __attribute__((weak)) __aeabi_memclr4_impl2(void *dest, size_t n) {
__aeabi_memset4_impl(dest, n, 0);
}
void __attribute__((weak)) __aeabi_memclr_impl2(void *dest, size_t n) {
__aeabi_memset_impl(dest, n, 0);
}
#define __AEABI_SYMVERS(fn_name) \
__asm__(".symver " #fn_name "_impl, " #fn_name "@@LIBC_N"); \
__asm__(".symver " #fn_name "_impl2, " #fn_name "@LIBC_PRIVATE")
__AEABI_SYMVERS(__aeabi_atexit);
__AEABI_SYMVERS(__aeabi_memcpy8);
__AEABI_SYMVERS(__aeabi_memcpy4);
__AEABI_SYMVERS(__aeabi_memcpy);
__AEABI_SYMVERS(__aeabi_memmove8);
__AEABI_SYMVERS(__aeabi_memmove4);
__AEABI_SYMVERS(__aeabi_memmove);
__AEABI_SYMVERS(__aeabi_memset8);
__AEABI_SYMVERS(__aeabi_memset4);
__AEABI_SYMVERS(__aeabi_memset);
__AEABI_SYMVERS(__aeabi_memclr8);
__AEABI_SYMVERS(__aeabi_memclr4);
__AEABI_SYMVERS(__aeabi_memclr);
#undef __AEABI_SYMVERS

View File

@ -37,7 +37,13 @@
* the expectation that libc will define it and call through to
* a differently-named function in the dynamic linker.
*/
_Unwind_Ptr __gnu_Unwind_Find_exidx(_Unwind_Ptr pc, int *pcount)
{
_Unwind_Ptr __gnu_Unwind_Find_exidx_impl(_Unwind_Ptr pc, int *pcount) {
return dl_unwind_find_exidx(pc, pcount);
}
_Unwind_Ptr __gnu_Unwind_Find_exidx_impl2(_Unwind_Ptr pc, int *pcount) {
return dl_unwind_find_exidx(pc, pcount);
}
__asm__(".symver __gnu_Unwind_Find_exidx_impl,__gnu_Unwind_Find_exidx@LIBC_PRIVATE");
__asm__(".symver __gnu_Unwind_Find_exidx_impl2,__gnu_Unwind_Find_exidx@@LIBC_N");

View File

@ -42,7 +42,6 @@ libc_bionic_src_files_arm64 += \
arch-arm64/bionic/__bionic_clone.S \
arch-arm64/bionic/_exit_with_stack_teardown.S \
arch-arm64/bionic/setjmp.S \
arch-arm64/bionic/__set_tls.c \
arch-arm64/bionic/syscall.S \
arch-arm64/bionic/vfork.S \

View File

@ -25,7 +25,6 @@ libc_bionic_src_files_x86_64 += \
arch-x86_64/bionic/_exit_with_stack_teardown.S \
arch-x86_64/bionic/__restore_rt.S \
arch-x86_64/bionic/setjmp.S \
arch-x86_64/bionic/__set_tls.c \
arch-x86_64/bionic/syscall.S \
arch-x86_64/bionic/vfork.S \

View File

@ -17,7 +17,8 @@
#include "pthread_internal.h"
struct thread_local_dtor {
class thread_local_dtor {
public:
void (*func) (void *);
void *arg;
void *dso_handle; // unused...

View File

@ -0,0 +1,85 @@
/*
* Copyright (C) 2008 The Android Open Source Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include "libc_init_common.h"
#include "private/bionic_auxv.h"
#include "private/bionic_globals.h"
#include "private/KernelArgumentBlock.h"
#include "pthread_internal.h"
extern "C" int __set_tls(void* ptr);
extern "C" int __set_tid_address(int* tid_address);
// Setup for the main thread. For dynamic executables, this is called by the
// linker _before_ libc is mapped in memory. This means that all writes to
// globals from this function will apply to linker-private copies and will not
// be visible from libc later on.
//
// Note: this function creates a pthread_internal_t for the initial thread and
// stores the pointer in TLS, but does not add it to pthread's thread list. This
// has to be done later from libc itself (see __libc_init_common).
//
// This is in a file by itself because it needs to be built with
// -fno-stack-protector because it's responsible for setting up the main
// thread's TLS (which stack protector relies on).
void __libc_init_main_thread(KernelArgumentBlock& args) {
__libc_auxv = args.auxv;
static pthread_internal_t main_thread;
// The -fstack-protector implementation uses TLS, so make sure that's
// set up before we call any function that might get a stack check inserted.
__set_tls(main_thread.tls);
// Tell the kernel to clear our tid field when we exit, so we're like any other pthread.
// As a side-effect, this tells us our pid (which is the same as the main thread's tid).
main_thread.tid = __set_tid_address(&main_thread.tid);
main_thread.set_cached_pid(main_thread.tid);
// We don't want to free the main thread's stack even when the main thread exits
// because things like environment variables with global scope live on it.
// We also can't free the pthread_internal_t itself, since that lives on the main
// thread's stack rather than on the heap.
// The main thread has no mmap allocated space for stack or pthread_internal_t.
main_thread.mmap_size = 0;
pthread_attr_init(&main_thread.attr);
main_thread.attr.guard_size = 0; // The main thread has no guard page.
main_thread.attr.stack_size = 0; // User code should never see this; we'll compute it when asked.
// TODO: the main thread's sched_policy and sched_priority need to be queried.
__init_thread(&main_thread);
__init_tls(&main_thread);
// Store a pointer to the kernel argument block in a TLS slot to be
// picked up by the libc constructor.
main_thread.tls[TLS_SLOT_BIONIC_PREINIT] = &args;
__init_alternate_signal_stack(&main_thread);
}

241
libc/bionic/ifaddrs.cpp Normal file
View File

@ -0,0 +1,241 @@
/*
* Copyright (C) 2015 The Android Open Source Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <ifaddrs.h>
#include <errno.h>
#include <linux/netlink.h>
#include <linux/rtnetlink.h>
#include <net/if.h>
#include <netinet/in.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
// The public ifaddrs struct is full of pointers. Rather than track several
// different allocations, we use a maximally-sized structure with the public
// part at offset 0, and pointers into its hidden tail.
struct ifaddrs_storage {
// Must come first, so that `ifaddrs_storage` is-a `ifaddrs`.
ifaddrs ifa;
// The interface index, so we can match RTM_NEWADDR messages with
// earlier RTM_NEWLINK messages (to copy the interface flags).
int interface_index;
// Storage for the pointers in `ifa`.
sockaddr_storage addr;
sockaddr_storage netmask;
sockaddr_storage ifa_ifu;
char name[IFNAMSIZ + 1];
ifaddrs_storage(ifaddrs** list) {
memset(this, 0, sizeof(*this));
// push_front onto `list`.
ifa.ifa_next = *list;
*list = reinterpret_cast<ifaddrs*>(this);
}
// Netlink gives us the address family in the header, and the
// sockaddr_in or sockaddr_in6 bytes as the payload. We need to
// stitch the two bits together into the sockaddr that's part of
// our portable interface.
void SetAddress(int family, const void* data, size_t byteCount) {
addr.ss_family = family;
memcpy(SockaddrBytes(family, &addr), data, byteCount);
ifa.ifa_addr = reinterpret_cast<sockaddr*>(&addr);
}
void SetBroadcastAddress(int family, const void* data, size_t byteCount) {
ifa_ifu.ss_family = family;
memcpy(SockaddrBytes(family, &ifa_ifu), data, byteCount);
ifa.ifa_dstaddr = reinterpret_cast<sockaddr*>(&ifa_ifu);
}
// Netlink gives us the prefix length as a bit count. We need to turn
// that into a BSD-compatible netmask represented by a sockaddr*.
void SetNetmask(int family, size_t prefix_length) {
// ...and work out the netmask from the prefix length.
netmask.ss_family = family;
uint8_t* dst = SockaddrBytes(family, &netmask);
memset(dst, 0xff, prefix_length / 8);
if ((prefix_length % 8) != 0) {
dst[prefix_length/8] = (0xff << (8 - (prefix_length % 8)));
}
ifa.ifa_netmask = reinterpret_cast<sockaddr*>(&netmask);
}
private:
// Returns a pointer to the first byte in the address data (which is
// stored in network byte order).
uint8_t* SockaddrBytes(int family, sockaddr_storage* ss) {
if (family == AF_INET) {
sockaddr_in* ss4 = reinterpret_cast<sockaddr_in*>(ss);
return reinterpret_cast<uint8_t*>(&ss4->sin_addr);
} else if (family == AF_INET6) {
sockaddr_in6* ss6 = reinterpret_cast<sockaddr_in6*>(ss);
return reinterpret_cast<uint8_t*>(&ss6->sin6_addr);
}
return nullptr;
}
};
#if !defined(__clang__)
// GCC gets confused by NLMSG_DATA and doesn't realize that the old-style
// cast is from a system header and should be ignored.
#pragma GCC diagnostic ignored "-Wold-style-cast"
#endif
static void __handle_netlink_response(ifaddrs** out, nlmsghdr* hdr) {
if (hdr->nlmsg_type == RTM_NEWLINK) {
ifinfomsg* ifi = reinterpret_cast<ifinfomsg*>(NLMSG_DATA(hdr));
// Create a new ifaddr entry, and set the interface index and flags.
ifaddrs_storage* new_addr = new ifaddrs_storage(out);
new_addr->interface_index = ifi->ifi_index;
new_addr->ifa.ifa_flags = ifi->ifi_flags;
// Go through the various bits of information and find the name.
rtattr* rta = IFLA_RTA(ifi);
size_t rta_len = IFLA_PAYLOAD(hdr);
while (RTA_OK(rta, rta_len)) {
if (rta->rta_type == IFLA_IFNAME) {
if (RTA_PAYLOAD(rta) < sizeof(new_addr->name)) {
memcpy(new_addr->name, RTA_DATA(rta), RTA_PAYLOAD(rta));
new_addr->ifa.ifa_name = new_addr->name;
}
}
rta = RTA_NEXT(rta, rta_len);
}
} else if (hdr->nlmsg_type == RTM_NEWADDR) {
ifaddrmsg* msg = reinterpret_cast<ifaddrmsg*>(NLMSG_DATA(hdr));
// We should already know about this from an RTM_NEWLINK message.
ifaddrs_storage* addr = reinterpret_cast<ifaddrs_storage*>(*out);
while (addr != nullptr && addr->interface_index != static_cast<int>(msg->ifa_index)) {
addr = reinterpret_cast<ifaddrs_storage*>(addr->ifa.ifa_next);
}
// If this is an unknown interface, ignore whatever we're being told about it.
if (addr == nullptr) return;
// Create a new ifaddr entry and copy what we already know.
ifaddrs_storage* new_addr = new ifaddrs_storage(out);
// We can just copy the name rather than look for IFA_LABEL.
strcpy(new_addr->name, addr->name);
new_addr->ifa.ifa_name = new_addr->name;
new_addr->ifa.ifa_flags = addr->ifa.ifa_flags;
new_addr->interface_index = addr->interface_index;
// Go through the various bits of information and find the address
// and any broadcast/destination address.
rtattr* rta = IFA_RTA(msg);
size_t rta_len = IFA_PAYLOAD(hdr);
while (RTA_OK(rta, rta_len)) {
if (rta->rta_type == IFA_ADDRESS) {
if (msg->ifa_family == AF_INET || msg->ifa_family == AF_INET6) {
addr->SetAddress(msg->ifa_family, RTA_DATA(rta), RTA_PAYLOAD(rta));
addr->SetNetmask(msg->ifa_family, msg->ifa_prefixlen);
}
} else if (rta->rta_type == IFA_BROADCAST) {
if (msg->ifa_family == AF_INET || msg->ifa_family == AF_INET6) {
addr->SetBroadcastAddress(msg->ifa_family, RTA_DATA(rta), RTA_PAYLOAD(rta));
}
}
rta = RTA_NEXT(rta, rta_len);
}
}
}
static bool __send_netlink_request(int fd, int type) {
struct NetlinkMessage {
nlmsghdr hdr;
rtgenmsg msg;
} request;
memset(&request, 0, sizeof(request));
request.hdr.nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST;
request.hdr.nlmsg_type = type;
request.hdr.nlmsg_len = sizeof(request);
request.msg.rtgen_family = AF_UNSPEC; // All families.
return (TEMP_FAILURE_RETRY(send(fd, &request, sizeof(request), 0)) == sizeof(request));
}
static bool __read_netlink_responses(int fd, ifaddrs** out, char* buf, size_t buf_len) {
ssize_t bytes_read;
// Read through all the responses, handing interesting ones to __handle_netlink_response.
while ((bytes_read = TEMP_FAILURE_RETRY(recv(fd, buf, buf_len, 0))) > 0) {
nlmsghdr* hdr = reinterpret_cast<nlmsghdr*>(buf);
for (; NLMSG_OK(hdr, static_cast<size_t>(bytes_read)); hdr = NLMSG_NEXT(hdr, bytes_read)) {
if (hdr->nlmsg_type == NLMSG_DONE) return true;
if (hdr->nlmsg_type == NLMSG_ERROR) return false;
__handle_netlink_response(out, hdr);
}
}
// We only get here if recv fails before we see a NLMSG_DONE.
return false;
}
int getifaddrs(ifaddrs** out) {
// Make cleanup easy.
*out = nullptr;
// The kernel keeps packets under 8KiB (NLMSG_GOODSIZE),
// but that's a bit too large to go on the stack.
size_t buf_len = 8192;
char* buf = new char[buf_len];
if (buf == nullptr) return -1;
// Open the netlink socket and ask for all the links and addresses.
int fd = socket(PF_NETLINK, SOCK_RAW | SOCK_CLOEXEC, NETLINK_ROUTE);
bool okay = fd != -1 &&
__send_netlink_request(fd, RTM_GETLINK) && __read_netlink_responses(fd, out, buf, buf_len) &&
__send_netlink_request(fd, RTM_GETADDR) && __read_netlink_responses(fd, out, buf, buf_len);
if (!okay) {
freeifaddrs(*out);
// Ensure that callers crash if they forget to check for success.
*out = nullptr;
}
{
int saved_errno = errno;
close(fd);
delete[] buf;
errno = saved_errno;
}
return okay ? 0 : -1;
}
void freeifaddrs(ifaddrs* list) {
while (list != nullptr) {
ifaddrs* current = list;
list = list->ifa_next;
free(current);
}
}

View File

@ -52,8 +52,6 @@
extern "C" abort_msg_t** __abort_message_ptr;
extern "C" int __system_properties_init(void);
extern "C" int __set_tls(void* ptr);
extern "C" int __set_tid_address(int* tid_address);
__LIBC_HIDDEN__ WriteProtected<libc_globals> __libc_globals;
@ -66,49 +64,6 @@ char** environ;
// Declared in "private/bionic_ssp.h".
uintptr_t __stack_chk_guard = 0;
// Setup for the main thread. For dynamic executables, this is called by the
// linker _before_ libc is mapped in memory. This means that all writes to
// globals from this function will apply to linker-private copies and will not
// be visible from libc later on.
//
// Note: this function creates a pthread_internal_t for the initial thread and
// stores the pointer in TLS, but does not add it to pthread's thread list. This
// has to be done later from libc itself (see __libc_init_common).
void __libc_init_main_thread(KernelArgumentBlock& args) {
__libc_auxv = args.auxv;
static pthread_internal_t main_thread;
// The x86 -fstack-protector implementation uses TLS, so make sure that's
// set up before we call any function that might get a stack check inserted.
__set_tls(main_thread.tls);
// Tell the kernel to clear our tid field when we exit, so we're like any other pthread.
// As a side-effect, this tells us our pid (which is the same as the main thread's tid).
main_thread.tid = __set_tid_address(&main_thread.tid);
main_thread.set_cached_pid(main_thread.tid);
// We don't want to free the main thread's stack even when the main thread exits
// because things like environment variables with global scope live on it.
// We also can't free the pthread_internal_t itself, since that lives on the main
// thread's stack rather than on the heap.
// The main thread has no mmap allocated space for stack or pthread_internal_t.
main_thread.mmap_size = 0;
pthread_attr_init(&main_thread.attr);
main_thread.attr.guard_size = 0; // The main thread has no guard page.
main_thread.attr.stack_size = 0; // User code should never see this; we'll compute it when asked.
// TODO: the main thread's sched_policy and sched_priority need to be queried.
__init_thread(&main_thread);
__init_tls(&main_thread);
// Store a pointer to the kernel argument block in a TLS slot to be
// picked up by the libc constructor.
main_thread.tls[TLS_SLOT_BIONIC_PREINIT] = &args;
__init_alternate_signal_stack(&main_thread);
}
void __libc_init_globals(KernelArgumentBlock& args) {
// Initialize libc globals that are needed in both the linker and in libc.
// In dynamic binaries, this is run at least twice for different copies of the
@ -336,7 +291,7 @@ void __libc_init_AT_SECURE(KernelArgumentBlock& args) {
if (getauxval(AT_SECURE)) {
// If this is a setuid/setgid program, close the security hole described in
// ftp://ftp.freebsd.org/pub/FreeBSD/CERT/advisories/FreeBSD-SA-02:23.stdio.asc
// https://www.freebsd.org/security/advisories/FreeBSD-SA-02:23.stdio.asc
__nullify_closed_stdio();
__sanitize_environment_variables(args.envp);

View File

@ -25,6 +25,7 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* libc_init_dynamic.c
*

View File

@ -25,17 +25,6 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* libc_init_static.c
*
* The program startup function __libc_init() defined here is
* used for static executables only (i.e. those that don't depend
* on shared libraries). It is called from arch-$ARCH/bionic/crtbegin_static.S
* which is directly invoked by the kernel when the program is launched.
*
* The 'structors' parameter contains pointers to various initializer
* arrays that must be run before the program's 'main' routine is launched.
*/
#include <elf.h>
#include <errno.h>
@ -79,12 +68,19 @@ static void apply_gnu_relro() {
}
}
// The program startup function __libc_init() defined here is
// used for static executables only (i.e. those that don't depend
// on shared libraries). It is called from arch-$ARCH/bionic/crtbegin_static.S
// which is directly invoked by the kernel when the program is launched.
//
// The 'structors' parameter contains pointers to various initializer
// arrays that must be run before the program's 'main' routine is launched.
__noreturn void __libc_init(void* raw_args,
void (*onexit)(void) __unused,
int (*slingshot)(int, char**, char**),
structors_array_t const * const structors) {
KernelArgumentBlock args(raw_args);
__libc_init_main_thread(args);
// Initializing the globals requires TLS to be available for errno.

View File

@ -49,11 +49,8 @@
extern "C" {
// Brillo doesn't need to support any legacy cruft.
#if !defined(__BRILLO__)
// Most of the cruft is only for 32-bit Android targets.
#if !defined(__LP64__)
// Brillo and LP64 don't need to support any legacy cruft.
#if !defined(__BRILLO__) && !defined(__LP64__)
// These were accidentally declared in <unistd.h> because we stupidly used to inline
// getpagesize() and __getpageshift(). Needed for backwards compatibility with old NDK apps.
@ -343,10 +340,17 @@ size_t dlmalloc_usable_size(void* ptr) {
}
// In L we added a public pthread_gettid_np, but some apps were using the private API.
pid_t __pthread_gettid(pthread_t t) {
pid_t __pthread_gettid_libc(pthread_t t) {
return pthread_gettid_np(t);
}
pid_t __pthread_gettid_libc_private(pthread_t t) {
return pthread_gettid_np(t);
}
__asm__(".symver __pthread_gettid_libc,__pthread_gettid@LIBC");
__asm__(".symver __pthread_gettid_libc_private,__pthread_gettid@@LIBC_PRIVATE");
// Older versions of apportable used dlmalloc directly instead of malloc,
// so export this compatibility shim that simply calls malloc.
void* dlmalloc(size_t size) {
@ -367,8 +371,6 @@ long __set_errno(int n) {
return __set_errno_internal(n);
}
#endif // !defined(__LP64__)
// This was never implemented in bionic, only needed for ABI compatibility with the NDK.
// In the M time frame, over 1000 apps have a reference to this!
void endpwent() { }
@ -392,6 +394,6 @@ int dlmalloc_trim(size_t pad) {
}
#endif
#endif // !defined(__BRILLO__)
#endif // !defined(__BRILLO__) && !defined (__LP64__)
} // extern "C"

View File

@ -172,7 +172,7 @@ static int __pthread_cond_pulse(pthread_cond_internal_t* cond, int thread_count)
static int __pthread_cond_timedwait(pthread_cond_internal_t* cond, pthread_mutex_t* mutex,
bool use_realtime_clock, const timespec* abs_timeout_or_null) {
int result = check_timespec(abs_timeout_or_null);
int result = check_timespec(abs_timeout_or_null, true);
if (result != 0) {
return result;
}

View File

@ -40,7 +40,8 @@
/* Has the thread been joined by another thread? */
#define PTHREAD_ATTR_FLAG_JOINED 0x00000002
struct pthread_key_data_t {
class pthread_key_data_t {
public:
uintptr_t seq; // Use uintptr_t just for alignment, as we use pointer below.
void* data;
};
@ -52,11 +53,12 @@ enum ThreadJoinState {
THREAD_DETACHED
};
struct thread_local_dtor;
class thread_local_dtor;
struct pthread_internal_t {
struct pthread_internal_t* next;
struct pthread_internal_t* prev;
class pthread_internal_t {
public:
class pthread_internal_t* next;
class pthread_internal_t* prev;
pid_t tid;

View File

@ -304,7 +304,7 @@ static inline __always_inline int __pthread_normal_mutex_lock(pthread_mutex_inte
if (__predict_true(__pthread_normal_mutex_trylock(mutex, shared) == 0)) {
return 0;
}
int result = check_timespec(abs_timeout_or_null);
int result = check_timespec(abs_timeout_or_null, true);
if (result != 0) {
return result;
}
@ -487,7 +487,7 @@ static int __pthread_mutex_lock_with_timeout(pthread_mutex_internal_t* mutex,
old_state = new_state;
}
int result = check_timespec(abs_timeout_or_null);
int result = check_timespec(abs_timeout_or_null, true);
if (result != 0) {
return result;
}

View File

@ -298,7 +298,7 @@ static int __pthread_rwlock_timedrdlock(pthread_rwlock_internal_t* rwlock,
if (result == 0 || result == EAGAIN) {
return result;
}
result = check_timespec(abs_timeout_or_null);
result = check_timespec(abs_timeout_or_null, true);
if (result != 0) {
return result;
}
@ -370,7 +370,7 @@ static int __pthread_rwlock_timedwrlock(pthread_rwlock_internal_t* rwlock,
if (result == 0) {
return result;
}
result = check_timespec(abs_timeout_or_null);
result = check_timespec(abs_timeout_or_null, true);
if (result != 0) {
return result;
}

View File

@ -235,7 +235,7 @@ int sem_timedwait(sem_t* sem, const timespec* abs_timeout) {
}
// Check it as per POSIX.
int result = check_timespec(abs_timeout);
int result = check_timespec(abs_timeout, false);
if (result != 0) {
errno = result;
return -1;

View File

@ -200,6 +200,7 @@ static char property_filename[PROP_FILENAME_MAX] = PROP_FILENAME;
static bool compat_mode = false;
static size_t pa_data_size;
static size_t pa_size;
static bool initialized = false;
// NOTE: This isn't static because system_properties_compat.c
// requires it.
@ -642,22 +643,33 @@ bool prop_area::foreach(void (*propfn)(const prop_info* pi, void* cookie), void*
return foreach_property(root_node(), propfn, cookie);
}
struct context_node {
context_node(struct context_node* next, const char* context, prop_area* pa)
: context(strdup(context)), pa(pa), checked_access(false), next(next) {
lock.init(false);
class context_node {
public:
context_node(context_node* next, const char* context, prop_area* pa)
: next(next), context_(strdup(context)), pa_(pa), no_access_(false) {
lock_.init(false);
}
~context_node() {
if (pa) {
munmap(pa, pa_size);
}
free(context);
unmap();
free(context_);
}
Lock lock;
char* context;
prop_area* pa;
bool checked_access;
struct context_node* next;
bool open(bool access_rw, bool* fsetxattr_failed);
bool check_access_and_open();
void reset_access();
const char* context() const { return context_; }
prop_area* pa() { return pa_; }
context_node* next;
private:
bool check_access();
void unmap();
Lock lock_;
char* context_;
prop_area* pa_;
bool no_access_;
};
struct prefix_node {
@ -733,32 +745,50 @@ static context_node* contexts = nullptr;
* allocation of memory for each filename.
*/
static bool open_prop_file(context_node* cnode, bool access_rw, bool* fsetxattr_failed) {
cnode->lock.lock();
if (cnode->pa) {
cnode->lock.unlock();
bool context_node::open(bool access_rw, bool* fsetxattr_failed) {
lock_.lock();
if (pa_) {
lock_.unlock();
return true;
}
char filename[PROP_FILENAME_MAX];
int len = snprintf(filename, sizeof(filename), "%s/%s", property_filename, cnode->context);
int len = snprintf(filename, sizeof(filename), "%s/%s", property_filename, context_);
if (len < 0 || len > PROP_FILENAME_MAX) {
cnode->lock.unlock();
lock_.unlock();
return false;
}
if (access_rw) {
cnode->pa = map_prop_area_rw(filename, cnode->context, fsetxattr_failed);
pa_ = map_prop_area_rw(filename, context_, fsetxattr_failed);
} else {
cnode->pa = map_prop_area(filename, false);
pa_ = map_prop_area(filename, false);
}
cnode->lock.unlock();
return cnode->pa;
lock_.unlock();
return pa_;
}
static bool check_access(context_node* cnode) {
bool context_node::check_access_and_open() {
if (!pa_ && !no_access_) {
if (!check_access() || !open(false, nullptr)) {
no_access_ = true;
}
}
return pa_;
}
void context_node::reset_access() {
if (!check_access()) {
unmap();
no_access_ = true;
} else {
no_access_ = false;
}
}
bool context_node::check_access() {
char filename[PROP_FILENAME_MAX];
int len = snprintf(filename, sizeof(filename), "%s/%s", property_filename, cnode->context);
int len = snprintf(filename, sizeof(filename), "%s/%s", property_filename, context_);
if (len < 0 || len > PROP_FILENAME_MAX) {
return false;
}
@ -766,6 +796,18 @@ static bool check_access(context_node* cnode) {
return access(filename, R_OK) == 0;
}
void context_node::unmap() {
if (!pa_) {
return;
}
munmap(pa_, pa_size);
if (pa_ == __system_property_area__) {
__system_property_area__ = nullptr;
}
pa_ = nullptr;
}
static bool map_system_property_area(bool access_rw, bool* fsetxattr_failed) {
char filename[PROP_FILENAME_MAX];
int len = snprintf(filename, sizeof(filename), "%s/properties_serial", property_filename);
@ -792,10 +834,15 @@ static prop_area* get_prop_area_for_name(const char* name) {
}
auto cnode = entry->context;
if (!cnode->pa) {
open_prop_file(cnode, false, nullptr);
if (!cnode->pa()) {
/*
* We explicitly do not check no_access_ in this case because unlike the
* case of foreach(), we want to generate an selinux audit for each
* non-permitted property access in this function.
*/
cnode->open(false, nullptr);
}
return cnode->pa;
return cnode->pa();
}
/*
@ -892,9 +939,6 @@ static int read_spec_entries(char *line_buf, int num_args, ...)
}
static bool initialize_properties() {
list_free(&prefixes);
list_free(&contexts);
FILE* file = fopen("/property_contexts", "re");
if (!file) {
@ -927,7 +971,7 @@ static bool initialize_properties() {
}
auto old_context = list_find(
contexts, [context](context_node* l) { return !strcmp(l->context, context); });
contexts, [context](context_node* l) { return !strcmp(l->context(), context); });
if (old_context) {
list_add_after_len(&prefixes, prop_prefix, old_context);
} else {
@ -951,15 +995,27 @@ static bool is_dir(const char* pathname) {
return S_ISDIR(info.st_mode);
}
static void free_and_unmap_contexts() {
list_free(&prefixes);
list_free(&contexts);
if (__system_property_area__) {
munmap(__system_property_area__, pa_size);
__system_property_area__ = nullptr;
}
}
int __system_properties_init()
{
if (initialized) {
list_foreach(contexts, [](context_node* l) { l->reset_access(); });
return 0;
}
if (is_dir(property_filename)) {
if (!initialize_properties()) {
return -1;
}
if (!map_system_property_area(false, nullptr)) {
list_free(&prefixes);
list_free(&contexts);
free_and_unmap_contexts();
return -1;
}
} else {
@ -970,6 +1026,7 @@ int __system_properties_init()
list_add(&contexts, "legacy_system_prop_area", __system_property_area__);
list_add_after_len(&prefixes, "*", contexts);
}
initialized = true;
return 0;
}
@ -985,22 +1042,23 @@ int __system_property_set_filename(const char *filename)
int __system_property_area_init()
{
free_and_unmap_contexts();
mkdir(property_filename, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH);
if (!initialize_properties()) {
return -1;
}
bool open_prop_file_failed = false;
bool open_failed = false;
bool fsetxattr_failed = false;
list_foreach(contexts, [&fsetxattr_failed, &open_prop_file_failed](context_node* l) {
if (!open_prop_file(l, true, &fsetxattr_failed)) {
open_prop_file_failed = true;
list_foreach(contexts, [&fsetxattr_failed, &open_failed](context_node* l) {
if (!l->open(true, &fsetxattr_failed)) {
open_failed = true;
}
});
if (open_prop_file_failed || !map_system_property_area(true, &fsetxattr_failed)) {
list_free(&prefixes);
list_free(&contexts);
if (open_failed || !map_system_property_area(true, &fsetxattr_failed)) {
free_and_unmap_contexts();
return -1;
}
initialized = true;
return fsetxattr_failed ? -2 : 0;
}
@ -1226,14 +1284,8 @@ int __system_property_foreach(void (*propfn)(const prop_info *pi, void *cookie),
}
list_foreach(contexts, [propfn, cookie](context_node* l) {
if (!l->pa && !l->checked_access) {
if (check_access(l)) {
open_prop_file(l, false, nullptr);
}
l->checked_access = true;
}
if (l->pa) {
l->pa->foreach(propfn, cookie);
if (l->check_access_and_open()) {
l->pa()->foreach(propfn, cookie);
}
});
return 0;

View File

@ -142,6 +142,33 @@ extern void* android_dlopen_ext(const char* filename, int flag, const android_dl
extern bool android_init_namespaces(const char* public_ns_sonames,
const char* anon_ns_library_path);
enum {
/* A regular namespace is the namespace with a custom search path that does
* not impose any restrictions on the location of native libraries.
*/
ANDROID_NAMESPACE_TYPE_REGULAR = 0,
/* An isolated namespace requires all the libraries to be on the search path
* or under permitted_when_isolated_path. The search path is the union of
* ld_library_path and default_library_path.
*/
ANDROID_NAMESPACE_TYPE_ISOLATED = 1,
/* The shared namespace clones the list of libraries of the caller namespace upon creation
* which means that they are shared between namespaces - the caller namespace and the new one
* will use the same copy of a library if it was loaded prior to android_create_namespace call.
*
* Note that libraries loaded after the namespace is created will not be shared.
*
* Shared namespaces can be isolated or regular. Note that they do not inherit the search path nor
* permitted_path from the caller's namespace.
*/
ANDROID_NAMESPACE_TYPE_SHARED = 2,
ANDROID_NAMESPACE_TYPE_SHARED_ISOLATED = ANDROID_NAMESPACE_TYPE_SHARED |
ANDROID_NAMESPACE_TYPE_ISOLATED,
};
/*
* Creates new linker namespace.
* ld_library_path and default_library_path represent the search path
@ -152,19 +179,19 @@ extern bool android_init_namespaces(const char* public_ns_sonames,
* 2. In directories specified by DT_RUNPATH of the "needed by" binary.
* 3. deault_library_path (This of this as namespace-local default library path)
*
* When is_isolated is true the resulting namespace requires all of the libraries
* to be on the search path or under the permitted_when_isolated_path; the search_path is
* ld_library_path:default_library_path. Note that the permitted_when_isolated_path path
* is not part of the search_path and does not affect the search order. It is a way
* to allow loading libraries from specific locations when using absolute path.
*
* When type is ANDROID_NAMESPACE_TYPE_ISOLATED the resulting namespace requires all of
* the libraries to be on the search path or under the permitted_when_isolated_path;
* the search_path is ld_library_path:default_library_path. Note that the
* permitted_when_isolated_path path is not part of the search_path and
* does not affect the search order. It is a way to allow loading libraries from specific
* locations when using absolute path.
* If a library or any of its dependencies are outside of the permitted_when_isolated_path
* and search_path, and it is not part of the public namespace dlopen will fail.
*/
extern struct android_namespace_t* android_create_namespace(const char* name,
const char* ld_library_path,
const char* default_library_path,
bool is_isolated,
uint64_t type,
const char* permitted_when_isolated_path);
__END_DECLS

View File

@ -43,11 +43,12 @@ typedef struct {
in dli_sname */
} Dl_info;
extern void* dlopen(const char* filename, int flag);
extern int dlclose(void* handle);
extern const char* dlerror(void);
extern void* dlsym(void* handle, const char* symbol);
extern int dladdr(const void* addr, Dl_info *info);
extern void* dlopen(const char* filename, int flag);
extern int dlclose(void* handle);
extern const char* dlerror(void);
extern void* dlsym(void* handle, const char* symbol) __nonnull((2));
extern void* dlvsym(void* handle, const char* symbol, const char* version) __nonnull((2, 3));
extern int dladdr(const void* addr, Dl_info *info);
enum {
#if defined(__LP64__)

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2011 The Android Open Source Project
* Copyright (C) 2015 The Android Open Source Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -25,17 +25,35 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef _BIONIC_TIME_H
#define _BIONIC_TIME_H
#include <time.h>
#ifndef _IFADDRS_H_
#define _IFADDRS_H_
#include <sys/cdefs.h>
#include <netinet/in.h>
#include <sys/socket.h>
__BEGIN_DECLS
// We can't remove this (and this file) until we fix MtpUtils.cpp.
time_t mktime_tz(struct tm* const, char const*);
struct ifaddrs {
struct ifaddrs* ifa_next;
char* ifa_name;
unsigned int ifa_flags;
struct sockaddr* ifa_addr;
struct sockaddr* ifa_netmask;
union {
struct sockaddr* ifu_broadaddr;
struct sockaddr* ifu_dstaddr;
} ifa_ifu;
void* ifa_data;
};
#define ifa_broadaddr ifa_ifu.ifu_broadaddr
#define ifa_dstaddr ifa_ifu.ifu_dstaddr
void freeifaddrs(struct ifaddrs*);
int getifaddrs(struct ifaddrs**);
__END_DECLS
#endif /* _BIONIC_TIME_H */
#endif

View File

@ -10,43 +10,25 @@ LIBC {
__b64_ntop;
__b64_pton;
__brk; # arm x86 mips
__cmpdf2; # arm
__cmsg_nxthdr;
__connect; # arm x86 mips
__ctype_get_mb_cur_max;
__cxa_atexit;
__cxa_finalize;
__cxa_thread_atexit_impl;
__divdf3; # arm
__divdi3; # arm x86 mips
__divsf3; # arm
__divsi3; # arm
__dn_comp;
__dn_count_labels;
__dn_skipname;
__epoll_pwait; # arm x86 mips
__eqdf2; # arm
__errno;
__exit; # arm x86 mips
__extendsfdf2; # arm
__fbufsize;
__fcntl64; # arm x86 mips
__FD_CLR_chk;
__FD_ISSET_chk;
__FD_SET_chk;
__fgets_chk;
__fixdfsi; # arm
__fixsfsi; # arm
__fixunssfsi; # arm
__flbf;
__floatdidf; # arm
__floatdisf; # arm
__floatsidf; # arm
__floatsisf; # arm
__floatundidf; # arm
__floatundisf; # arm
__floatunsidf; # arm
__floatunsisf; # arm
__fp_nquery;
__fp_query;
__fpclassify;
@ -59,18 +41,13 @@ LIBC {
__fsetlocking;
__fstatfs64; # arm x86 mips
__fwritable;
__gedf2; # arm
__get_h_errno;
__getcpu; # arm x86 mips
__getcwd; # arm x86 mips
__getdents64; # arm x86 mips
__getpid; # arm x86 mips
__getpriority; # arm x86 mips
__gnu_basename;
__gnu_ldivmod_helper; # arm
__gnu_strerror_r;
__gnu_uldivmod_helper; # arm
__gtdf2; # arm
__hostalias;
__ioctl; # arm x86 mips
__isfinite;
@ -86,25 +63,18 @@ LIBC {
__isnormalf;
__isnormall;
__isthreaded;
__ledf2; # arm
__libc_current_sigrtmax;
__libc_current_sigrtmin;
__libc_init;
__llseek; # arm x86 mips
__loc_aton;
__loc_ntoa;
__lshrdi3; # arm
__ltdf2; # arm
__memchr_chk;
__memcpy_chk;
__memmove_chk;
__memrchr_chk;
__memset_chk;
__mmap2; # arm x86 mips
__muldf3; # arm
__muldi3; # arm
__mulsf3; # arm
__nedf2; # arm
__ns_format_ttl; # arm x86 mips
__ns_get16; # arm x86 mips
__ns_get32; # arm x86 mips
@ -144,8 +114,6 @@ LIBC {
__p_type;
__p_type_syms;
__poll_chk;
__popcount_tab; # arm
__popcountsi2; # arm x86 mips
__ppoll; # arm x86 mips
__ppoll_chk;
__pread64_chk;
@ -183,7 +151,6 @@ LIBC {
__res_send;
__res_send_setqhook;
__res_send_setrhook;
__restore_core_regs; # arm
__rt_sigaction; # arm x86 mips
__rt_sigpending; # arm x86 mips
__rt_sigprocmask; # arm x86 mips
@ -193,24 +160,14 @@ LIBC {
__sched_cpucount;
__sched_cpufree;
__sched_getaffinity; # arm x86 mips
__sclose; # arm x86 mips
__set_tid_address; # arm x86 mips
__set_tls; # arm mips
__sF;
__sflags; # arm x86 mips
__sflush; # arm x86 mips
__sfp; # arm x86 mips
__sglue; # arm x86 mips
__sigaction; # arm x86 mips
__signalfd4; # arm x86 mips
__smakebuf; # arm x86 mips
__snprintf_chk;
__socket; # arm x86 mips
__sprintf_chk;
__sread; # arm x86 mips
__srefill; # arm x86 mips
__srget; # arm x86 mips
__sseek; # arm x86 mips
__stack_chk_fail;
__stack_chk_guard;
__statfs64; # arm x86 mips
@ -227,40 +184,30 @@ LIBC {
__strncpy_chk;
__strncpy_chk2;
__strrchr_chk;
__subdf3; # arm
__subsf3; # arm
__swbuf; # arm x86 mips
__swrite; # arm x86 mips
__swsetup; # arm x86 mips
__sym_ntop;
__sym_ntos;
__sym_ston;
__system_properties_init;
__system_property_add;
__system_property_area__;
__system_property_area_init;
__system_property_area_serial;
__system_property_find;
__system_property_find_nth;
__system_property_foreach;
__system_property_get;
__system_property_read;
__system_property_serial;
__system_property_set;
__system_property_set_filename;
__system_property_update;
__system_property_wait_any;
__system_properties_init; # arm x86 mips
__system_property_add; # arm x86 mips
__system_property_area__; # arm x86 mips
__system_property_area_init; # arm x86 mips
__system_property_area_serial; # arm x86 mips
__system_property_find; # arm x86 mips
__system_property_find_nth; # arm x86 mips
__system_property_foreach; # arm x86 mips
__system_property_get; # arm x86 mips
__system_property_read; # arm x86 mips
__system_property_serial; # arm x86 mips
__system_property_set; # arm x86 mips
__system_property_set_filename; # arm x86 mips
__system_property_update; # arm x86 mips
__system_property_wait_any; # arm x86 mips
__timer_create; # arm x86 mips
__timer_delete; # arm x86 mips
__timer_getoverrun; # arm x86 mips
__timer_gettime; # arm x86 mips
__timer_settime; # arm x86 mips
__truncdfsf2; # arm
__udivdi3; # arm x86 mips
__udivsi3; # arm
__umask_chk;
__unorddf2; # arm
__unordsf2; # arm
__vsnprintf_chk;
__vsprintf_chk;
__waitid; # arm x86 mips
@ -268,7 +215,6 @@ LIBC {
_Exit;
_exit;
_flushlbf;
_fwalk; # arm x86 mips
_getlong;
_getshort;
_longjmp;
@ -314,7 +260,6 @@ LIBC {
brk;
bsearch;
btowc;
bzero; # arm x86 mips
c16rtomb;
c32rtomb;
cacheflush; # arm mips
@ -444,7 +389,6 @@ LIBC {
fputws;
fread;
free;
free_malloc_leak_info;
freeaddrinfo;
freelocale;
fremovexattr;
@ -485,7 +429,6 @@ LIBC {
fwscanf;
gai_strerror;
get_avphys_pages;
get_malloc_leak_info;
get_nprocs;
get_nprocs_conf;
get_phys_pages;
@ -731,7 +674,6 @@ LIBC {
mktemp;
mktime;
mktime64; # arm x86 mips
mktime_tz;
mlock;
mlockall;
mmap;
@ -925,7 +867,6 @@ LIBC {
res_mkquery;
res_query;
res_search;
restore_core_regs; # arm
rewind;
rewinddir;
rmdir;
@ -1270,15 +1211,31 @@ LIBC {
LIBC_N {
global:
__aeabi_atexit; # arm
__aeabi_memclr; # arm
__aeabi_memclr4; # arm
__aeabi_memclr8; # arm
__aeabi_memcpy; # arm
__aeabi_memcpy4; # arm
__aeabi_memcpy8; # arm
__aeabi_memmove; # arm
__aeabi_memmove4; # arm
__aeabi_memmove8; # arm
__aeabi_memset; # arm
__aeabi_memset4; # arm
__aeabi_memset8; # arm
__fread_chk;
__fwrite_chk;
__getcwd_chk;
__gnu_Unwind_Find_exidx; # arm
__pwrite_chk;
__pwrite64_chk;
__write_chk;
fileno_unlocked;
freeifaddrs;
getgrgid_r;
getgrnam_r;
getifaddrs;
preadv;
preadv64;
prlimit; # arm mips x86
@ -1377,7 +1334,29 @@ LIBC_PRIVATE {
__ashrdi3; # arm
__bionic_brk; # arm x86 mips
__bionic_libgcc_compat_symbols; # arm x86
__cmpdf2; # arm
__divdf3; # arm
__divdi3; # arm x86 mips
__divsf3; # arm
__divsi3; # arm
__dso_handle; # arm
__eqdf2; # arm
__extendsfdf2; # arm
__fixdfsi; # arm
__fixsfsi; # arm
__fixunssfsi; # arm
__floatdidf; # arm
__floatdisf; # arm
__floatsidf; # arm
__floatsisf; # arm
__floatundidf; # arm
__floatundisf; # arm
__floatunsidf; # arm
__floatunsisf; # arm
__gedf2; # arm
__getdents64; # arm x86 mips
__gnu_ldivmod_helper; # arm
__gnu_uldivmod_helper; # arm
__gnu_Unwind_Backtrace; # arm
__gnu_unwind_execute; # arm
__gnu_Unwind_Find_exidx; # arm
@ -1396,6 +1375,38 @@ LIBC_PRIVATE {
__gnu_Unwind_Save_VFP_D_16_to_31; # arm
__gnu_Unwind_Save_WMMXC; # arm
__gnu_Unwind_Save_WMMXD; # arm
__gtdf2; # arm
__ledf2; # arm
__lshrdi3; # arm
__ltdf2; # arm
__muldf3; # arm
__muldi3; # arm
__mulsf3; # arm
__nedf2; # arm
__popcount_tab; # arm
__popcountsi2; # arm x86 mips
__restore_core_regs; # arm
__sclose; # arm x86 mips
__sflags; # arm x86 mips
__sflush; # arm x86 mips
__sfp; # arm x86 mips
__sglue; # arm x86 mips
__smakebuf; # arm x86 mips
__sread; # arm x86 mips
__srefill; # arm x86 mips
__srget; # arm x86 mips
__sseek; # arm x86 mips
__subdf3; # arm
__subsf3; # arm
__swbuf; # arm x86 mips
__swrite; # arm x86 mips
__swsetup; # arm x86 mips
__truncdfsf2; # arm
__udivdi3; # arm mips
__udivsi3; # arm
__unorddf2; # arm
__unordsf2; # arm
_fwalk; # arm x86 mips
_Unwind_Backtrace; # arm
_Unwind_Complete; # arm
_Unwind_DeleteException; # arm
@ -1412,7 +1423,10 @@ LIBC_PRIVATE {
_Unwind_VRS_Pop; # arm
_Unwind_VRS_Set; # arm
atexit; # arm
free_malloc_leak_info;
get_malloc_leak_info;
gMallocLeakZygoteChild;
restore_core_regs; # arm
SHA1Final; # arm x86 mips
SHA1Init; # arm x86 mips
SHA1Transform; # arm x86 mips

View File

@ -10,43 +10,25 @@ LIBC {
__b64_ntop;
__b64_pton;
__brk; # arm x86 mips
__cmpdf2; # arm
__cmsg_nxthdr;
__connect; # arm x86 mips
__ctype_get_mb_cur_max;
__cxa_atexit;
__cxa_finalize;
__cxa_thread_atexit_impl;
__divdf3; # arm
__divdi3; # arm x86 mips
__divsf3; # arm
__divsi3; # arm
__dn_comp;
__dn_count_labels;
__dn_skipname;
__epoll_pwait; # arm x86 mips
__eqdf2; # arm
__errno;
__exit; # arm x86 mips
__extendsfdf2; # arm
__fbufsize;
__fcntl64; # arm x86 mips
__FD_CLR_chk;
__FD_ISSET_chk;
__FD_SET_chk;
__fgets_chk;
__fixdfsi; # arm
__fixsfsi; # arm
__fixunssfsi; # arm
__flbf;
__floatdidf; # arm
__floatdisf; # arm
__floatsidf; # arm
__floatsisf; # arm
__floatundidf; # arm
__floatundisf; # arm
__floatunsidf; # arm
__floatunsisf; # arm
__fp_nquery;
__fp_query;
__fpclassify;
@ -58,23 +40,14 @@ LIBC {
__freadable;
__fsetlocking;
__fstatfs64; # arm x86 mips
__futex_wait; # arm x86 mips nobrillo
__futex_wake; # arm x86 mips nobrillo
__fwritable;
__gedf2; # arm
__get_h_errno;
__get_thread; # arm x86 mips nobrillo
__get_tls; # arm x86 mips nobrillo
__getcpu; # arm x86 mips
__getcwd; # arm x86 mips
__getdents64; # arm x86 mips
__getpid; # arm x86 mips
__getpriority; # arm x86 mips
__gnu_basename;
__gnu_ldivmod_helper; # arm
__gnu_strerror_r;
__gnu_uldivmod_helper; # arm
__gtdf2; # arm
__hostalias;
__ioctl; # arm x86 mips
__isfinite;
@ -90,25 +63,18 @@ LIBC {
__isnormalf;
__isnormall;
__isthreaded;
__ledf2; # arm
__libc_current_sigrtmax;
__libc_current_sigrtmin;
__libc_init;
__llseek; # arm x86 mips
__loc_aton;
__loc_ntoa;
__lshrdi3; # arm
__ltdf2; # arm
__memchr_chk;
__memcpy_chk;
__memmove_chk;
__memrchr_chk;
__memset_chk;
__mmap2; # arm x86 mips
__muldf3; # arm
__muldi3; # arm
__mulsf3; # arm
__nedf2; # arm
__ns_format_ttl; # arm x86 mips
__ns_get16; # arm x86 mips
__ns_get32; # arm x86 mips
@ -131,7 +97,6 @@ LIBC {
__ns_skiprr; # arm x86 mips
__ns_sprintrr; # arm x86 mips
__ns_sprintrrf; # arm x86 mips
__open; # arm x86 mips nobrillo
__open_2;
__openat; # arm x86 mips
__openat_2;
@ -148,11 +113,7 @@ LIBC {
__p_time;
__p_type;
__p_type_syms;
__page_shift; # arm x86 mips nobrillo
__page_size; # arm x86 mips nobrillo
__poll_chk;
__popcount_tab; # arm
__popcountsi2; # arm x86 mips
__ppoll; # arm x86 mips
__ppoll_chk;
__pread64_chk;
@ -191,7 +152,6 @@ LIBC {
__res_send;
__res_send_setqhook;
__res_send_setrhook;
__restore_core_regs; # arm
__rt_sigaction; # arm x86 mips
__rt_sigpending; # arm x86 mips
__rt_sigprocmask; # arm x86 mips
@ -201,27 +161,14 @@ LIBC {
__sched_cpucount;
__sched_cpufree;
__sched_getaffinity; # arm x86 mips
__sclose; # arm x86 mips
__sdidinit; # arm x86 mips nobrillo
__set_errno; # arm x86 mips nobrillo
__set_tid_address; # arm x86 mips
__set_tls; # arm mips
__sF;
__sflags; # arm x86 mips
__sflush; # arm x86 mips
__sfp; # arm x86 mips
__sglue; # arm x86 mips
__sigaction; # arm x86 mips
__signalfd4; # arm x86 mips
__sinit; # arm x86 mips nobrillo
__smakebuf; # arm x86 mips
__snprintf_chk;
__socket; # arm x86 mips
__sprintf_chk;
__sread; # arm x86 mips
__srefill; # arm x86 mips
__srget; # arm x86 mips
__sseek; # arm x86 mips
__stack_chk_fail;
__stack_chk_guard;
__statfs64; # arm x86 mips
@ -238,49 +185,37 @@ LIBC {
__strncpy_chk;
__strncpy_chk2;
__strrchr_chk;
__subdf3; # arm
__subsf3; # arm
__swbuf; # arm x86 mips
__swrite; # arm x86 mips
__swsetup; # arm x86 mips
__sym_ntop;
__sym_ntos;
__sym_ston;
__system_properties_init;
__system_property_add;
__system_property_area__;
__system_property_area_init;
__system_property_area_serial;
__system_property_find;
__system_property_find_nth;
__system_property_foreach;
__system_property_get;
__system_property_read;
__system_property_serial;
__system_property_set;
__system_property_set_filename;
__system_property_update;
__system_property_wait_any;
__system_properties_init; # arm x86 mips
__system_property_add; # arm x86 mips
__system_property_area__; # arm x86 mips
__system_property_area_init; # arm x86 mips
__system_property_area_serial; # arm x86 mips
__system_property_find; # arm x86 mips
__system_property_find_nth; # arm x86 mips
__system_property_foreach; # arm x86 mips
__system_property_get; # arm x86 mips
__system_property_read; # arm x86 mips
__system_property_serial; # arm x86 mips
__system_property_set; # arm x86 mips
__system_property_set_filename; # arm x86 mips
__system_property_update; # arm x86 mips
__system_property_wait_any; # arm x86 mips
__timer_create; # arm x86 mips
__timer_delete; # arm x86 mips
__timer_getoverrun; # arm x86 mips
__timer_gettime; # arm x86 mips
__timer_settime; # arm x86 mips
__truncdfsf2; # arm
__udivdi3; # arm x86 mips
__udivsi3; # arm
__umask_chk;
__unorddf2; # arm
__unordsf2; # arm
__vsnprintf_chk;
__vsprintf_chk;
__wait4; # arm x86 mips nobrillo
__waitid; # arm x86 mips
_ctype_;
_Exit;
_exit;
_flushlbf;
_fwalk; # arm x86 mips
_getlong;
_getshort;
_longjmp;
@ -307,9 +242,7 @@ LIBC {
android_gethostbynamefornet;
android_set_abort_message;
arc4random;
arc4random_addrandom; # arm x86 mips nobrillo
arc4random_buf;
arc4random_stir; # arm x86 mips nobrillo
arc4random_uniform;
asctime;
asctime64; # arm x86 mips
@ -323,14 +256,11 @@ LIBC {
atoll;
basename;
basename_r; # arm x86 mips
bcopy; # arm x86 mips nobrillo
bind;
bindresvport;
brk;
bsd_signal; # arm x86 mips nobrillo
bsearch;
btowc;
bzero; # arm x86 mips
c16rtomb;
c32rtomb;
cacheflush; # arm mips
@ -383,7 +313,6 @@ LIBC {
dup3;
duplocale;
endmntent;
endpwent; # arm arm64 x86 x86_64 mips mips64 nobrillo
endservent;
endutent;
environ;
@ -430,7 +359,6 @@ LIBC {
fdatasync;
fdopen;
fdopendir;
fdprintf; # arm x86 mips nobrillo
feof;
feof_unlocked;
ferror;
@ -462,7 +390,6 @@ LIBC {
fputws;
fread;
free;
free_malloc_leak_info;
freeaddrinfo;
freelocale;
fremovexattr;
@ -483,7 +410,6 @@ LIBC {
fsync;
ftell;
ftello;
ftime; # arm x86 mips nobrillo
ftok;
ftruncate;
ftruncate64;
@ -504,7 +430,6 @@ LIBC {
fwscanf;
gai_strerror;
get_avphys_pages;
get_malloc_leak_info;
get_nprocs;
get_nprocs_conf;
get_phys_pages;
@ -516,8 +441,6 @@ LIBC {
getchar_unlocked;
getcwd;
getdelim;
getdents; # arm x86 mips nobrillo
getdtablesize; # arm x86 mips nobrillo
getegid;
getenv;
geteuid;
@ -592,7 +515,6 @@ LIBC {
if_nametoindex;
imaxabs;
imaxdiv;
index; # arm x86 mips nobrillo
inet_addr;
inet_aton;
inet_lnaof;
@ -645,7 +567,6 @@ LIBC {
isprint_l;
ispunct;
ispunct_l;
issetugid; # arm x86 mips nobrillo
isspace;
isspace_l;
isupper;
@ -735,7 +656,6 @@ LIBC {
mempcpy;
memrchr;
memset;
memswap; # arm x86 mips nobrillo
mincore;
mkdir;
mkdirat;
@ -755,7 +675,6 @@ LIBC {
mktemp;
mktime;
mktime64; # arm x86 mips
mktime_tz;
mlock;
mlockall;
mmap;
@ -826,7 +745,6 @@ LIBC {
pthread_attr_getschedpolicy;
pthread_attr_getscope;
pthread_attr_getstack;
pthread_attr_getstackaddr; # arm x86 mips nobrillo
pthread_attr_getstacksize;
pthread_attr_init;
pthread_attr_setdetachstate;
@ -835,7 +753,6 @@ LIBC {
pthread_attr_setschedpolicy;
pthread_attr_setscope;
pthread_attr_setstack;
pthread_attr_setstackaddr; # arm x86 mips nobrillo
pthread_attr_setstacksize;
pthread_cond_broadcast;
pthread_cond_destroy;
@ -951,7 +868,6 @@ LIBC {
res_mkquery;
res_query;
res_search;
restore_core_regs; # arm
rewind;
rewinddir;
rmdir;
@ -1094,8 +1010,6 @@ LIBC {
strncpy;
strndup;
strnlen;
strntoimax; # arm x86 mips nobrillo
strntoumax; # arm x86 mips nobrillo
strpbrk;
strptime;
strrchr;
@ -1114,7 +1028,6 @@ LIBC {
strtoll;
strtoll_l;
strtoq;
strtotimeval; # arm x86 mips nobrillo
strtoul;
strtoull;
strtoull_l;
@ -1136,7 +1049,6 @@ LIBC {
sysinfo;
syslog;
system;
sysv_signal; # arm x86 mips nobrillo
tcdrain;
tcflow;
tcflush;
@ -1168,7 +1080,6 @@ LIBC {
timerfd_settime;
times;
timezone;
tkill; # arm x86 mips nobrillo
tmpfile;
tmpnam;
toascii;
@ -1210,7 +1121,6 @@ LIBC {
vdprintf;
verr;
verrx;
vfdprintf; # arm x86 mips nobrillo
vfork;
vfprintf;
vfscanf;
@ -1230,7 +1140,6 @@ LIBC {
vwprintf;
vwscanf;
wait;
wait3; # arm x86 mips nobrillo
wait4;
waitid;
waitpid;
@ -1279,7 +1188,6 @@ LIBC {
wcstoull;
wcstoull_l;
wcstoumax;
wcswcs; # arm x86 mips nobrillo
wcswidth;
wcsxfrm;
wcsxfrm_l;
@ -1304,15 +1212,31 @@ LIBC {
LIBC_N {
global:
__aeabi_atexit; # arm
__aeabi_memclr; # arm
__aeabi_memclr4; # arm
__aeabi_memclr8; # arm
__aeabi_memcpy; # arm
__aeabi_memcpy4; # arm
__aeabi_memcpy8; # arm
__aeabi_memmove; # arm
__aeabi_memmove4; # arm
__aeabi_memmove8; # arm
__aeabi_memset; # arm
__aeabi_memset4; # arm
__aeabi_memset8; # arm
__fread_chk;
__fwrite_chk;
__getcwd_chk;
__gnu_Unwind_Find_exidx; # arm
__pwrite_chk;
__pwrite64_chk;
__write_chk;
fileno_unlocked;
freeifaddrs;
getgrgid_r;
getgrnam_r;
getifaddrs;
preadv;
preadv64;
prlimit; # arm mips x86
@ -1411,7 +1335,33 @@ LIBC_PRIVATE {
__ashrdi3; # arm
__bionic_brk; # arm x86 mips
__bionic_libgcc_compat_symbols; # arm x86
__cmpdf2; # arm
__divdf3; # arm
__divdi3; # arm x86 mips
__divsf3; # arm
__divsi3; # arm
__dso_handle; # arm
__eqdf2; # arm
__extendsfdf2; # arm
__fixdfsi; # arm
__fixsfsi; # arm
__fixunssfsi; # arm
__floatdidf; # arm
__floatdisf; # arm
__floatsidf; # arm
__floatsisf; # arm
__floatundidf; # arm
__floatundisf; # arm
__floatunsidf; # arm
__floatunsisf; # arm
__futex_wait; # arm x86 mips nobrillo
__futex_wake; # arm x86 mips nobrillo
__gedf2; # arm
__get_thread; # arm x86 mips nobrillo
__get_tls; # arm x86 mips nobrillo
__getdents64; # arm x86 mips
__gnu_ldivmod_helper; # arm
__gnu_uldivmod_helper; # arm
__gnu_Unwind_Backtrace; # arm
__gnu_unwind_execute; # arm
__gnu_Unwind_Find_exidx; # arm
@ -1430,6 +1380,46 @@ LIBC_PRIVATE {
__gnu_Unwind_Save_VFP_D_16_to_31; # arm
__gnu_Unwind_Save_WMMXC; # arm
__gnu_Unwind_Save_WMMXD; # arm
__gtdf2; # arm
__ledf2; # arm
__lshrdi3; # arm
__ltdf2; # arm
__muldf3; # arm
__muldi3; # arm
__mulsf3; # arm
__nedf2; # arm
__open; # arm x86 mips nobrillo
__page_shift; # arm x86 mips nobrillo
__page_size; # arm x86 mips nobrillo
__popcount_tab; # arm
__popcountsi2; # arm x86 mips
__pthread_gettid; # arm x86 mips nobrillo
__restore_core_regs; # arm
__sclose; # arm x86 mips
__sdidinit; # arm x86 mips nobrillo
__set_errno; # arm x86 mips nobrillo
__sflags; # arm x86 mips
__sflush; # arm x86 mips
__sfp; # arm x86 mips
__sglue; # arm x86 mips
__sinit; # arm x86 mips nobrillo
__smakebuf; # arm x86 mips
__sread; # arm x86 mips
__srefill; # arm x86 mips
__srget; # arm x86 mips
__sseek; # arm x86 mips
__subdf3; # arm
__subsf3; # arm
__swbuf; # arm x86 mips
__swrite; # arm x86 mips
__swsetup; # arm x86 mips
__truncdfsf2; # arm
__udivdi3; # arm mips
__udivsi3; # arm
__unorddf2; # arm
__unordsf2; # arm
__wait4; # arm x86 mips nobrillo
_fwalk; # arm x86 mips
_Unwind_Backtrace; # arm
_Unwind_Complete; # arm
_Unwind_DeleteException; # arm
@ -1445,14 +1435,40 @@ LIBC_PRIVATE {
_Unwind_VRS_Get; # arm
_Unwind_VRS_Pop; # arm
_Unwind_VRS_Set; # arm
arc4random_addrandom; # arm x86 mips nobrillo
arc4random_stir; # arm x86 mips nobrillo
atexit; # arm
bcopy; # arm x86 mips nobrillo
bzero; # arm x86 mips nobrillo
bsd_signal; # arm x86 mips nobrillo
dlmalloc; # arm x86 mips nobrillo
dlmalloc_inspect_all; # arm arm64 x86 x86_64 mips mips64 nobrillo
dlmalloc_trim; # arm arm64 x86 x86_64 mips mips64 nobrillo
dlmalloc_inspect_all; # arm x86 mips nobrillo
dlmalloc_trim; # arm x86 mips nobrillo
dlmalloc_usable_size; # arm x86 mips nobrillo
endpwent; # arm x86 mips nobrillo
fdprintf; # arm x86 mips nobrillo
free_malloc_leak_info;
ftime; # arm x86 mips nobrillo
get_malloc_leak_info;
getdents; # arm x86 mips nobrillo
getdtablesize; # arm x86 mips nobrillo
gMallocLeakZygoteChild;
index; # arm x86 mips nobrillo
issetugid; # arm x86 mips nobrillo
memswap; # arm x86 mips nobrillo
pthread_attr_getstackaddr; # arm x86 mips nobrillo
pthread_attr_setstackaddr; # arm x86 mips nobrillo
restore_core_regs; # arm
SHA1Final; # arm x86 mips
SHA1Init; # arm x86 mips
SHA1Transform; # arm x86 mips
SHA1Update; # arm x86 mips
strntoimax; # arm x86 mips nobrillo
strntoumax; # arm x86 mips nobrillo
strtotimeval; # arm x86 mips nobrillo
sysv_signal; # arm x86 mips nobrillo
tkill; # arm x86 mips nobrillo
vfdprintf; # arm x86 mips nobrillo
wait3; # arm x86 mips nobrillo
wcswcs; # arm x86 mips nobrillo
} LIBC_N;

File diff suppressed because it is too large Load Diff

View File

@ -131,21 +131,6 @@ LIBC {
__sym_ntop;
__sym_ntos;
__sym_ston;
__system_properties_init;
__system_property_add;
__system_property_area__;
__system_property_area_init;
__system_property_area_serial;
__system_property_find;
__system_property_find_nth;
__system_property_foreach;
__system_property_get;
__system_property_read;
__system_property_serial;
__system_property_set;
__system_property_set_filename;
__system_property_update;
__system_property_wait_any;
__umask_chk;
__vsnprintf_chk;
__vsprintf_chk;
@ -241,7 +226,6 @@ LIBC {
dup3;
duplocale;
endmntent;
endpwent; # arm arm64 x86 x86_64 mips mips64 nobrillo
endservent;
endutent;
environ;
@ -317,7 +301,6 @@ LIBC {
fputws;
fread;
free;
free_malloc_leak_info;
freeaddrinfo;
freelocale;
fremovexattr;
@ -358,7 +341,6 @@ LIBC {
fwscanf;
gai_strerror;
get_avphys_pages;
get_malloc_leak_info;
get_nprocs;
get_nprocs_conf;
get_phys_pages;
@ -599,7 +581,6 @@ LIBC {
mkstemps64;
mktemp;
mktime;
mktime_tz;
mlock;
mlockall;
mmap;
@ -1157,8 +1138,10 @@ LIBC_N {
__pwrite64_chk;
__write_chk;
fileno_unlocked;
freeifaddrs;
getgrgid_r;
getgrnam_r;
getifaddrs;
preadv;
preadv64;
pthread_barrierattr_destroy;
@ -1182,7 +1165,22 @@ LIBC_N {
LIBC_PRIVATE {
global:
dlmalloc_inspect_all; # arm arm64 x86 x86_64 mips mips64 nobrillo
dlmalloc_trim; # arm arm64 x86 x86_64 mips mips64 nobrillo
__system_properties_init; # arm64 x86_64 mips64
__system_property_add; # arm64 x86_64 mips64
__system_property_area__; # arm64 x86_64 mips64
__system_property_area_init; # arm64 x86_64 mips64
__system_property_area_serial; # arm64 x86_64 mips64
__system_property_find; # arm64 x86_64 mips64
__system_property_find_nth; # arm64 x86_64 mips64
__system_property_foreach; # arm64 x86_64 mips64
__system_property_get; # arm64 x86_64 mips64
__system_property_read; # arm64 x86_64 mips64
__system_property_serial; # arm64 x86_64 mips64
__system_property_set; # arm64 x86_64 mips64
__system_property_set_filename; # arm64 x86_64 mips64
__system_property_update; # arm64 x86_64 mips64
__system_property_wait_any; # arm64 x86_64 mips64
free_malloc_leak_info;
get_malloc_leak_info;
gMallocLeakZygoteChild;
} LIBC_N;

View File

@ -9,25 +9,18 @@ LIBC {
__b64_ntop;
__b64_pton;
__brk; # arm x86 mips
__cmpdf2; # arm
__cmsg_nxthdr;
__connect; # arm x86 mips
__ctype_get_mb_cur_max;
__cxa_atexit;
__cxa_finalize;
__cxa_thread_atexit_impl;
__divdf3; # arm
__divdi3; # arm x86 mips
__divsf3; # arm
__divsi3; # arm
__dn_comp;
__dn_count_labels;
__dn_skipname;
__epoll_pwait; # arm x86 mips
__eqdf2; # arm
__errno;
__exit; # arm x86 mips
__extendsfdf2; # arm
__fadvise64; # x86 mips
__fbufsize;
__fcntl64; # arm x86 mips
@ -35,18 +28,7 @@ LIBC {
__FD_ISSET_chk;
__FD_SET_chk;
__fgets_chk;
__fixdfsi; # arm
__fixsfsi; # arm
__fixunssfsi; # arm
__flbf;
__floatdidf; # arm
__floatdisf; # arm
__floatsidf; # arm
__floatsisf; # arm
__floatundidf; # arm
__floatundisf; # arm
__floatunsidf; # arm
__floatunsisf; # arm
__fp_nquery;
__fp_query;
__fpclassify;
@ -58,23 +40,14 @@ LIBC {
__freadable;
__fsetlocking;
__fstatfs64; # arm x86 mips
__futex_wait; # arm x86 mips nobrillo
__futex_wake; # arm x86 mips nobrillo
__fwritable;
__gedf2; # arm
__get_h_errno;
__get_thread; # arm x86 mips nobrillo
__get_tls; # arm x86 mips nobrillo
__getcpu; # arm x86 mips
__getcwd; # arm x86 mips
__getdents64; # arm x86 mips
__getpid; # arm x86 mips
__getpriority; # arm x86 mips
__gnu_basename;
__gnu_ldivmod_helper; # arm
__gnu_strerror_r;
__gnu_uldivmod_helper; # arm
__gtdf2; # arm
__hostalias;
__ioctl; # arm x86 mips
__isfinite;
@ -90,15 +63,12 @@ LIBC {
__isnormalf;
__isnormall;
__isthreaded;
__ledf2; # arm
__libc_current_sigrtmax;
__libc_current_sigrtmin;
__libc_init;
__llseek; # arm x86 mips
__loc_aton;
__loc_ntoa;
__lshrdi3; # arm
__ltdf2; # arm
__memchr_chk;
__memcpy_chk;
__memmove_chk;
@ -106,10 +76,6 @@ LIBC {
__memset_chk;
__mmap2; # arm x86 mips
__moddi3; # x86 mips
__muldf3; # arm
__muldi3; # arm
__mulsf3; # arm
__nedf2; # arm
__ns_format_ttl; # arm x86 mips
__ns_get16; # arm x86 mips
__ns_get32; # arm x86 mips
@ -132,7 +98,6 @@ LIBC {
__ns_skiprr; # arm x86 mips
__ns_sprintrr; # arm x86 mips
__ns_sprintrrf; # arm x86 mips
__open; # arm x86 mips nobrillo
__open_2;
__openat; # arm x86 mips
__openat_2;
@ -149,11 +114,7 @@ LIBC {
__p_time;
__p_type;
__p_type_syms;
__page_shift; # arm x86 mips nobrillo
__page_size; # arm x86 mips nobrillo
__poll_chk;
__popcount_tab; # arm
__popcountsi2; # arm x86 mips
__ppoll; # arm x86 mips
__ppoll_chk;
__pread64_chk;
@ -192,7 +153,6 @@ LIBC {
__res_send;
__res_send_setqhook;
__res_send_setrhook;
__restore_core_regs; # arm
__rt_sigaction; # arm x86 mips
__rt_sigpending; # arm x86 mips
__rt_sigprocmask; # arm x86 mips
@ -202,28 +162,15 @@ LIBC {
__sched_cpucount;
__sched_cpufree;
__sched_getaffinity; # arm x86 mips
__sclose; # arm x86 mips
__sdidinit; # arm x86 mips nobrillo
__set_errno; # arm x86 mips nobrillo
__set_thread_area; # x86
__set_tid_address; # arm x86 mips
__set_tls; # arm mips
__sF;
__sflags; # arm x86 mips
__sflush; # arm x86 mips
__sfp; # arm x86 mips
__sglue; # arm x86 mips
__sigaction; # arm x86 mips
__signalfd4; # arm x86 mips
__sinit; # arm x86 mips nobrillo
__smakebuf; # arm x86 mips
__snprintf_chk;
__socket; # arm x86 mips
__sprintf_chk;
__sread; # arm x86 mips
__srefill; # arm x86 mips
__srget; # arm x86 mips
__sseek; # arm x86 mips
__stack_chk_fail;
__stack_chk_guard;
__statfs64; # arm x86 mips
@ -240,51 +187,39 @@ LIBC {
__strncpy_chk;
__strncpy_chk2;
__strrchr_chk;
__subdf3; # arm
__subsf3; # arm
__swbuf; # arm x86 mips
__swrite; # arm x86 mips
__swsetup; # arm x86 mips
__sym_ntop;
__sym_ntos;
__sym_ston;
__system_properties_init;
__system_property_add;
__system_property_area__;
__system_property_area_init;
__system_property_area_serial;
__system_property_find;
__system_property_find_nth;
__system_property_foreach;
__system_property_get;
__system_property_read;
__system_property_serial;
__system_property_set;
__system_property_set_filename;
__system_property_update;
__system_property_wait_any;
__system_properties_init; # arm x86 mips
__system_property_add; # arm x86 mips
__system_property_area__; # arm x86 mips
__system_property_area_init; # arm x86 mips
__system_property_area_serial; # arm x86 mips
__system_property_find; # arm x86 mips
__system_property_find_nth; # arm x86 mips
__system_property_foreach; # arm x86 mips
__system_property_get; # arm x86 mips
__system_property_read; # arm x86 mips
__system_property_serial; # arm x86 mips
__system_property_set; # arm x86 mips
__system_property_set_filename; # arm x86 mips
__system_property_update; # arm x86 mips
__system_property_wait_any; # arm x86 mips
__timer_create; # arm x86 mips
__timer_delete; # arm x86 mips
__timer_getoverrun; # arm x86 mips
__timer_gettime; # arm x86 mips
__timer_settime; # arm x86 mips
__truncdfsf2; # arm
__udivdi3; # arm x86 mips
__udivsi3; # arm
__udivdi3; # x86
__umask_chk;
__umoddi3; # x86 mips
__unorddf2; # arm
__unordsf2; # arm
__vsnprintf_chk;
__vsprintf_chk;
__wait4; # arm x86 mips nobrillo
__waitid; # arm x86 mips
_ctype_;
_Exit;
_exit;
_flush_cache; # mips
_flushlbf;
_fwalk; # arm x86 mips
_getlong;
_getshort;
_longjmp;
@ -311,9 +246,7 @@ LIBC {
android_gethostbynamefornet;
android_set_abort_message;
arc4random;
arc4random_addrandom; # arm x86 mips nobrillo
arc4random_buf;
arc4random_stir; # arm x86 mips nobrillo
arc4random_uniform;
asctime;
asctime64; # arm x86 mips
@ -327,14 +260,11 @@ LIBC {
atoll;
basename;
basename_r; # arm x86 mips
bcopy; # arm x86 mips nobrillo
bind;
bindresvport;
brk;
bsd_signal; # arm x86 mips nobrillo
bsearch;
btowc;
bzero; # arm x86 mips
c16rtomb;
c32rtomb;
cacheflush; # arm mips
@ -387,7 +317,6 @@ LIBC {
dup3;
duplocale;
endmntent;
endpwent; # arm arm64 x86 x86_64 mips mips64 nobrillo
endservent;
endutent;
environ;
@ -434,7 +363,6 @@ LIBC {
fdatasync;
fdopen;
fdopendir;
fdprintf; # arm x86 mips nobrillo
feof;
feof_unlocked;
ferror;
@ -466,7 +394,6 @@ LIBC {
fputws;
fread;
free;
free_malloc_leak_info;
freeaddrinfo;
freelocale;
fremovexattr;
@ -487,7 +414,6 @@ LIBC {
fsync;
ftell;
ftello;
ftime; # arm x86 mips nobrillo
ftok;
ftruncate;
ftruncate64;
@ -508,7 +434,6 @@ LIBC {
fwscanf;
gai_strerror;
get_avphys_pages;
get_malloc_leak_info;
get_nprocs;
get_nprocs_conf;
get_phys_pages;
@ -520,8 +445,6 @@ LIBC {
getchar_unlocked;
getcwd;
getdelim;
getdents; # arm x86 mips nobrillo
getdtablesize; # arm x86 mips nobrillo
getegid;
getenv;
geteuid;
@ -596,7 +519,6 @@ LIBC {
if_nametoindex;
imaxabs;
imaxdiv;
index; # arm x86 mips nobrillo
inet_addr;
inet_aton;
inet_lnaof;
@ -649,7 +571,6 @@ LIBC {
isprint_l;
ispunct;
ispunct_l;
issetugid; # arm x86 mips nobrillo
isspace;
isspace_l;
isupper;
@ -739,7 +660,6 @@ LIBC {
mempcpy;
memrchr;
memset;
memswap; # arm x86 mips nobrillo
mincore;
mkdir;
mkdirat;
@ -759,7 +679,6 @@ LIBC {
mktemp;
mktime;
mktime64; # arm x86 mips
mktime_tz;
mlock;
mlockall;
mmap;
@ -853,7 +772,6 @@ LIBC {
pthread_attr_getschedpolicy;
pthread_attr_getscope;
pthread_attr_getstack;
pthread_attr_getstackaddr; # arm x86 mips nobrillo
pthread_attr_getstacksize;
pthread_attr_init;
pthread_attr_setdetachstate;
@ -862,7 +780,6 @@ LIBC {
pthread_attr_setschedpolicy;
pthread_attr_setscope;
pthread_attr_setstack;
pthread_attr_setstackaddr; # arm x86 mips nobrillo
pthread_attr_setstacksize;
pthread_cond_broadcast;
pthread_cond_destroy;
@ -978,7 +895,6 @@ LIBC {
res_mkquery;
res_query;
res_search;
restore_core_regs; # arm
rewind;
rewinddir;
rmdir;
@ -1121,8 +1037,6 @@ LIBC {
strncpy;
strndup;
strnlen;
strntoimax; # arm x86 mips nobrillo
strntoumax; # arm x86 mips nobrillo
strpbrk;
strptime;
strrchr;
@ -1141,7 +1055,6 @@ LIBC {
strtoll;
strtoll_l;
strtoq;
strtotimeval; # arm x86 mips nobrillo
strtoul;
strtoull;
strtoull_l;
@ -1163,7 +1076,6 @@ LIBC {
sysinfo;
syslog;
system;
sysv_signal; # arm x86 mips nobrillo
tcdrain;
tcflow;
tcflush;
@ -1195,7 +1107,6 @@ LIBC {
timerfd_settime;
times;
timezone;
tkill; # arm x86 mips nobrillo
tmpfile;
tmpnam;
toascii;
@ -1237,7 +1148,6 @@ LIBC {
vdprintf;
verr;
verrx;
vfdprintf; # arm x86 mips nobrillo
vfork;
vfprintf;
vfscanf;
@ -1257,7 +1167,6 @@ LIBC {
vwprintf;
vwscanf;
wait;
wait3; # arm x86 mips nobrillo
wait4;
waitid;
waitpid;
@ -1306,7 +1215,6 @@ LIBC {
wcstoull;
wcstoull_l;
wcstoumax;
wcswcs; # arm x86 mips nobrillo
wcswidth;
wcsxfrm;
wcsxfrm_l;
@ -1331,15 +1239,31 @@ LIBC {
LIBC_N {
global:
__aeabi_atexit; # arm
__aeabi_memclr; # arm
__aeabi_memclr4; # arm
__aeabi_memclr8; # arm
__aeabi_memcpy; # arm
__aeabi_memcpy4; # arm
__aeabi_memcpy8; # arm
__aeabi_memmove; # arm
__aeabi_memmove4; # arm
__aeabi_memmove8; # arm
__aeabi_memset; # arm
__aeabi_memset4; # arm
__aeabi_memset8; # arm
__fread_chk;
__fwrite_chk;
__getcwd_chk;
__gnu_Unwind_Find_exidx; # arm
__pwrite_chk;
__pwrite64_chk;
__write_chk;
fileno_unlocked;
freeifaddrs;
getgrgid_r;
getgrnam_r;
getifaddrs;
preadv;
preadv64;
prlimit; # arm mips x86
@ -1438,7 +1362,33 @@ LIBC_PRIVATE {
__ashrdi3; # arm
__bionic_brk; # arm x86 mips
__bionic_libgcc_compat_symbols; # arm x86
__cmpdf2; # arm
__divdf3; # arm
__divdi3; # arm x86 mips
__divsf3; # arm
__divsi3; # arm
__dso_handle; # arm
__eqdf2; # arm
__extendsfdf2; # arm
__fixdfsi; # arm
__fixsfsi; # arm
__fixunssfsi; # arm
__floatdidf; # arm
__floatdisf; # arm
__floatsidf; # arm
__floatsisf; # arm
__floatundidf; # arm
__floatundisf; # arm
__floatunsidf; # arm
__floatunsisf; # arm
__futex_wait; # arm x86 mips nobrillo
__futex_wake; # arm x86 mips nobrillo
__gedf2; # arm
__get_thread; # arm x86 mips nobrillo
__get_tls; # arm x86 mips nobrillo
__getdents64; # arm x86 mips
__gnu_ldivmod_helper; # arm
__gnu_uldivmod_helper; # arm
__gnu_Unwind_Backtrace; # arm
__gnu_unwind_execute; # arm
__gnu_Unwind_Find_exidx; # arm
@ -1457,6 +1407,62 @@ LIBC_PRIVATE {
__gnu_Unwind_Save_VFP_D_16_to_31; # arm
__gnu_Unwind_Save_WMMXC; # arm
__gnu_Unwind_Save_WMMXD; # arm
__gtdf2; # arm
__ledf2; # arm
__lshrdi3; # arm
__ltdf2; # arm
__muldf3; # arm
__muldi3; # arm
__mulsf3; # arm
__nedf2; # arm
__open; # arm x86 mips nobrillo
__page_shift; # arm x86 mips nobrillo
__page_size; # arm x86 mips nobrillo
__popcount_tab; # arm
__popcountsi2; # arm x86 mips
__pthread_gettid; # arm x86 mips nobrillo
__restore_core_regs; # arm
__sclose; # arm x86 mips
__sdidinit; # arm x86 mips nobrillo
__set_errno; # arm x86 mips nobrillo
__sflags; # arm x86 mips
__sflush; # arm x86 mips
__sfp; # arm x86 mips
__sglue; # arm x86 mips
__sinit; # arm x86 mips nobrillo
__smakebuf; # arm x86 mips
__sread; # arm x86 mips
__srefill; # arm x86 mips
__srget; # arm x86 mips
__sseek; # arm x86 mips
__subdf3; # arm
__subsf3; # arm
__swbuf; # arm x86 mips
__swrite; # arm x86 mips
__swsetup; # arm x86 mips
__system_properties_init; # arm64 x86_64 mips64
__system_property_add; # arm64 x86_64 mips64
__system_property_area__; # arm64 x86_64 mips64
__system_property_area_init; # arm64 x86_64 mips64
__system_property_area_serial; # arm64 x86_64 mips64
__system_property_find; # arm64 x86_64 mips64
__system_property_find_nth; # arm64 x86_64 mips64
__system_property_foreach; # arm64 x86_64 mips64
__system_property_get; # arm64 x86_64 mips64
__system_property_read; # arm64 x86_64 mips64
__system_property_serial; # arm64 x86_64 mips64
__system_property_set; # arm64 x86_64 mips64
__system_property_set_filename; # arm64 x86_64 mips64
__system_property_update; # arm64 x86_64 mips64
__system_property_wait_any; # arm64 x86_64 mips64
__truncdfsf2; # arm
__udivdi3; # arm mips
__udivsi3; # arm
__umoddi3; # x86 mips
__unorddf2; # arm
__unordsf2; # arm
__wait4; # arm x86 mips nobrillo
_fwalk; # arm x86 mips
_Unwind_Backtrace; # arm
_Unwind_Complete; # arm
_Unwind_DeleteException; # arm
@ -1472,14 +1478,40 @@ LIBC_PRIVATE {
_Unwind_VRS_Get; # arm
_Unwind_VRS_Pop; # arm
_Unwind_VRS_Set; # arm
arc4random_addrandom; # arm x86 mips nobrillo
arc4random_stir; # arm x86 mips nobrillo
atexit; # arm
bcopy; # arm x86 mips nobrillo
bzero; # arm x86 mips nobrillo
bsd_signal; # arm x86 mips nobrillo
dlmalloc; # arm x86 mips nobrillo
dlmalloc_inspect_all; # arm arm64 x86 x86_64 mips mips64 nobrillo
dlmalloc_trim; # arm arm64 x86 x86_64 mips mips64 nobrillo
dlmalloc_inspect_all; # arm x86 mips nobrillo
dlmalloc_trim; # arm x86 mips nobrillo
dlmalloc_usable_size; # arm x86 mips nobrillo
endpwent; # arm x86 mips nobrillo
fdprintf; # arm x86 mips nobrillo
free_malloc_leak_info;
ftime; # arm x86 mips nobrillo
get_malloc_leak_info;
getdents; # arm x86 mips nobrillo
getdtablesize; # arm x86 mips nobrillo
gMallocLeakZygoteChild;
index; # arm x86 mips nobrillo
issetugid; # arm x86 mips nobrillo
memswap; # arm x86 mips nobrillo
pthread_attr_getstackaddr; # arm x86 mips nobrillo
pthread_attr_setstackaddr; # arm x86 mips nobrillo
restore_core_regs; # arm
SHA1Final; # arm x86 mips
SHA1Init; # arm x86 mips
SHA1Transform; # arm x86 mips
SHA1Update; # arm x86 mips
strntoimax; # arm x86 mips nobrillo
strntoumax; # arm x86 mips nobrillo
strtotimeval; # arm x86 mips nobrillo
sysv_signal; # arm x86 mips nobrillo
tkill; # arm x86 mips nobrillo
vfdprintf; # arm x86 mips nobrillo
wait3; # arm x86 mips nobrillo
wcswcs; # arm x86 mips nobrillo
} LIBC_N;

View File

@ -12,7 +12,6 @@ LIBC {
__cxa_atexit;
__cxa_finalize;
__cxa_thread_atexit_impl;
__divdi3; # arm x86 mips
__dn_comp;
__dn_count_labels;
__dn_skipname;
@ -42,7 +41,6 @@ LIBC {
__get_h_errno;
__getcpu; # arm x86 mips
__getcwd; # arm x86 mips
__getdents64; # arm x86 mips
__getpid; # arm x86 mips
__getpriority; # arm x86 mips
__gnu_basename;
@ -114,7 +112,6 @@ LIBC {
__p_type;
__p_type_syms;
__poll_chk;
__popcountsi2; # arm x86 mips
__ppoll; # arm x86 mips
__ppoll_chk;
__pread64_chk;
@ -161,24 +158,14 @@ LIBC {
__sched_cpucount;
__sched_cpufree;
__sched_getaffinity; # arm x86 mips
__sclose; # arm x86 mips
__set_tid_address; # arm x86 mips
__set_tls; # arm mips
__sF;
__sflags; # arm x86 mips
__sflush; # arm x86 mips
__sfp; # arm x86 mips
__sglue; # arm x86 mips
__sigaction; # arm x86 mips
__signalfd4; # arm x86 mips
__smakebuf; # arm x86 mips
__snprintf_chk;
__socket; # arm x86 mips
__sprintf_chk;
__sread; # arm x86 mips
__srefill; # arm x86 mips
__srget; # arm x86 mips
__sseek; # arm x86 mips
__stack_chk_fail;
__stack_chk_guard;
__statfs64; # arm x86 mips
@ -195,35 +182,30 @@ LIBC {
__strncpy_chk;
__strncpy_chk2;
__strrchr_chk;
__swbuf; # arm x86 mips
__swrite; # arm x86 mips
__swsetup; # arm x86 mips
__sym_ntop;
__sym_ntos;
__sym_ston;
__system_properties_init;
__system_property_add;
__system_property_area__;
__system_property_area_init;
__system_property_area_serial;
__system_property_find;
__system_property_find_nth;
__system_property_foreach;
__system_property_get;
__system_property_read;
__system_property_serial;
__system_property_set;
__system_property_set_filename;
__system_property_update;
__system_property_wait_any;
__system_properties_init; # arm x86 mips
__system_property_add; # arm x86 mips
__system_property_area__; # arm x86 mips
__system_property_area_init; # arm x86 mips
__system_property_area_serial; # arm x86 mips
__system_property_find; # arm x86 mips
__system_property_find_nth; # arm x86 mips
__system_property_foreach; # arm x86 mips
__system_property_get; # arm x86 mips
__system_property_read; # arm x86 mips
__system_property_serial; # arm x86 mips
__system_property_set; # arm x86 mips
__system_property_set_filename; # arm x86 mips
__system_property_update; # arm x86 mips
__system_property_wait_any; # arm x86 mips
__timer_create; # arm x86 mips
__timer_delete; # arm x86 mips
__timer_getoverrun; # arm x86 mips
__timer_gettime; # arm x86 mips
__timer_settime; # arm x86 mips
__udivdi3; # arm x86 mips
__umask_chk;
__umoddi3; # x86 mips
__vsnprintf_chk;
__vsprintf_chk;
__waitid; # arm x86 mips
@ -232,7 +214,6 @@ LIBC {
_exit;
_flush_cache; # mips
_flushlbf;
_fwalk; # arm x86 mips
_getlong;
_getshort;
_longjmp;
@ -278,7 +259,6 @@ LIBC {
brk;
bsearch;
btowc;
bzero; # arm x86 mips
c16rtomb;
c32rtomb;
cacheflush; # arm mips
@ -408,7 +388,6 @@ LIBC {
fputws;
fread;
free;
free_malloc_leak_info;
freeaddrinfo;
freelocale;
fremovexattr;
@ -449,7 +428,6 @@ LIBC {
fwscanf;
gai_strerror;
get_avphys_pages;
get_malloc_leak_info;
get_nprocs;
get_nprocs_conf;
get_phys_pages;
@ -695,7 +673,6 @@ LIBC {
mktemp;
mktime;
mktime64; # arm x86 mips
mktime_tz;
mlock;
mlockall;
mmap;
@ -1240,8 +1217,10 @@ LIBC_N {
__pwrite64_chk;
__write_chk;
fileno_unlocked;
freeifaddrs;
getgrgid_r;
getgrnam_r;
getifaddrs;
preadv;
preadv64;
prlimit; # arm mips x86
@ -1268,6 +1247,27 @@ LIBC_PRIVATE {
global:
__accept4; # arm x86 mips
__bionic_brk; # arm x86 mips
__divdi3; # arm x86 mips
__getdents64; # arm x86 mips
__popcountsi2; # arm x86 mips
__sclose; # arm x86 mips
__sflags; # arm x86 mips
__sflush; # arm x86 mips
__sfp; # arm x86 mips
__sglue; # arm x86 mips
__smakebuf; # arm x86 mips
__sread; # arm x86 mips
__srefill; # arm x86 mips
__srget; # arm x86 mips
__sseek; # arm x86 mips
__swbuf; # arm x86 mips
__swrite; # arm x86 mips
__swsetup; # arm x86 mips
__udivdi3; # arm mips
__umoddi3; # x86 mips
_fwalk; # arm x86 mips
free_malloc_leak_info;
get_malloc_leak_info;
gMallocLeakZygoteChild;
SHA1Final; # arm x86 mips
SHA1Init; # arm x86 mips

View File

@ -12,7 +12,6 @@ LIBC {
__cxa_atexit;
__cxa_finalize;
__cxa_thread_atexit_impl;
__divdi3; # arm x86 mips
__dn_comp;
__dn_count_labels;
__dn_skipname;
@ -38,15 +37,10 @@ LIBC {
__freadable;
__fsetlocking;
__fstatfs64; # arm x86 mips
__futex_wait; # arm x86 mips nobrillo
__futex_wake; # arm x86 mips nobrillo
__fwritable;
__get_h_errno;
__get_thread; # arm x86 mips nobrillo
__get_tls; # arm x86 mips nobrillo
__getcpu; # arm x86 mips
__getcwd; # arm x86 mips
__getdents64; # arm x86 mips
__getpid; # arm x86 mips
__getpriority; # arm x86 mips
__gnu_basename;
@ -101,7 +95,6 @@ LIBC {
__ns_skiprr; # arm x86 mips
__ns_sprintrr; # arm x86 mips
__ns_sprintrrf; # arm x86 mips
__open; # arm x86 mips nobrillo
__open_2;
__openat; # arm x86 mips
__openat_2;
@ -118,10 +111,7 @@ LIBC {
__p_time;
__p_type;
__p_type_syms;
__page_shift; # arm x86 mips nobrillo
__page_size; # arm x86 mips nobrillo
__poll_chk;
__popcountsi2; # arm x86 mips
__ppoll; # arm x86 mips
__ppoll_chk;
__pread64_chk;
@ -169,27 +159,14 @@ LIBC {
__sched_cpucount;
__sched_cpufree;
__sched_getaffinity; # arm x86 mips
__sclose; # arm x86 mips
__sdidinit; # arm x86 mips nobrillo
__set_errno; # arm x86 mips nobrillo
__set_tid_address; # arm x86 mips
__set_tls; # arm mips
__sF;
__sflags; # arm x86 mips
__sflush; # arm x86 mips
__sfp; # arm x86 mips
__sglue; # arm x86 mips
__sigaction; # arm x86 mips
__signalfd4; # arm x86 mips
__sinit; # arm x86 mips nobrillo
__smakebuf; # arm x86 mips
__snprintf_chk;
__socket; # arm x86 mips
__sprintf_chk;
__sread; # arm x86 mips
__srefill; # arm x86 mips
__srget; # arm x86 mips
__sseek; # arm x86 mips
__stack_chk_fail;
__stack_chk_guard;
__statfs64; # arm x86 mips
@ -206,45 +183,38 @@ LIBC {
__strncpy_chk;
__strncpy_chk2;
__strrchr_chk;
__swbuf; # arm x86 mips
__swrite; # arm x86 mips
__swsetup; # arm x86 mips
__sym_ntop;
__sym_ntos;
__sym_ston;
__system_properties_init;
__system_property_add;
__system_property_area__;
__system_property_area_init;
__system_property_area_serial;
__system_property_find;
__system_property_find_nth;
__system_property_foreach;
__system_property_get;
__system_property_read;
__system_property_serial;
__system_property_set;
__system_property_set_filename;
__system_property_update;
__system_property_wait_any;
__system_properties_init; # arm x86 mips
__system_property_add; # arm x86 mips
__system_property_area__; # arm x86 mips
__system_property_area_init; # arm x86 mips
__system_property_area_serial; # arm x86 mips
__system_property_find; # arm x86 mips
__system_property_find_nth; # arm x86 mips
__system_property_foreach; # arm x86 mips
__system_property_get; # arm x86 mips
__system_property_read; # arm x86 mips
__system_property_serial; # arm x86 mips
__system_property_set; # arm x86 mips
__system_property_set_filename; # arm x86 mips
__system_property_update; # arm x86 mips
__system_property_wait_any; # arm x86 mips
__timer_create; # arm x86 mips
__timer_delete; # arm x86 mips
__timer_getoverrun; # arm x86 mips
__timer_gettime; # arm x86 mips
__timer_settime; # arm x86 mips
__udivdi3; # arm x86 mips
__umask_chk;
__umoddi3; # x86 mips
__vsnprintf_chk;
__vsprintf_chk;
__wait4; # arm x86 mips nobrillo
__waitid; # arm x86 mips
_ctype_;
_Exit;
_exit;
_flush_cache; # mips
_flushlbf;
_fwalk; # arm x86 mips
_getlong;
_getshort;
_longjmp;
@ -271,9 +241,7 @@ LIBC {
android_gethostbynamefornet;
android_set_abort_message;
arc4random;
arc4random_addrandom; # arm x86 mips nobrillo
arc4random_buf;
arc4random_stir; # arm x86 mips nobrillo
arc4random_uniform;
asctime;
asctime64; # arm x86 mips
@ -287,14 +255,11 @@ LIBC {
atoll;
basename;
basename_r; # arm x86 mips
bcopy; # arm x86 mips nobrillo
bind;
bindresvport;
brk;
bsd_signal; # arm x86 mips nobrillo
bsearch;
btowc;
bzero; # arm x86 mips
c16rtomb;
c32rtomb;
cacheflush; # arm mips
@ -347,7 +312,6 @@ LIBC {
dup3;
duplocale;
endmntent;
endpwent; # arm arm64 x86 x86_64 mips mips64 nobrillo
endservent;
endutent;
environ;
@ -394,7 +358,6 @@ LIBC {
fdatasync;
fdopen;
fdopendir;
fdprintf; # arm x86 mips nobrillo
feof;
feof_unlocked;
ferror;
@ -426,7 +389,6 @@ LIBC {
fputws;
fread;
free;
free_malloc_leak_info;
freeaddrinfo;
freelocale;
fremovexattr;
@ -447,7 +409,6 @@ LIBC {
fsync;
ftell;
ftello;
ftime; # arm x86 mips nobrillo
ftok;
ftruncate;
ftruncate64;
@ -468,7 +429,6 @@ LIBC {
fwscanf;
gai_strerror;
get_avphys_pages;
get_malloc_leak_info;
get_nprocs;
get_nprocs_conf;
get_phys_pages;
@ -480,8 +440,6 @@ LIBC {
getchar_unlocked;
getcwd;
getdelim;
getdents; # arm x86 mips nobrillo
getdtablesize; # arm x86 mips nobrillo
getegid;
getenv;
geteuid;
@ -556,7 +514,6 @@ LIBC {
if_nametoindex;
imaxabs;
imaxdiv;
index; # arm x86 mips nobrillo
inet_addr;
inet_aton;
inet_lnaof;
@ -609,7 +566,6 @@ LIBC {
isprint_l;
ispunct;
ispunct_l;
issetugid; # arm x86 mips nobrillo
isspace;
isspace_l;
isupper;
@ -699,7 +655,6 @@ LIBC {
mempcpy;
memrchr;
memset;
memswap; # arm x86 mips nobrillo
mincore;
mkdir;
mkdirat;
@ -719,7 +674,6 @@ LIBC {
mktemp;
mktime;
mktime64; # arm x86 mips
mktime_tz;
mlock;
mlockall;
mmap;
@ -790,7 +744,6 @@ LIBC {
pthread_attr_getschedpolicy;
pthread_attr_getscope;
pthread_attr_getstack;
pthread_attr_getstackaddr; # arm x86 mips nobrillo
pthread_attr_getstacksize;
pthread_attr_init;
pthread_attr_setdetachstate;
@ -799,7 +752,6 @@ LIBC {
pthread_attr_setschedpolicy;
pthread_attr_setscope;
pthread_attr_setstack;
pthread_attr_setstackaddr; # arm x86 mips nobrillo
pthread_attr_setstacksize;
pthread_cond_broadcast;
pthread_cond_destroy;
@ -1057,8 +1009,6 @@ LIBC {
strncpy;
strndup;
strnlen;
strntoimax; # arm x86 mips nobrillo
strntoumax; # arm x86 mips nobrillo
strpbrk;
strptime;
strrchr;
@ -1077,7 +1027,6 @@ LIBC {
strtoll;
strtoll_l;
strtoq;
strtotimeval; # arm x86 mips nobrillo
strtoul;
strtoull;
strtoull_l;
@ -1099,7 +1048,6 @@ LIBC {
sysinfo;
syslog;
system;
sysv_signal; # arm x86 mips nobrillo
tcdrain;
tcflow;
tcflush;
@ -1131,7 +1079,6 @@ LIBC {
timerfd_settime;
times;
timezone;
tkill; # arm x86 mips nobrillo
tmpfile;
tmpnam;
toascii;
@ -1173,7 +1120,6 @@ LIBC {
vdprintf;
verr;
verrx;
vfdprintf; # arm x86 mips nobrillo
vfork;
vfprintf;
vfscanf;
@ -1193,7 +1139,6 @@ LIBC {
vwprintf;
vwscanf;
wait;
wait3; # arm x86 mips nobrillo
wait4;
waitid;
waitpid;
@ -1242,7 +1187,6 @@ LIBC {
wcstoull;
wcstoull_l;
wcstoumax;
wcswcs; # arm x86 mips nobrillo
wcswidth;
wcsxfrm;
wcsxfrm_l;
@ -1274,8 +1218,10 @@ LIBC_N {
__pwrite64_chk;
__write_chk;
fileno_unlocked;
freeifaddrs;
getgrgid_r;
getgrnam_r;
getifaddrs;
preadv;
preadv64;
prlimit; # arm mips x86
@ -1302,13 +1248,69 @@ LIBC_PRIVATE {
global:
__accept4; # arm x86 mips
__bionic_brk; # arm x86 mips
__divdi3; # arm x86 mips
__futex_wait; # arm x86 mips nobrillo
__futex_wake; # arm x86 mips nobrillo
__get_thread; # arm x86 mips nobrillo
__get_tls; # arm x86 mips nobrillo
__getdents64; # arm x86 mips
__open; # arm x86 mips nobrillo
__page_shift; # arm x86 mips nobrillo
__page_size; # arm x86 mips nobrillo
__popcountsi2; # arm x86 mips
__pthread_gettid; # arm x86 mips nobrillo
__sclose; # arm x86 mips
__sdidinit; # arm x86 mips nobrillo
__set_errno; # arm x86 mips nobrillo
__sflags; # arm x86 mips
__sflush; # arm x86 mips
__sfp; # arm x86 mips
__sglue; # arm x86 mips
__sinit; # arm x86 mips nobrillo
__smakebuf; # arm x86 mips
__sread; # arm x86 mips
__srefill; # arm x86 mips
__srget; # arm x86 mips
__sseek; # arm x86 mips
__swbuf; # arm x86 mips
__swrite; # arm x86 mips
__swsetup; # arm x86 mips
__udivdi3; # arm mips
__umoddi3; # x86 mips
__wait4; # arm x86 mips nobrillo
_fwalk; # arm x86 mips
arc4random_addrandom; # arm x86 mips nobrillo
arc4random_stir; # arm x86 mips nobrillo
bcopy; # arm x86 mips nobrillo
bzero; # arm x86 mips nobrillo
bsd_signal; # arm x86 mips nobrillo
dlmalloc; # arm x86 mips nobrillo
dlmalloc_inspect_all; # arm arm64 x86 x86_64 mips mips64 nobrillo
dlmalloc_trim; # arm arm64 x86 x86_64 mips mips64 nobrillo
dlmalloc_inspect_all; # arm x86 mips nobrillo
dlmalloc_trim; # arm x86 mips nobrillo
dlmalloc_usable_size; # arm x86 mips nobrillo
endpwent; # arm x86 mips nobrillo
fdprintf; # arm x86 mips nobrillo
free_malloc_leak_info;
ftime; # arm x86 mips nobrillo
get_malloc_leak_info;
getdents; # arm x86 mips nobrillo
getdtablesize; # arm x86 mips nobrillo
gMallocLeakZygoteChild;
index; # arm x86 mips nobrillo
issetugid; # arm x86 mips nobrillo
memswap; # arm x86 mips nobrillo
pthread_attr_getstackaddr; # arm x86 mips nobrillo
pthread_attr_setstackaddr; # arm x86 mips nobrillo
SHA1Final; # arm x86 mips
SHA1Init; # arm x86 mips
SHA1Transform; # arm x86 mips
SHA1Update; # arm x86 mips
strntoimax; # arm x86 mips nobrillo
strntoumax; # arm x86 mips nobrillo
strtotimeval; # arm x86 mips nobrillo
sysv_signal; # arm x86 mips nobrillo
tkill; # arm x86 mips nobrillo
vfdprintf; # arm x86 mips nobrillo
wait3; # arm x86 mips nobrillo
wcswcs; # arm x86 mips nobrillo
} LIBC_N;

File diff suppressed because it is too large Load Diff

View File

@ -131,21 +131,6 @@ LIBC {
__sym_ntop;
__sym_ntos;
__sym_ston;
__system_properties_init;
__system_property_add;
__system_property_area__;
__system_property_area_init;
__system_property_area_serial;
__system_property_find;
__system_property_find_nth;
__system_property_foreach;
__system_property_get;
__system_property_read;
__system_property_serial;
__system_property_set;
__system_property_set_filename;
__system_property_update;
__system_property_wait_any;
__umask_chk;
__vsnprintf_chk;
__vsprintf_chk;
@ -241,7 +226,6 @@ LIBC {
dup3;
duplocale;
endmntent;
endpwent; # arm arm64 x86 x86_64 mips mips64 nobrillo
endservent;
endutent;
environ;
@ -317,7 +301,6 @@ LIBC {
fputws;
fread;
free;
free_malloc_leak_info;
freeaddrinfo;
freelocale;
fremovexattr;
@ -358,7 +341,6 @@ LIBC {
fwscanf;
gai_strerror;
get_avphys_pages;
get_malloc_leak_info;
get_nprocs;
get_nprocs_conf;
get_phys_pages;
@ -599,7 +581,6 @@ LIBC {
mkstemps64;
mktemp;
mktime;
mktime_tz;
mlock;
mlockall;
mmap;
@ -1157,8 +1138,10 @@ LIBC_N {
__pwrite64_chk;
__write_chk;
fileno_unlocked;
freeifaddrs;
getgrgid_r;
getgrnam_r;
getifaddrs;
preadv;
preadv64;
pthread_barrierattr_destroy;
@ -1182,7 +1165,22 @@ LIBC_N {
LIBC_PRIVATE {
global:
dlmalloc_inspect_all; # arm arm64 x86 x86_64 mips mips64 nobrillo
dlmalloc_trim; # arm arm64 x86 x86_64 mips mips64 nobrillo
__system_properties_init; # arm64 x86_64 mips64
__system_property_add; # arm64 x86_64 mips64
__system_property_area__; # arm64 x86_64 mips64
__system_property_area_init; # arm64 x86_64 mips64
__system_property_area_serial; # arm64 x86_64 mips64
__system_property_find; # arm64 x86_64 mips64
__system_property_find_nth; # arm64 x86_64 mips64
__system_property_foreach; # arm64 x86_64 mips64
__system_property_get; # arm64 x86_64 mips64
__system_property_read; # arm64 x86_64 mips64
__system_property_serial; # arm64 x86_64 mips64
__system_property_set; # arm64 x86_64 mips64
__system_property_set_filename; # arm64 x86_64 mips64
__system_property_update; # arm64 x86_64 mips64
__system_property_wait_any; # arm64 x86_64 mips64
free_malloc_leak_info;
get_malloc_leak_info;
gMallocLeakZygoteChild;
} LIBC_N;

View File

@ -12,7 +12,6 @@ LIBC {
__cxa_atexit;
__cxa_finalize;
__cxa_thread_atexit_impl;
__divdi3; # arm x86 mips
__dn_comp;
__dn_count_labels;
__dn_skipname;
@ -42,7 +41,6 @@ LIBC {
__get_h_errno;
__getcpu; # arm x86 mips
__getcwd; # arm x86 mips
__getdents64; # arm x86 mips
__getpid; # arm x86 mips
__getpriority; # arm x86 mips
__gnu_basename;
@ -114,7 +112,6 @@ LIBC {
__p_type;
__p_type_syms;
__poll_chk;
__popcountsi2; # arm x86 mips
__ppoll; # arm x86 mips
__ppoll_chk;
__pread64_chk;
@ -161,24 +158,14 @@ LIBC {
__sched_cpucount;
__sched_cpufree;
__sched_getaffinity; # arm x86 mips
__sclose; # arm x86 mips
__set_thread_area; # x86
__set_tid_address; # arm x86 mips
__sF;
__sflags; # arm x86 mips
__sflush; # arm x86 mips
__sfp; # arm x86 mips
__sglue; # arm x86 mips
__sigaction; # arm x86 mips
__signalfd4; # arm x86 mips
__smakebuf; # arm x86 mips
__snprintf_chk;
__socket; # arm x86 mips
__sprintf_chk;
__sread; # arm x86 mips
__srefill; # arm x86 mips
__srget; # arm x86 mips
__sseek; # arm x86 mips
__stack_chk_fail;
__stack_chk_guard;
__statfs64; # arm x86 mips
@ -195,35 +182,31 @@ LIBC {
__strncpy_chk;
__strncpy_chk2;
__strrchr_chk;
__swbuf; # arm x86 mips
__swrite; # arm x86 mips
__swsetup; # arm x86 mips
__sym_ntop;
__sym_ntos;
__sym_ston;
__system_properties_init;
__system_property_add;
__system_property_area__;
__system_property_area_init;
__system_property_area_serial;
__system_property_find;
__system_property_find_nth;
__system_property_foreach;
__system_property_get;
__system_property_read;
__system_property_serial;
__system_property_set;
__system_property_set_filename;
__system_property_update;
__system_property_wait_any;
__system_properties_init; # arm x86 mips
__system_property_add; # arm x86 mips
__system_property_area__; # arm x86 mips
__system_property_area_init; # arm x86 mips
__system_property_area_serial; # arm x86 mips
__system_property_find; # arm x86 mips
__system_property_find_nth; # arm x86 mips
__system_property_foreach; # arm x86 mips
__system_property_get; # arm x86 mips
__system_property_read; # arm x86 mips
__system_property_serial; # arm x86 mips
__system_property_set; # arm x86 mips
__system_property_set_filename; # arm x86 mips
__system_property_update; # arm x86 mips
__system_property_wait_any; # arm x86 mips
__timer_create; # arm x86 mips
__timer_delete; # arm x86 mips
__timer_getoverrun; # arm x86 mips
__timer_gettime; # arm x86 mips
__timer_settime; # arm x86 mips
__udivdi3; # arm x86 mips
__udivdi3; # x86
__umask_chk;
__umoddi3; # x86 mips
__vsnprintf_chk;
__vsprintf_chk;
__waitid; # arm x86 mips
@ -231,7 +214,6 @@ LIBC {
_Exit;
_exit;
_flushlbf;
_fwalk; # arm x86 mips
_getlong;
_getshort;
_longjmp;
@ -277,7 +259,6 @@ LIBC {
brk;
bsearch;
btowc;
bzero; # arm x86 mips
c16rtomb;
c32rtomb;
calloc;
@ -406,7 +387,6 @@ LIBC {
fputws;
fread;
free;
free_malloc_leak_info;
freeaddrinfo;
freelocale;
fremovexattr;
@ -447,7 +427,6 @@ LIBC {
fwscanf;
gai_strerror;
get_avphys_pages;
get_malloc_leak_info;
get_nprocs;
get_nprocs_conf;
get_phys_pages;
@ -693,7 +672,6 @@ LIBC {
mktemp;
mktime;
mktime64; # arm x86 mips
mktime_tz;
mlock;
mlockall;
mmap;
@ -1238,8 +1216,10 @@ LIBC_N {
__pwrite64_chk;
__write_chk;
fileno_unlocked;
freeifaddrs;
getgrgid_r;
getgrnam_r;
getifaddrs;
preadv;
preadv64;
prlimit; # arm mips x86
@ -1267,6 +1247,26 @@ LIBC_PRIVATE {
__accept4; # arm x86 mips
__bionic_brk; # arm x86 mips
__bionic_libgcc_compat_symbols; # arm x86
__divdi3; # arm x86 mips
__getdents64; # arm x86 mips
__popcountsi2; # arm x86 mips
__sclose; # arm x86 mips
__sflags; # arm x86 mips
__sflush; # arm x86 mips
__sfp; # arm x86 mips
__sglue; # arm x86 mips
__smakebuf; # arm x86 mips
__sread; # arm x86 mips
__srefill; # arm x86 mips
__srget; # arm x86 mips
__sseek; # arm x86 mips
__swbuf; # arm x86 mips
__swrite; # arm x86 mips
__swsetup; # arm x86 mips
__umoddi3; # x86 mips
_fwalk; # arm x86 mips
free_malloc_leak_info;
get_malloc_leak_info;
gMallocLeakZygoteChild;
SHA1Final; # arm x86 mips
SHA1Init; # arm x86 mips

View File

@ -12,7 +12,6 @@ LIBC {
__cxa_atexit;
__cxa_finalize;
__cxa_thread_atexit_impl;
__divdi3; # arm x86 mips
__dn_comp;
__dn_count_labels;
__dn_skipname;
@ -38,15 +37,10 @@ LIBC {
__freadable;
__fsetlocking;
__fstatfs64; # arm x86 mips
__futex_wait; # arm x86 mips nobrillo
__futex_wake; # arm x86 mips nobrillo
__fwritable;
__get_h_errno;
__get_thread; # arm x86 mips nobrillo
__get_tls; # arm x86 mips nobrillo
__getcpu; # arm x86 mips
__getcwd; # arm x86 mips
__getdents64; # arm x86 mips
__getpid; # arm x86 mips
__getpriority; # arm x86 mips
__gnu_basename;
@ -101,7 +95,6 @@ LIBC {
__ns_skiprr; # arm x86 mips
__ns_sprintrr; # arm x86 mips
__ns_sprintrrf; # arm x86 mips
__open; # arm x86 mips nobrillo
__open_2;
__openat; # arm x86 mips
__openat_2;
@ -118,10 +111,7 @@ LIBC {
__p_time;
__p_type;
__p_type_syms;
__page_shift; # arm x86 mips nobrillo
__page_size; # arm x86 mips nobrillo
__poll_chk;
__popcountsi2; # arm x86 mips
__ppoll; # arm x86 mips
__ppoll_chk;
__pread64_chk;
@ -169,27 +159,14 @@ LIBC {
__sched_cpucount;
__sched_cpufree;
__sched_getaffinity; # arm x86 mips
__sclose; # arm x86 mips
__sdidinit; # arm x86 mips nobrillo
__set_errno; # arm x86 mips nobrillo
__set_thread_area; # x86
__set_tid_address; # arm x86 mips
__sF;
__sflags; # arm x86 mips
__sflush; # arm x86 mips
__sfp; # arm x86 mips
__sglue; # arm x86 mips
__sigaction; # arm x86 mips
__signalfd4; # arm x86 mips
__sinit; # arm x86 mips nobrillo
__smakebuf; # arm x86 mips
__snprintf_chk;
__socket; # arm x86 mips
__sprintf_chk;
__sread; # arm x86 mips
__srefill; # arm x86 mips
__srget; # arm x86 mips
__sseek; # arm x86 mips
__stack_chk_fail;
__stack_chk_guard;
__statfs64; # arm x86 mips
@ -206,44 +183,38 @@ LIBC {
__strncpy_chk;
__strncpy_chk2;
__strrchr_chk;
__swbuf; # arm x86 mips
__swrite; # arm x86 mips
__swsetup; # arm x86 mips
__sym_ntop;
__sym_ntos;
__sym_ston;
__system_properties_init;
__system_property_add;
__system_property_area__;
__system_property_area_init;
__system_property_area_serial;
__system_property_find;
__system_property_find_nth;
__system_property_foreach;
__system_property_get;
__system_property_read;
__system_property_serial;
__system_property_set;
__system_property_set_filename;
__system_property_update;
__system_property_wait_any;
__system_properties_init; # arm x86 mips
__system_property_add; # arm x86 mips
__system_property_area__; # arm x86 mips
__system_property_area_init; # arm x86 mips
__system_property_area_serial; # arm x86 mips
__system_property_find; # arm x86 mips
__system_property_find_nth; # arm x86 mips
__system_property_foreach; # arm x86 mips
__system_property_get; # arm x86 mips
__system_property_read; # arm x86 mips
__system_property_serial; # arm x86 mips
__system_property_set; # arm x86 mips
__system_property_set_filename; # arm x86 mips
__system_property_update; # arm x86 mips
__system_property_wait_any; # arm x86 mips
__timer_create; # arm x86 mips
__timer_delete; # arm x86 mips
__timer_getoverrun; # arm x86 mips
__timer_gettime; # arm x86 mips
__timer_settime; # arm x86 mips
__udivdi3; # arm x86 mips
__udivdi3; # x86
__umask_chk;
__umoddi3; # x86 mips
__vsnprintf_chk;
__vsprintf_chk;
__wait4; # arm x86 mips nobrillo
__waitid; # arm x86 mips
_ctype_;
_Exit;
_exit;
_flushlbf;
_fwalk; # arm x86 mips
_getlong;
_getshort;
_longjmp;
@ -270,9 +241,7 @@ LIBC {
android_gethostbynamefornet;
android_set_abort_message;
arc4random;
arc4random_addrandom; # arm x86 mips nobrillo
arc4random_buf;
arc4random_stir; # arm x86 mips nobrillo
arc4random_uniform;
asctime;
asctime64; # arm x86 mips
@ -286,14 +255,11 @@ LIBC {
atoll;
basename;
basename_r; # arm x86 mips
bcopy; # arm x86 mips nobrillo
bind;
bindresvport;
brk;
bsd_signal; # arm x86 mips nobrillo
bsearch;
btowc;
bzero; # arm x86 mips
c16rtomb;
c32rtomb;
calloc;
@ -345,7 +311,6 @@ LIBC {
dup3;
duplocale;
endmntent;
endpwent; # arm arm64 x86 x86_64 mips mips64 nobrillo
endservent;
endutent;
environ;
@ -392,7 +357,6 @@ LIBC {
fdatasync;
fdopen;
fdopendir;
fdprintf; # arm x86 mips nobrillo
feof;
feof_unlocked;
ferror;
@ -424,7 +388,6 @@ LIBC {
fputws;
fread;
free;
free_malloc_leak_info;
freeaddrinfo;
freelocale;
fremovexattr;
@ -445,7 +408,6 @@ LIBC {
fsync;
ftell;
ftello;
ftime; # arm x86 mips nobrillo
ftok;
ftruncate;
ftruncate64;
@ -466,7 +428,6 @@ LIBC {
fwscanf;
gai_strerror;
get_avphys_pages;
get_malloc_leak_info;
get_nprocs;
get_nprocs_conf;
get_phys_pages;
@ -478,8 +439,6 @@ LIBC {
getchar_unlocked;
getcwd;
getdelim;
getdents; # arm x86 mips nobrillo
getdtablesize; # arm x86 mips nobrillo
getegid;
getenv;
geteuid;
@ -554,7 +513,6 @@ LIBC {
if_nametoindex;
imaxabs;
imaxdiv;
index; # arm x86 mips nobrillo
inet_addr;
inet_aton;
inet_lnaof;
@ -607,7 +565,6 @@ LIBC {
isprint_l;
ispunct;
ispunct_l;
issetugid; # arm x86 mips nobrillo
isspace;
isspace_l;
isupper;
@ -697,7 +654,6 @@ LIBC {
mempcpy;
memrchr;
memset;
memswap; # arm x86 mips nobrillo
mincore;
mkdir;
mkdirat;
@ -717,7 +673,6 @@ LIBC {
mktemp;
mktime;
mktime64; # arm x86 mips
mktime_tz;
mlock;
mlockall;
mmap;
@ -788,7 +743,6 @@ LIBC {
pthread_attr_getschedpolicy;
pthread_attr_getscope;
pthread_attr_getstack;
pthread_attr_getstackaddr; # arm x86 mips nobrillo
pthread_attr_getstacksize;
pthread_attr_init;
pthread_attr_setdetachstate;
@ -797,7 +751,6 @@ LIBC {
pthread_attr_setschedpolicy;
pthread_attr_setscope;
pthread_attr_setstack;
pthread_attr_setstackaddr; # arm x86 mips nobrillo
pthread_attr_setstacksize;
pthread_cond_broadcast;
pthread_cond_destroy;
@ -1055,8 +1008,6 @@ LIBC {
strncpy;
strndup;
strnlen;
strntoimax; # arm x86 mips nobrillo
strntoumax; # arm x86 mips nobrillo
strpbrk;
strptime;
strrchr;
@ -1075,7 +1026,6 @@ LIBC {
strtoll;
strtoll_l;
strtoq;
strtotimeval; # arm x86 mips nobrillo
strtoul;
strtoull;
strtoull_l;
@ -1097,7 +1047,6 @@ LIBC {
sysinfo;
syslog;
system;
sysv_signal; # arm x86 mips nobrillo
tcdrain;
tcflow;
tcflush;
@ -1129,7 +1078,6 @@ LIBC {
timerfd_settime;
times;
timezone;
tkill; # arm x86 mips nobrillo
tmpfile;
tmpnam;
toascii;
@ -1171,7 +1119,6 @@ LIBC {
vdprintf;
verr;
verrx;
vfdprintf; # arm x86 mips nobrillo
vfork;
vfprintf;
vfscanf;
@ -1191,7 +1138,6 @@ LIBC {
vwprintf;
vwscanf;
wait;
wait3; # arm x86 mips nobrillo
wait4;
waitid;
waitpid;
@ -1240,7 +1186,6 @@ LIBC {
wcstoull;
wcstoull_l;
wcstoumax;
wcswcs; # arm x86 mips nobrillo
wcswidth;
wcsxfrm;
wcsxfrm_l;
@ -1272,8 +1217,10 @@ LIBC_N {
__pwrite64_chk;
__write_chk;
fileno_unlocked;
freeifaddrs;
getgrgid_r;
getgrnam_r;
getifaddrs;
preadv;
preadv64;
prlimit; # arm mips x86
@ -1301,13 +1248,68 @@ LIBC_PRIVATE {
__accept4; # arm x86 mips
__bionic_brk; # arm x86 mips
__bionic_libgcc_compat_symbols; # arm x86
__divdi3; # arm x86 mips
__futex_wait; # arm x86 mips nobrillo
__futex_wake; # arm x86 mips nobrillo
__get_thread; # arm x86 mips nobrillo
__get_tls; # arm x86 mips nobrillo
__getdents64; # arm x86 mips
__open; # arm x86 mips nobrillo
__page_shift; # arm x86 mips nobrillo
__page_size; # arm x86 mips nobrillo
__popcountsi2; # arm x86 mips
__pthread_gettid; # arm x86 mips nobrillo
__sclose; # arm x86 mips
__sdidinit; # arm x86 mips nobrillo
__set_errno; # arm x86 mips nobrillo
__sflags; # arm x86 mips
__sflush; # arm x86 mips
__sfp; # arm x86 mips
__sglue; # arm x86 mips
__sinit; # arm x86 mips nobrillo
__smakebuf; # arm x86 mips
__sread; # arm x86 mips
__srefill; # arm x86 mips
__srget; # arm x86 mips
__sseek; # arm x86 mips
__swbuf; # arm x86 mips
__swrite; # arm x86 mips
__swsetup; # arm x86 mips
__umoddi3; # x86 mips
__wait4; # arm x86 mips nobrillo
_fwalk; # arm x86 mips
arc4random_addrandom; # arm x86 mips nobrillo
arc4random_stir; # arm x86 mips nobrillo
bcopy; # arm x86 mips nobrillo
bzero; # arm x86 mips nobrillo
bsd_signal; # arm x86 mips nobrillo
dlmalloc; # arm x86 mips nobrillo
dlmalloc_inspect_all; # arm arm64 x86 x86_64 mips mips64 nobrillo
dlmalloc_trim; # arm arm64 x86 x86_64 mips mips64 nobrillo
dlmalloc_inspect_all; # arm x86 mips nobrillo
dlmalloc_trim; # arm x86 mips nobrillo
dlmalloc_usable_size; # arm x86 mips nobrillo
endpwent; # arm x86 mips nobrillo
fdprintf; # arm x86 mips nobrillo
free_malloc_leak_info;
ftime; # arm x86 mips nobrillo
get_malloc_leak_info;
getdents; # arm x86 mips nobrillo
getdtablesize; # arm x86 mips nobrillo
gMallocLeakZygoteChild;
index; # arm x86 mips nobrillo
issetugid; # arm x86 mips nobrillo
memswap; # arm x86 mips nobrillo
pthread_attr_getstackaddr; # arm x86 mips nobrillo
pthread_attr_setstackaddr; # arm x86 mips nobrillo
SHA1Final; # arm x86 mips
SHA1Init; # arm x86 mips
SHA1Transform; # arm x86 mips
SHA1Update; # arm x86 mips
strntoimax; # arm x86 mips nobrillo
strntoumax; # arm x86 mips nobrillo
strtotimeval; # arm x86 mips nobrillo
sysv_signal; # arm x86 mips nobrillo
tkill; # arm x86 mips nobrillo
vfdprintf; # arm x86 mips nobrillo
wait3; # arm x86 mips nobrillo
wcswcs; # arm x86 mips nobrillo
} LIBC_N;

File diff suppressed because it is too large Load Diff

View File

@ -131,21 +131,6 @@ LIBC {
__sym_ntop;
__sym_ntos;
__sym_ston;
__system_properties_init;
__system_property_add;
__system_property_area__;
__system_property_area_init;
__system_property_area_serial;
__system_property_find;
__system_property_find_nth;
__system_property_foreach;
__system_property_get;
__system_property_read;
__system_property_serial;
__system_property_set;
__system_property_set_filename;
__system_property_update;
__system_property_wait_any;
__umask_chk;
__vsnprintf_chk;
__vsprintf_chk;
@ -241,7 +226,6 @@ LIBC {
dup3;
duplocale;
endmntent;
endpwent; # arm arm64 x86 x86_64 mips mips64 nobrillo
endservent;
endutent;
environ;
@ -317,7 +301,6 @@ LIBC {
fputws;
fread;
free;
free_malloc_leak_info;
freeaddrinfo;
freelocale;
fremovexattr;
@ -358,7 +341,6 @@ LIBC {
fwscanf;
gai_strerror;
get_avphys_pages;
get_malloc_leak_info;
get_nprocs;
get_nprocs_conf;
get_phys_pages;
@ -599,7 +581,6 @@ LIBC {
mkstemps64;
mktemp;
mktime;
mktime_tz;
mlock;
mlockall;
mmap;
@ -1157,8 +1138,10 @@ LIBC_N {
__pwrite64_chk;
__write_chk;
fileno_unlocked;
freeifaddrs;
getgrgid_r;
getgrnam_r;
getifaddrs;
preadv;
preadv64;
pthread_barrierattr_destroy;
@ -1182,7 +1165,22 @@ LIBC_N {
LIBC_PRIVATE {
global:
dlmalloc_inspect_all; # arm arm64 x86 x86_64 mips mips64 nobrillo
dlmalloc_trim; # arm arm64 x86 x86_64 mips mips64 nobrillo
__system_properties_init; # arm64 x86_64 mips64
__system_property_add; # arm64 x86_64 mips64
__system_property_area__; # arm64 x86_64 mips64
__system_property_area_init; # arm64 x86_64 mips64
__system_property_area_serial; # arm64 x86_64 mips64
__system_property_find; # arm64 x86_64 mips64
__system_property_find_nth; # arm64 x86_64 mips64
__system_property_foreach; # arm64 x86_64 mips64
__system_property_get; # arm64 x86_64 mips64
__system_property_read; # arm64 x86_64 mips64
__system_property_serial; # arm64 x86_64 mips64
__system_property_set; # arm64 x86_64 mips64
__system_property_set_filename; # arm64 x86_64 mips64
__system_property_update; # arm64 x86_64 mips64
__system_property_wait_any; # arm64 x86_64 mips64
free_malloc_leak_info;
get_malloc_leak_info;
gMallocLeakZygoteChild;
} LIBC_N;

View File

@ -38,32 +38,25 @@ class KernelArgumentBlock {
argv = reinterpret_cast<char**>(args + 1);
envp = argv + argc + 1;
// Skip over all environment variable definitions to find aux vector.
// The end of the environment block is marked by two NULL pointers.
// Skip over all environment variable definitions to find the aux vector.
// The end of the environment block is marked by a NULL pointer.
char** p = envp;
while (*p != NULL) {
++p;
}
++p; // Skip second NULL;
++p; // Skip the NULL itself.
auxv = reinterpret_cast<ElfW(auxv_t)*>(p);
}
// Similar to ::getauxval but doesn't require the libc global variables to be set up,
// so it's safe to call this really early on. This function also lets you distinguish
// between the inability to find the given type and its value just happening to be 0.
unsigned long getauxval(unsigned long type, bool* found_match = NULL) {
// so it's safe to call this really early on.
unsigned long getauxval(unsigned long type) {
for (ElfW(auxv_t)* v = auxv; v->a_type != AT_NULL; ++v) {
if (v->a_type == type) {
if (found_match != NULL) {
*found_match = true;
}
return v->a_un.a_val;
}
}
if (found_match != NULL) {
*found_match = false;
}
return 0;
}

View File

@ -42,8 +42,8 @@
(((value) + (alignment) - 1) & ~((alignment) - 1))
#define BIONIC_ROUND_UP_POWER_OF_2(value) \
(sizeof(value) == 8) \
((sizeof(value) == 8) \
? (1UL << (64 - __builtin_clzl(static_cast<unsigned long>(value)))) \
: (1UL << (32 - __builtin_clz(static_cast<unsigned int>(value))))
: (1UL << (32 - __builtin_clz(static_cast<unsigned int>(value)))))
#endif // _BIONIC_MACROS_H_

View File

@ -47,14 +47,17 @@ __LIBC_HIDDEN__ void absolute_timespec_from_timespec(timespec& abs_ts, const tim
__END_DECLS
static inline int check_timespec(const timespec* ts) {
if (ts != nullptr) {
if (ts->tv_nsec < 0 || ts->tv_nsec >= NS_PER_S) {
return EINVAL;
}
if (ts->tv_sec < 0) {
return ETIMEDOUT;
}
static inline int check_timespec(const timespec* ts, bool null_allowed) {
if (null_allowed && ts == nullptr) {
return 0;
}
// glibc just segfaults if you pass a null timespec.
// That seems a lot more likely to catch bad code than returning EINVAL.
if (ts->tv_nsec < 0 || ts->tv_nsec >= NS_PER_S) {
return EINVAL;
}
if (ts->tv_sec < 0) {
return ETIMEDOUT;
}
return 0;
}

View File

@ -121,7 +121,7 @@ __END_DECLS
#if defined(__cplusplus)
class KernelArgumentBlock;
extern __LIBC_HIDDEN__ void __libc_init_main_thread(KernelArgumentBlock& args);
extern __LIBC_HIDDEN__ void __libc_init_main_thread(KernelArgumentBlock&);
#endif
#endif /* __BIONIC_PRIVATE_BIONIC_TLS_H_ */

View File

@ -2462,50 +2462,4 @@ static int __bionic_open_tzdata(const char* olson_id) {
return fd;
}
// Caches the most recent timezone (http://b/8270865).
static int __bionic_tzload_cached(const char* name, struct state* const sp, const int doextend) {
lock();
// Our single-item cache.
static char* g_cached_time_zone_name;
static struct state g_cached_time_zone;
// Do we already have this timezone cached?
if (g_cached_time_zone_name != NULL && strcmp(name, g_cached_time_zone_name) == 0) {
*sp = g_cached_time_zone;
unlock();
return 0;
}
// Can we load it?
int rc = tzload(name, sp, doextend);
if (rc == 0) {
// Update the cache.
free(g_cached_time_zone_name);
g_cached_time_zone_name = strdup(name);
g_cached_time_zone = *sp;
}
unlock();
return rc;
}
// Non-standard API: mktime(3) but with an explicit timezone parameter.
// This can't actually be hidden/removed until we fix MtpUtils.cpp
__attribute__((visibility("default"))) time_t mktime_tz(struct tm* const tmp, const char* tz) {
struct state* st = malloc(sizeof(*st));
time_t return_value;
if (st == NULL)
return 0;
if (__bionic_tzload_cached(tz, st, true) != 0) {
// TODO: not sure what's best here, but for now, we fall back to gmt.
gmtload(st);
}
return_value = time1(tmp, localsub, st, 0L);
free(st);
return return_value;
}
// END android-added

View File

@ -4822,8 +4822,13 @@ void* dlcalloc(size_t n_elements, size_t elem_size) {
req = MAX_SIZE_T; /* force downstream failure on overflow */
}
mem = dlmalloc(req);
if (mem != 0 && calloc_must_clear(mem2chunk(mem)))
memset(mem, 0, req);
if (mem != 0) {
mchunkptr p = mem2chunk(mem);
if (calloc_must_clear(p)) {
/* Make sure to clear all of the buffer, not just the requested size. */
memset(mem, 0, chunksize(p) - overhead_for(p));
}
}
return mem;
}

View File

@ -18,6 +18,7 @@ LIBC_N {
global:
android_init_namespaces;
android_create_namespace;
dlvsym;
} LIBC;
LIBC_PRIVATE {

View File

@ -17,6 +17,7 @@ LIBC_N {
global:
android_init_namespaces;
android_create_namespace;
dlvsym;
} LIBC;
LIBC_PRIVATE {

View File

@ -24,9 +24,17 @@
// in the dynamic linker and hijacked at runtime.
void* dlopen(const char* filename __unused, int flag __unused) { return 0; }
const char* dlerror(void) { return 0; }
void* dlsym(void* handle __unused, const char* symbol __unused) { return 0; }
void* dlvsym(void* handle __unused, const char* symbol __unused, const char* version __unused) {
return 0;
}
int dladdr(const void* addr __unused, Dl_info* info __unused) { return 0; }
int dlclose(void* handle __unused) { return 0; }
#if defined(__arm__)
@ -57,7 +65,7 @@ bool android_init_namespaces(const char* public_ns_sonames __unused,
struct android_namespace_t* android_create_namespace(const char* name __unused,
const char* ld_library_path __unused,
const char* default_library_path __unused,
bool isolated __unused,
uint64_t type __unused,
const char* permitted_when_isolated_path __unused) {
return 0;
}

View File

@ -32,6 +32,7 @@ LIBC_N {
global:
android_init_namespaces;
android_create_namespace;
dlvsym;
} LIBC;
LIBC_PRIVATE {

View File

@ -17,6 +17,7 @@ LIBC_N {
global:
android_init_namespaces;
android_create_namespace;
dlvsym;
} LIBC;
LIBC_PRIVATE {

View File

@ -17,6 +17,7 @@ LIBC_N {
global:
android_init_namespaces;
android_create_namespace;
dlvsym;
} LIBC;
LIBC_PRIVATE {

View File

@ -17,6 +17,7 @@ LIBC_N {
global:
android_init_namespaces;
android_create_namespace;
dlvsym;
} LIBC;
LIBC_PRIVATE {

View File

@ -17,6 +17,7 @@ LIBC_N {
global:
android_init_namespaces;
android_create_namespace;
dlvsym;
} LIBC;
LIBC_PRIVATE {

View File

@ -88,11 +88,10 @@ void* dlopen(const char* filename, int flags) {
extern android_namespace_t* g_anonymous_namespace;
void* dlsym(void* handle, const char* symbol) {
void* caller_addr = __builtin_return_address(0);
void* dlsym_impl(void* handle, const char* symbol, const char* version, void* caller_addr) {
ScopedPthreadMutexLocker locker(&g_dl_mutex);
void* result;
if (!do_dlsym(handle, symbol, nullptr, caller_addr, &result)) {
if (!do_dlsym(handle, symbol, version, caller_addr, &result)) {
__bionic_format_dlerror(linker_get_error_buffer(), nullptr);
return nullptr;
}
@ -100,6 +99,16 @@ void* dlsym(void* handle, const char* symbol) {
return result;
}
void* dlsym(void* handle, const char* symbol) {
void* caller_addr = __builtin_return_address(0);
return dlsym_impl(handle, symbol, nullptr, caller_addr);
}
void* dlvsym(void* handle, const char* symbol, const char* version) {
void* caller_addr = __builtin_return_address(0);
return dlsym_impl(handle, symbol, version, caller_addr);
}
int dladdr(const void* addr, Dl_info* info) {
ScopedPthreadMutexLocker locker(&g_dl_mutex);
return do_dladdr(addr, info);
@ -139,12 +148,14 @@ bool android_init_namespaces(const char* public_ns_sonames,
}
android_namespace_t* android_create_namespace(const char* name, const char* ld_library_path,
const char* default_library_path, bool is_isolated,
const char* default_library_path, uint64_t type,
const char* permitted_when_isolated_path) {
void* caller_addr = __builtin_return_address(0);
ScopedPthreadMutexLocker locker(&g_dl_mutex);
android_namespace_t* result = create_namespace(name, ld_library_path, default_library_path,
is_isolated, permitted_when_isolated_path);
android_namespace_t* result = create_namespace(caller_addr, name, ld_library_path,
default_library_path, type,
permitted_when_isolated_path);
if (result == nullptr) {
__bionic_format_dlerror("android_create_namespace failed", linker_get_error_buffer());
@ -179,11 +190,11 @@ static const char ANDROID_LIBDL_STRTAB[] =
// 00000000001 1111111112222222222 3333333333444444444455555555556666666666777 777777788888888889999999999
// 01234567890 1234567890123456789 0123456789012345678901234567890123456789012 345678901234567890123456789
"erate_phdr\0android_dlopen_ext\0android_set_application_target_sdk_version\0android_get_application_tar"
// 0000000000111111 111122222222223333333333 4444444444555555555566666
// 0123456789012345 678901234567890123456789 0123456789012345678901234
"get_sdk_version\0android_init_namespaces\0android_create_namespace\0"
// 0000000000111111 111122222222223333333333 4444444444555555555566666 6666677
// 0123456789012345 678901234567890123456789 0123456789012345678901234 5678901
"get_sdk_version\0android_init_namespaces\0android_create_namespace\0dlvsym\0"
#if defined(__arm__)
// 265
// 272
"dl_unwind_find_exidx\0"
#endif
;
@ -207,8 +218,9 @@ static ElfW(Sym) g_libdl_symtab[] = {
ELFW(SYM_INITIALIZER)(173, &android_get_application_target_sdk_version, 1),
ELFW(SYM_INITIALIZER)(216, &android_init_namespaces, 1),
ELFW(SYM_INITIALIZER)(240, &android_create_namespace, 1),
ELFW(SYM_INITIALIZER)(265, &dlvsym, 1),
#if defined(__arm__)
ELFW(SYM_INITIALIZER)(265, &dl_unwind_find_exidx, 1),
ELFW(SYM_INITIALIZER)(272, &dl_unwind_find_exidx, 1),
#endif
};
@ -225,9 +237,9 @@ static ElfW(Sym) g_libdl_symtab[] = {
// Note that adding any new symbols here requires stubbing them out in libdl.
static unsigned g_libdl_buckets[1] = { 1 };
#if defined(__arm__)
static unsigned g_libdl_chains[] = { 0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 0 };
static unsigned g_libdl_chains[] = { 0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0 };
#else
static unsigned g_libdl_chains[] = { 0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 0 };
static unsigned g_libdl_chains[] = { 0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 0 };
#endif
static uint8_t __libdl_info_buf[sizeof(soinfo)] __attribute__((aligned(8)));

View File

@ -1747,7 +1747,6 @@ static bool load_library(android_namespace_t* ns,
});
return true;
}
static bool load_library(android_namespace_t* ns,
@ -2187,7 +2186,7 @@ static std::string symbol_display_name(const char* sym_name, const char* sym_ver
return sym_name;
}
return std::string(sym_name) + "@" + sym_ver;
return std::string(sym_name) + ", version " + sym_ver;
}
void do_android_get_LD_LIBRARY_PATH(char* buffer, size_t buffer_size) {
@ -2312,8 +2311,8 @@ bool do_dlsym(void* handle, const char* sym_name, const char* sym_ver,
version_info* vi = nullptr;
if (sym_ver != nullptr) {
vi_instance.name = sym_name;
vi_instance.elf_hash = calculate_elf_hash(sym_name);
vi_instance.name = sym_ver;
vi_instance.elf_hash = calculate_elf_hash(sym_ver);
vi = &vi_instance;
}
@ -2377,8 +2376,12 @@ bool init_namespaces(const char* public_ns_sonames, const char* anon_ns_library_
g_public_namespace_initialized = true;
// create anonymous namespace
// When the caller is nullptr - create_namespace will take global group
// from the anonymous namespace, which is fine because anonymous namespace
// is still pointing to the default one.
android_namespace_t* anon_ns =
create_namespace("(anonymous)", nullptr, anon_ns_library_path, false, nullptr);
create_namespace(nullptr, "(anonymous)", nullptr, anon_ns_library_path,
ANDROID_NAMESPACE_TYPE_REGULAR, nullptr);
if (anon_ns == nullptr) {
g_public_namespace_initialized = false;
@ -2389,16 +2392,23 @@ bool init_namespaces(const char* public_ns_sonames, const char* anon_ns_library_
return true;
}
android_namespace_t* create_namespace(const char* name,
android_namespace_t* create_namespace(const void* caller_addr,
const char* name,
const char* ld_library_path,
const char* default_library_path,
bool is_isolated,
uint64_t type,
const char* permitted_when_isolated_path) {
if (!g_public_namespace_initialized) {
DL_ERR("cannot create namespace: public namespace is not initialized.");
return nullptr;
}
soinfo* caller_soinfo = find_containing_library(caller_addr);
android_namespace_t* caller_ns = caller_soinfo != nullptr ?
caller_soinfo->get_namespace() :
g_anonymous_namespace;
ProtectedDataGuard guard;
std::vector<std::string> ld_library_paths;
std::vector<std::string> default_library_paths;
@ -2410,14 +2420,20 @@ android_namespace_t* create_namespace(const char* name,
android_namespace_t* ns = new (g_namespace_allocator.alloc()) android_namespace_t();
ns->set_name(name);
ns->set_isolated(is_isolated);
ns->set_isolated((type & ANDROID_NAMESPACE_TYPE_ISOLATED) != 0);
ns->set_ld_library_paths(std::move(ld_library_paths));
ns->set_default_library_paths(std::move(default_library_paths));
ns->set_permitted_paths(std::move(permitted_paths));
// TODO(dimtiry): Should this be global group of caller's namespace?
auto global_group = make_global_group(&g_default_namespace);
std::copy(global_group.begin(), global_group.end(), std::back_inserter(ns->soinfo_list()));
if ((type & ANDROID_NAMESPACE_TYPE_SHARED) != 0) {
// If shared - clone the caller namespace
auto& soinfo_list = caller_ns->soinfo_list();
std::copy(soinfo_list.begin(), soinfo_list.end(), std::back_inserter(ns->soinfo_list()));
} else {
// If not shared - copy only the global group
auto global_group = make_global_group(caller_ns);
std::copy(global_group.begin(), global_group.end(), std::back_inserter(ns->soinfo_list()));
}
return ns;
}
@ -3251,7 +3267,7 @@ bool soinfo::prelink_image() {
/* We can't log anything until the linker is relocated */
bool relocating_linker = (flags_ & FLAG_LINKER) != 0;
if (!relocating_linker) {
INFO("[ linking %s ]", get_realpath());
INFO("[ Linking '%s' ]", get_realpath());
DEBUG("si->base = %p si->flags = 0x%08x", reinterpret_cast<void*>(base), flags_);
}
@ -3938,17 +3954,27 @@ static ElfW(Addr) __linker_init_post_relocation(KernelArgumentBlock& args, ElfW(
g_ld_debug_verbosity = atoi(LD_DEBUG);
}
#if defined(__LP64__)
INFO("[ Android dynamic linker (64-bit) ]");
#else
INFO("[ Android dynamic linker (32-bit) ]");
#endif
// These should have been sanitized by __libc_init_AT_SECURE, but the test
// doesn't cost us anything.
const char* ldpath_env = nullptr;
const char* ldpreload_env = nullptr;
if (!getauxval(AT_SECURE)) {
ldpath_env = getenv("LD_LIBRARY_PATH");
if (ldpath_env != nullptr) {
INFO("[ LD_LIBRARY_PATH set to '%s' ]", ldpath_env);
}
ldpreload_env = getenv("LD_PRELOAD");
if (ldpreload_env != nullptr) {
INFO("[ LD_PRELOAD set to '%s' ]", ldpreload_env);
}
}
INFO("[ android linker & debugger ]");
soinfo* si = soinfo_alloc(&g_default_namespace, args.argv[0], nullptr, 0, RTLD_GLOBAL);
if (si == nullptr) {
exit(EXIT_FAILURE);
@ -4128,6 +4154,7 @@ static ElfW(Addr) get_elf_exec_load_bias(const ElfW(Ehdr)* elf) {
return 0;
}
extern "C" int __set_tls(void*);
extern "C" void _start();
/*
@ -4142,6 +4169,9 @@ extern "C" void _start();
extern "C" ElfW(Addr) __linker_init(void* raw_args) {
KernelArgumentBlock args(raw_args);
void* tls[BIONIC_TLS_SLOTS];
__set_tls(tls);
ElfW(Addr) linker_addr = args.getauxval(AT_BASE);
ElfW(Addr) entry_point = args.getauxval(AT_ENTRY);
ElfW(Ehdr)* elf_hdr = reinterpret_cast<ElfW(Ehdr)*>(linker_addr);
@ -4197,7 +4227,7 @@ extern "C" ElfW(Addr) __linker_init(void* raw_args) {
args.abort_message_ptr = &g_abort_message;
ElfW(Addr) start_address = __linker_init_post_relocation(args, linker_addr);
INFO("[ jumping to _start ]");
INFO("[ Jumping to _start (%p)... ]", reinterpret_cast<void*>(start_address));
// Return the address that the calling assembly stub should jump to.
return start_address;

View File

@ -444,8 +444,8 @@ void set_application_target_sdk_version(uint32_t target);
uint32_t get_application_target_sdk_version();
bool init_namespaces(const char* public_ns_sonames, const char* anon_ns_library_path);
android_namespace_t* create_namespace(const char* name, const char* ld_library_path,
const char* default_library_path, bool is_isolated,
const char* permitted_when_isolated_path);
android_namespace_t* create_namespace(const void* caller_addr, const char* name,
const char* ld_library_path, const char* default_library_path,
uint64_t type, const char* permitted_when_isolated_path);
#endif

View File

@ -55,6 +55,7 @@
*********************************************************************/
#include "private/libc_logging.h"
#include <unistd.h>
__LIBC_HIDDEN__ extern int g_ld_debug_verbosity;

View File

@ -40,7 +40,7 @@ test_cflags = \
test_cflags += -D__STDC_LIMIT_MACROS # For glibc.
ifeq ($(MALLOC_IMPL),dlmalloc)
ifeq ($(MALLOC_SVELTE),true)
test_cflags += -DUSE_DLMALLOC
else
test_cflags += -DUSE_JEMALLOC
@ -51,6 +51,7 @@ test_cppflags := \
libBionicStandardTests_src_files := \
arpa_inet_test.cpp \
buffer_tests.cpp \
bug_26110743_test.cpp \
complex_test.cpp \
ctype_test.cpp \
dirent_test.cpp \
@ -61,6 +62,7 @@ libBionicStandardTests_src_files := \
ftw_test.cpp \
getauxval_test.cpp \
getcwd_test.cpp \
ifaddrs_test.cpp \
inttypes_test.cpp \
libc_logging_test.cpp \
libgen_basename_test.cpp \
@ -120,7 +122,7 @@ libBionicStandardTests_src_files := \
libBionicStandardTests_cflags := \
$(test_cflags) \
ifeq ($(MALLOC_IMPL),dlmalloc)
ifeq ($(MALLOC_SVELTE),true)
libBionicStandardTests_cflags += -DUSE_DLMALLOC
else
libBionicStandardTests_cflags += -DUSE_JEMALLOC

113
tests/bug_26110743_test.cpp Normal file
View File

@ -0,0 +1,113 @@
/*
* Copyright (C) 2015 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <gtest/gtest.h>
#include <pthread.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/prctl.h>
#include "private/ScopeGuard.h"
extern "C" pid_t gettid();
static void ProcSelfReadlinkBody() {
char buf[100];
char buf2[1024];
int fd = open("/dev/null", O_RDWR | O_CLOEXEC);
ASSERT_NE(-1, fd);
snprintf(buf, sizeof(buf), "/proc/self/fd/%d", fd);
const char* ERRORMSG = "Please apply the following two kernel patches:\n"
"* https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=73af963f9f3036dffed55c3a2898598186db1045\n"
"* https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=96d0df79f2644fc823f26c06491e182d87a90c2a\n";
ASSERT_NE(-1, readlink(buf, buf2, sizeof(buf2))) << ERRORMSG;
ASSERT_STREQ("/dev/null", buf2);
close(fd);
}
static void* ProcSelfReadlink(void*) {
ProcSelfReadlinkBody();
return NULL;
}
TEST(bug_26110743, ProcSelfReadlink) {
pthread_t t;
ASSERT_EQ(0, pthread_create(&t, NULL, ProcSelfReadlink, NULL));
void* result;
ASSERT_EQ(0, pthread_join(t, &result));
ASSERT_EQ(NULL, result);
}
TEST(bug_26110743, ProcSelfReadlink_NotDumpable) {
int dumpable = prctl(PR_GET_DUMPABLE, 0, 0, 0, 0);
prctl(PR_SET_DUMPABLE, 0, 0, 0, 0);
auto guard = make_scope_guard([&]() {
// restore dumpable
prctl(PR_SET_DUMPABLE, dumpable, 0, 0, 0);
});
pthread_t t;
ASSERT_EQ(0, pthread_create(&t, NULL, ProcSelfReadlink, NULL));
void* result;
ASSERT_EQ(0, pthread_join(t, &result));
ASSERT_EQ(NULL, result);
}
static void ProcTaskFdReadlinkBody() {
char buf[200];
char buf2[1024];
int fd = open("/dev/null", O_RDWR | O_CLOEXEC);
ASSERT_NE(-1, fd);
pid_t mypid = getpid();
pid_t mytid = gettid();
ASSERT_NE(mypid, mytid);
snprintf(buf, sizeof(buf), "/proc/%d/task/%d/fd/%d", mypid, mytid, fd);
const char* ERRORMSG = "Please apply the following kernel patch:\n"
"* https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=54708d2858e79a2bdda10bf8a20c80eb96c20613\n";
ASSERT_NE(-1, readlink(buf, buf2, sizeof(buf2))) << ERRORMSG;
ASSERT_STREQ("/dev/null", buf2);
close(fd);
}
static void* ProcTaskFdReadlink(void*) {
ProcTaskFdReadlinkBody();
return NULL;
}
TEST(bug_26110743, ProcTaskFdReadlink) {
pthread_t t;
ASSERT_EQ(0, pthread_create(&t, NULL, ProcTaskFdReadlink, NULL));
void* result;
ASSERT_EQ(0, pthread_join(t, &result));
ASSERT_EQ(NULL, result);
}
TEST(bug_26110743, ProcTaskFdReadlink_NotDumpable) {
int dumpable = prctl(PR_GET_DUMPABLE, 0, 0, 0, 0);
prctl(PR_SET_DUMPABLE, 0, 0, 0, 0);
auto guard = make_scope_guard([&]() {
// restore dumpable
prctl(PR_SET_DUMPABLE, dumpable, 0, 0, 0);
});
pthread_t t;
ASSERT_EQ(0, pthread_create(&t, NULL, ProcTaskFdReadlink, NULL));
void* result;
ASSERT_EQ(0, pthread_join(t, &result));
ASSERT_EQ(NULL, result);
}

View File

@ -625,13 +625,21 @@ TEST(dlext, ns_smoke) {
// Check that libraries added to public namespace are NODELETE
dlclose(handle_public);
handle_public = dlopen((lib_path + "/public_namespace_libs/" + g_public_lib).c_str(), RTLD_NOW | RTLD_NOLOAD);
handle_public = dlopen((lib_path + "/public_namespace_libs/" + g_public_lib).c_str(),
RTLD_NOW | RTLD_NOLOAD);
ASSERT_TRUE(handle_public != nullptr) << dlerror();
android_namespace_t* ns1 = android_create_namespace("private", nullptr, (lib_path + "/private_namespace_libs").c_str(), false, nullptr);
android_namespace_t* ns1 =
android_create_namespace("private", nullptr,
(lib_path + "/private_namespace_libs").c_str(),
ANDROID_NAMESPACE_TYPE_REGULAR, nullptr);
ASSERT_TRUE(ns1 != nullptr) << dlerror();
android_namespace_t* ns2 = android_create_namespace("private_isolated", nullptr, (lib_path + "/private_namespace_libs").c_str(), true, nullptr);
android_namespace_t* ns2 =
android_create_namespace("private_isolated", nullptr,
(lib_path + "/private_namespace_libs").c_str(),
ANDROID_NAMESPACE_TYPE_ISOLATED, nullptr);
ASSERT_TRUE(ns2 != nullptr) << dlerror();
// This should not have affect search path for default namespace:
@ -732,13 +740,22 @@ TEST(dlext, ns_isolated) {
ASSERT_TRUE(android_init_namespaces(path.c_str(), nullptr)) << dlerror();
android_namespace_t* ns_not_isolated = android_create_namespace("private", nullptr, (lib_path + "/private_namespace_libs").c_str(), false, nullptr);
android_namespace_t* ns_not_isolated =
android_create_namespace("private", nullptr,
(lib_path + "/private_namespace_libs").c_str(),
ANDROID_NAMESPACE_TYPE_REGULAR, nullptr);
ASSERT_TRUE(ns_not_isolated != nullptr) << dlerror();
android_namespace_t* ns_isolated = android_create_namespace("private_isolated1", nullptr, (lib_path + "/private_namespace_libs").c_str(), true, nullptr);
android_namespace_t* ns_isolated =
android_create_namespace("private_isolated1", nullptr,
(lib_path + "/private_namespace_libs").c_str(),
ANDROID_NAMESPACE_TYPE_ISOLATED, nullptr);
ASSERT_TRUE(ns_isolated != nullptr) << dlerror();
android_namespace_t* ns_isolated2 = android_create_namespace("private_isolated2", (lib_path + "/private_namespace_libs").c_str(), nullptr, true, lib_path.c_str());
android_namespace_t* ns_isolated2 =
android_create_namespace("private_isolated2",
(lib_path + "/private_namespace_libs").c_str(),
nullptr, ANDROID_NAMESPACE_TYPE_ISOLATED, lib_path.c_str());
ASSERT_TRUE(ns_isolated2 != nullptr) << dlerror();
ASSERT_TRUE(dlopen(root_lib, RTLD_NOW) == nullptr);
@ -808,6 +825,122 @@ TEST(dlext, ns_isolated) {
dlclose(handle1);
}
TEST(dlext, ns_shared) {
static const char* root_lib = "libnstest_root_not_isolated.so";
static const char* root_lib_isolated = "libnstest_root.so";
std::string path = std::string("libc.so:libc++.so:libdl.so:libm.so:") + g_public_lib;
const std::string lib_path = std::string(getenv("ANDROID_DATA")) + NATIVE_TESTS_PATH;
const std::string lib_public_path = lib_path + "/public_namespace_libs/" + g_public_lib;
void* handle_public = dlopen(lib_public_path.c_str(), RTLD_NOW);
ASSERT_TRUE(handle_public != nullptr) << dlerror();
android_set_application_target_sdk_version(42U); // something > 23
ASSERT_TRUE(android_init_namespaces(path.c_str(), nullptr)) << dlerror();
// preload this library to the default namespace to check if it
// is shared later on.
void* handle_dlopened =
dlopen((lib_path + "/private_namespace_libs/libnstest_dlopened.so").c_str(), RTLD_NOW);
ASSERT_TRUE(handle_dlopened != nullptr) << dlerror();
android_namespace_t* ns_not_isolated =
android_create_namespace("private", nullptr,
(lib_path + "/private_namespace_libs").c_str(),
ANDROID_NAMESPACE_TYPE_REGULAR, nullptr);
ASSERT_TRUE(ns_not_isolated != nullptr) << dlerror();
android_namespace_t* ns_isolated_shared =
android_create_namespace("private_isolated_shared", nullptr,
(lib_path + "/private_namespace_libs").c_str(),
ANDROID_NAMESPACE_TYPE_ISOLATED | ANDROID_NAMESPACE_TYPE_SHARED,
nullptr);
ASSERT_TRUE(ns_isolated_shared != nullptr) << dlerror();
ASSERT_TRUE(dlopen(root_lib, RTLD_NOW) == nullptr);
ASSERT_STREQ("dlopen failed: library \"libnstest_root_not_isolated.so\" not found", dlerror());
std::string lib_private_external_path =
lib_path + "/private_namespace_libs_external/libnstest_private_external.so";
// Load lib_private_external_path to default namespace
// (it should remain invisible for the isolated namespaces after this)
void* handle = dlopen(lib_private_external_path.c_str(), RTLD_NOW);
ASSERT_TRUE(handle != nullptr) << dlerror();
android_dlextinfo extinfo;
extinfo.flags = ANDROID_DLEXT_USE_NAMESPACE;
extinfo.library_namespace = ns_not_isolated;
void* handle1 = android_dlopen_ext(root_lib, RTLD_NOW, &extinfo);
ASSERT_TRUE(handle1 != nullptr) << dlerror();
extinfo.library_namespace = ns_isolated_shared;
void* handle2 = android_dlopen_ext(root_lib, RTLD_NOW, &extinfo);
ASSERT_TRUE(handle2 == nullptr);
ASSERT_STREQ("dlopen failed: library \"libnstest_private_external.so\" not found", dlerror());
// Check dlopen by absolute path
handle2 = android_dlopen_ext(lib_private_external_path.c_str(), RTLD_NOW, &extinfo);
ASSERT_TRUE(handle2 == nullptr);
ASSERT_EQ("dlopen failed: library \"" + lib_private_external_path + "\" is not accessible for the namespace \"private_isolated_shared\"", dlerror());
// load libnstest_root.so to shared namespace in order to check that everything is different
// except shared libnstest_dlopened.so
handle2 = android_dlopen_ext(root_lib_isolated, RTLD_NOW, &extinfo);
typedef const char* (*fn_t)();
fn_t ns_get_local_string = reinterpret_cast<fn_t>(dlsym(handle1, "ns_get_local_string"));
ASSERT_TRUE(ns_get_local_string != nullptr) << dlerror();
fn_t ns_get_local_string_shared = reinterpret_cast<fn_t>(dlsym(handle2, "ns_get_local_string"));
ASSERT_TRUE(ns_get_local_string_shared != nullptr) << dlerror();
ASSERT_STREQ("This string is local to root library", ns_get_local_string());
ASSERT_STREQ("This string is local to root library", ns_get_local_string_shared());
ASSERT_TRUE(ns_get_local_string() != ns_get_local_string_shared());
fn_t ns_get_private_extern_string =
reinterpret_cast<fn_t>(dlsym(handle1, "ns_get_private_extern_string"));
ASSERT_TRUE(ns_get_private_extern_string != nullptr) << dlerror();
fn_t ns_get_private_extern_string_shared =
reinterpret_cast<fn_t>(dlsym(handle2, "ns_get_private_extern_string"));
ASSERT_TRUE(ns_get_private_extern_string_shared() != nullptr) << dlerror();
ASSERT_STREQ("This string is from private namespace", ns_get_private_extern_string());
ASSERT_STREQ("This string is from private namespace", ns_get_private_extern_string_shared());
ASSERT_TRUE(ns_get_private_extern_string() != ns_get_private_extern_string_shared());
fn_t ns_get_public_extern_string =
reinterpret_cast<fn_t>(dlsym(handle1, "ns_get_public_extern_string"));
ASSERT_TRUE(ns_get_public_extern_string != nullptr) << dlerror();
fn_t ns_get_public_extern_string_shared =
reinterpret_cast<fn_t>(dlsym(handle2, "ns_get_public_extern_string"));
ASSERT_TRUE(ns_get_public_extern_string_shared != nullptr) << dlerror();
ASSERT_STREQ("This string is from public namespace", ns_get_public_extern_string());
ASSERT_STREQ("This string is from public namespace", ns_get_public_extern_string_shared());
ASSERT_TRUE(ns_get_public_extern_string() == ns_get_public_extern_string_shared());
fn_t ns_get_dlopened_string = reinterpret_cast<fn_t>(dlsym(handle1, "ns_get_dlopened_string"));
ASSERT_TRUE(ns_get_dlopened_string != nullptr) << dlerror();
fn_t ns_get_dlopened_string_shared = reinterpret_cast<fn_t>(dlsym(handle2, "ns_get_dlopened_string"));
ASSERT_TRUE(ns_get_dlopened_string_shared != nullptr) << dlerror();
const char** ns_dlopened_string = static_cast<const char**>(dlsym(handle_dlopened, "g_private_dlopened_string"));
ASSERT_TRUE(ns_dlopened_string != nullptr) << dlerror();
ASSERT_STREQ("This string is from private namespace (dlopened library)", ns_get_dlopened_string());
ASSERT_STREQ("This string is from private namespace (dlopened library)", *ns_dlopened_string);
ASSERT_STREQ("This string is from private namespace (dlopened library)", ns_get_dlopened_string_shared());
ASSERT_TRUE(ns_get_dlopened_string() != ns_get_dlopened_string_shared());
ASSERT_TRUE(*ns_dlopened_string == ns_get_dlopened_string_shared());
dlclose(handle1);
dlclose(handle2);
}
TEST(dlext, ns_anonymous) {
static const char* root_lib = "libnstest_root.so";
std::string path = std::string("libc.so:libc++.so:libdl.so:libm.so:") + g_public_lib;
@ -825,7 +958,7 @@ TEST(dlext, ns_anonymous) {
android_namespace_t* ns = android_create_namespace(
"private", nullptr,
(lib_path + "/private_namespace_libs").c_str(),
false, nullptr);
ANDROID_NAMESPACE_TYPE_REGULAR, nullptr);
ASSERT_TRUE(ns != nullptr) << dlerror();

View File

@ -624,8 +624,10 @@ TEST(dlfcn, dlopen_check_loop) {
handle = dlopen("libtest_with_dependency_loop.so", RTLD_NOW | RTLD_NOLOAD);
ASSERT_TRUE(handle == nullptr);
#ifdef __BIONIC__
// TODO: glibc returns nullptr on dlerror() here. Is it bug?
ASSERT_STREQ("dlopen failed: library \"libtest_with_dependency_loop.so\" wasn't loaded and RTLD_NOLOAD prevented it", dlerror());
#else
// TODO: glibc returns nullptr on dlerror() here. Is it bug?
ASSERT_TRUE(dlerror() == nullptr);
#endif
handle = dlopen("libtest_with_dependency_a.so", RTLD_NOW | RTLD_NOLOAD);
@ -763,14 +765,6 @@ TEST(dlfcn, dlsym_failures) {
ASSERT_STREQ("dlsym failed: library handle is null", dlerror());
#endif
// NULL symbol name.
#if defined(__BIONIC__)
// glibc marks this parameter non-null and SEGVs if you cheat.
sym = dlsym(self, nullptr);
ASSERT_TRUE(sym == nullptr);
ASSERT_STREQ("dlsym failed: symbol name is null", dlerror());
#endif
// Symbol that doesn't exist.
sym = dlsym(self, "ThisSymbolDoesNotExist");
ASSERT_TRUE(sym == nullptr);
@ -1054,6 +1048,26 @@ TEST(dlfcn, symbol_versioning_default_via_dlsym) {
dlclose(handle);
}
TEST(dlfcn, dlvsym_smoke) {
void* handle = dlopen("libtest_versioned_lib.so", RTLD_NOW);
ASSERT_TRUE(handle != nullptr) << dlerror();
typedef int (*fn_t)();
{
fn_t fn = reinterpret_cast<fn_t>(dlvsym(handle, "versioned_function", "nonversion"));
ASSERT_TRUE(fn == nullptr);
ASSERT_SUBSTR("undefined symbol: versioned_function, version nonversion", dlerror());
}
{
fn_t fn = reinterpret_cast<fn_t>(dlvsym(handle, "versioned_function", "TESTLIB_V2"));
ASSERT_TRUE(fn != nullptr) << dlerror();
ASSERT_EQ(2, fn());
}
dlclose(handle);
}
// This preempts the implementation from libtest_versioned_lib.so
extern "C" int version_zero_function() {
return 0;

38
tests/ifaddrs_test.cpp Normal file
View File

@ -0,0 +1,38 @@
/*
* Copyright (C) 2015 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <gtest/gtest.h>
#include <ifaddrs.h>
TEST(ifaddrs, freeifaddrs_null) {
freeifaddrs(nullptr);
}
TEST(ifaddrs, getifaddrs_smoke) {
ifaddrs* addrs = nullptr;
ASSERT_EQ(0, getifaddrs(&addrs));
ASSERT_TRUE(addrs != nullptr);
bool saw_loopback = false;
for (ifaddrs* addr = addrs; addr != nullptr; addr = addr->ifa_next) {
if (addr->ifa_name && strcmp(addr->ifa_name, "lo") == 0) saw_loopback = true;
}
ASSERT_TRUE(saw_loopback);
freeifaddrs(addrs);
}

View File

@ -372,3 +372,22 @@ TEST(malloc, malloc_info) {
}
#endif
}
TEST(malloc, calloc_usable_size) {
for (size_t size = 1; size <= 2048; size++) {
void* pointer = malloc(size);
ASSERT_TRUE(pointer != nullptr);
memset(pointer, 0xeb, malloc_usable_size(pointer));
free(pointer);
// We should get a previous pointer that has been set to non-zero.
// If calloc does not zero out all of the data, this will fail.
uint8_t* zero_mem = reinterpret_cast<uint8_t*>(calloc(1, size));
ASSERT_TRUE(pointer != nullptr);
size_t usable_size = malloc_usable_size(zero_mem);
for (size_t i = 0; i < usable_size; i++) {
ASSERT_EQ(0, zero_mem[i]) << "Failed at allocation size " << size << " at byte " << i;
}
free(zero_mem);
}
}

View File

@ -1536,6 +1536,9 @@ TEST(pthread, pthread_mutex_lock_NORMAL) {
ASSERT_EQ(0, pthread_mutex_lock(&m.lock));
ASSERT_EQ(0, pthread_mutex_unlock(&m.lock));
ASSERT_EQ(0, pthread_mutex_trylock(&m.lock));
ASSERT_EQ(EBUSY, pthread_mutex_trylock(&m.lock));
ASSERT_EQ(0, pthread_mutex_unlock(&m.lock));
}
TEST(pthread, pthread_mutex_lock_ERRORCHECK) {
@ -1558,6 +1561,8 @@ TEST(pthread, pthread_mutex_lock_RECURSIVE) {
ASSERT_EQ(0, pthread_mutex_unlock(&m.lock));
ASSERT_EQ(0, pthread_mutex_unlock(&m.lock));
ASSERT_EQ(0, pthread_mutex_trylock(&m.lock));
ASSERT_EQ(0, pthread_mutex_trylock(&m.lock));
ASSERT_EQ(0, pthread_mutex_unlock(&m.lock));
ASSERT_EQ(0, pthread_mutex_unlock(&m.lock));
ASSERT_EQ(EPERM, pthread_mutex_unlock(&m.lock));
}

View File

@ -131,6 +131,13 @@ TEST(semaphore, sem_timedwait) {
ASSERT_EQ(0, sem_destroy(&s));
}
TEST(semaphore_DeathTest, sem_timedwait_null_timeout) {
sem_t s;
ASSERT_EQ(0, sem_init(&s, 0, 0));
ASSERT_EXIT(sem_timedwait(&s, nullptr), testing::KilledBySignal(SIGSEGV), "");
}
TEST(semaphore, sem_getvalue) {
sem_t s;
ASSERT_EQ(0, sem_init(&s, 0, 0));