Compare commits

..

1573 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
Dimitry Ivanov
881673cb45 Merge changes Iaee1b711,Ia3dd0761
* changes:
  Generate libc version-script for brillo
  Revert "Don't verify version scripts on 32-bit Brillo"
2015-12-14 22:53:06 +00:00
Dimitry Ivanov
585e959849 Generate libc version-script for brillo
Brillo doesn't use the ndk cruft, so we need
separate set of version scripts. Added new "nobrillo"
tag to mark such symbols in *.map.txt files.

Bug: http://b/26164862
Change-Id: Iaee1b7119f75b68c2971679fc32817e6df29fd94
2015-12-14 14:23:06 -08:00
Dimitry Ivanov
a3dd076126 Revert "Don't verify version scripts on 32-bit Brillo"
This reverts commit 31951b7f0dc7ce577a21682e54362b0cf2913e11.

Bug: http://b/26164862
2015-12-14 14:19:53 -08:00
Elliott Hughes
162a8524ea Merge "Fix personality test for mips32r6" 2015-12-14 15:59:29 +00:00
Lazar Trsic
61cf963efe Fix personality test for mips32r6
When personality syscall is executed on mips64, for a 32bit process,
sys_32_personality() is called, which converts PER_LINUX32 -> PER_LINUX.
Change expected value when mips32 is a second architecture.

For more information see:
https://www.linux-mips.org/archives/linux-mips/2015-08/msg00421.html
https://www.linux-mips.org/archives/linux-mips/2015-11/msg00093.html

Change-Id: I8c9062f536ad6e513f0ac585da3568d80e5fa1b4
2015-12-14 12:29:53 +01:00
Dan Willemsen
a7ff3964ab Merge "Don't verify version scripts on 32-bit Brillo" 2015-12-12 02:29:29 +00:00
Dan Willemsen
31951b7f0d Don't verify version scripts on 32-bit Brillo
Brillo doesn't use the ndk cruft, so the same version scripts do not
apply. Until we have brillo-specific version scripts, just disable the
version script check.

Bug: 26164862
Change-Id: I682860ec1c5b36014c7a6cf24da43df553e9dc9f
2015-12-11 16:52:08 -08:00
Dimitry Ivanov
52e2db647c Merge "Remove __bionic_libgcc_unwind_symbols from version script" 2015-12-11 19:41:33 +00:00
Dimitry Ivanov
2f019872dc Remove __bionic_libgcc_unwind_symbols from version script
Bug: http://b/26004476
Change-Id: Iaa468de4cbcc94e88badc5cde0f4421c710c1f38
2015-12-11 11:30:48 -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
Dimitry Ivanov
0bc3977537 Merge "Move dlsym and dladdr implementation to linker.cpp" 2015-12-11 01:26:17 +00:00
Dimitry Ivanov
4a2c5aa30c Move dlsym and dladdr implementation to linker.cpp
Bug: http://b/25716705
Bug: http://b/22865643
Change-Id: If22fc1eda219f676b5fcc06490f7901d21d1749c
2015-12-10 16:24:57 -08:00
Tom Cherry
e46ded5ce1 Merge "Do not set properties in bionic_systrace" 2015-12-10 23:05:15 +00:00
Tom Cherry
46e2eadad2 Do not set properties in bionic_systrace
Currently, if the debug.atrace.tags.enableflags property is not found,
it is set to a safe value such that a pointer to this property can be
stored for later access.  This may result in selinux denials because not
all processes write permissions for this property or permission to
connect to the property write socket at all.

Change I6d953c0c281fd72ad3eba8a479fd258023579b5b writes this property to
a safe value upon boot, which greatly decreases the cases in which this
property will not be accessible and removes the need to write it here.
This commit removes this write.

Bug 26115803

Change-Id: Ief72c5f731d3a1231b5080eb531fa0a491a8b1d1
2015-12-10 13:33:37 -08:00
Dimitry Ivanov
cb025e55f7 Merge "Revert "Add /odm/lib to shared lib search path"" 2015-12-10 20:17:02 +00:00
Dimitry Ivanov
9d8632e1a7 Merge "constexpr constructor for atfork_list_t" 2015-12-10 17:39:48 +00:00
Dimitry Ivanov
39801757c3 Merge "Add permitted_when_isolated_path to linker namespaces" 2015-12-10 04:34:38 +00:00
Elliott Hughes
6500f51c0e Merge "Fix -fstack-protector-strong for x86." 2015-12-10 02:33:34 +00:00
Dimitry Ivanov
284ae3559e Add permitted_when_isolated_path to linker namespaces
The permitted_when_isolated_path is a way to white-list
directories not present in search-path. It is ignored for
not isolated namespaces.

Bug: http://b/25853516
Bug: http://b/22548808
Change-Id: Ib1538037268eea69323ea49968a34a4a1d1938a5
2015-12-09 13:54:01 -08:00
Dimitry Ivanov
5a3ab3422d Merge "Revert "Ensure that readlink has access to /proc/self/fd"" 2015-12-09 21:50:54 +00:00
Dimitry Ivanov
db43526581 Revert "Ensure that readlink has access to /proc/self/fd"
This reverts commit 4e50d0247b9ace095e371865fad08b1a59672e3a.

Bug: http://b/24912743
Change-Id: I5d32c670f0e16aec9c74add143158e919a301673
2015-12-09 19:36:47 +00:00
Dimitry Ivanov
40728bccbc Revert "Add /odm/lib to shared lib search path"
This reverts commit f74b041cce75091b922151d4fa57e63c8a6caf4b.

Bug: 25654402
Change-Id: I77386ea3655868d7cd1a8130afbc95e70549389e
2015-12-09 19:35:02 +00:00
Dan Willemsen
df196131f3 Merge "libm: Use LOCAL_SRC_FILES_EXCLUDE_{arch}" 2015-12-08 23:41:24 +00:00
Todd Kjos
5736959094 Merge "bionic: Build Breakage" 2015-12-08 21:46:17 +00:00
Mark Salyzyn
9da687e2f4 bionic: Build Breakage
Bug: 23668800
Change-Id: Ic7cf5864d3f5881e6f7105a49ecf62b1bc4a604c
2015-12-08 13:42:41 -08:00
Elliott Hughes
6c54ddd20f Fix -fstack-protector-strong for x86.
We need to ensure %gs:20 is set up early enough for -fstack-protector-strong
on x86, and that __set_tls doesn't get stack protector checks because it's a
prerequisite for them. x86 devices/emulators won't boot without this.

Bug: http://b/26073874
Change-Id: Icf0d34294648cc0c8cb406a3617befe0d45c525a
2015-12-08 12:48:42 -08:00
Dimitry Ivanov
89a50fe1eb constexpr constructor for atfork_list_t
Bug: http://b/26026986
Change-Id: Iad95383a23f81eea776bebce641c555d26547b77
2015-12-08 11:40:51 -08:00
Mark Salyzyn
eaccfde075 Merge "Add monotonic logging for bionic" 2015-12-08 18:59:05 +00:00
Elliott Hughes
cf0c1af1dd Merge "Base bcopy on memmove rather than memcpy."
am: f0a451dcd1

* commit 'f0a451dcd10241c8f2ead2448ed922eb80f387f6':
  Base bcopy on memmove rather than memcpy.
2015-12-07 23:20:58 +00:00
Elliott Hughes
36545d2e76 Merge "Make all of ndk_cruft.cpp one big extern "C"."
am: 9dec0a775b

* commit '9dec0a775b07f58d133ae5c35713e7cf60ddcc7c':
  Make all of ndk_cruft.cpp one big extern "C".
2015-12-07 23:16:43 +00:00
Elliott Hughes
1190230f33 Merge "Fix stdio static initializers to make both clang and GCC happy."
am: 7bd33cdf15

* commit '7bd33cdf15c26c5855628eb2ac0e7d0f52189010':
  Fix stdio static initializers to make both clang and GCC happy.
2015-12-07 23:16:39 +00:00
Elliott Hughes
568ad51d80 Merge "Revert "Revert "Remove __sinit and __sdidinit."""
am: c4eef1fb5b

* commit 'c4eef1fb5ba325317e94b598c6fbf8e4c4bf83e1':
  Revert "Revert "Remove __sinit and __sdidinit.""
2015-12-07 23:14:29 +00:00
Elliott Hughes
f0a451dcd1 Merge "Base bcopy on memmove rather than memcpy." 2015-12-07 22:07:11 +00:00
Rohit Agrawal
d51a0b0f9d Base bcopy on memmove rather than memcpy.
POSIX defined bcopy to handle overlapping memory akin to memmove and
bionic appears to have always done so.

Change-Id: I2599113411e3532913270ba1c1b49e35cbc5f106
2015-12-07 13:06:14 -08:00
Elliott Hughes
9dec0a775b Merge "Make all of ndk_cruft.cpp one big extern "C"." 2015-12-07 19:14:46 +00:00
Elliott Hughes
cfd5a46b09 Make all of ndk_cruft.cpp one big extern "C".
Change-Id: Iddd9b5f36e661e443fa13d12326e72df8c0d209c
2015-12-07 11:13:23 -08:00
Elliott Hughes
7bd33cdf15 Merge "Fix stdio static initializers to make both clang and GCC happy." 2015-12-07 19:10:32 +00:00
Elliott Hughes
29ee6397a8 Fix stdio static initializers to make both clang and GCC happy.
Previously only clang was happy. GCC said:

  error: missing initializer for field 'wcio_mbstate_in' of 'struct wchar_io_data'

Change-Id: I25a11b64f4dfa22a5dd5daded152191fe2cfacaf
2015-12-07 11:07:15 -08:00
Elliott Hughes
c4eef1fb5b Merge "Revert "Revert "Remove __sinit and __sdidinit.""" 2015-12-07 18:19:07 +00:00
Elliott Hughes
bb46afd6c4 Revert "Revert "Remove __sinit and __sdidinit.""
This reverts commit c8bae05f3ff9f1c736f7be70fa17d02795d748bb.

We were breaking init (ueventd) because we initialize system properties
before we initialize stdio. The new system property implementation uses
stdio to read from /property_contexts, so we end up touching stdio data
structures before they've been initialized.

This second attempt takes things further by removing the stdio initialization
function altogether. The data structures for stdin/stdout/stderr can be
statically initialized as data, and -- since we already had to give the
atexit implementation a backdoor for stdio -- we can just admit that we
need to clean up stdio, and that we always do so last.

This patch also removes the 17 statically pre-allocated file structures,
so the first fopen will now allocate a block of 10 (the usual overflow
behavior). I did this just to make my life simpler, but it's not actually
necessary to remove it if we want it back.

Change-Id: I936b2eb5e88e4ebaf5516121872b71fc88e5609c
2015-12-05 07:30:59 -08:00
Dimitry Ivanov
d5ce2a93af Merge "Allow dlopening public libs using absolute path"
am: e371ae68ac

* commit 'e371ae68ac0d6d39cacf5edc893bda2f4a61e883':
  Allow dlopening public libs using absolute path
2015-12-05 05:29:52 +00:00
Dimitry Ivanov
e371ae68ac Merge "Allow dlopening public libs using absolute path" 2015-12-05 05:25:57 +00:00
Dimitry Ivanov
22840aab47 Allow dlopening public libs using absolute path
dlopen on isolated namespaces should be able to open
public libraries using absolute path not only soname.

Bug: http://b/25853820
Change-Id: If574a67853dc51226f0f376e9e2d108316002f84
2015-12-04 21:21:35 -08:00
Elliott Hughes
f4e511ecf9 Merge "Revert "Remove __sinit and __sdidinit.""
am: 0d89913e74

* commit '0d89913e74981cd51532e66a2e2f138392be4de1':
  Revert "Remove __sinit and __sdidinit."
2015-12-05 01:58:40 +00:00
Elliott Hughes
0d89913e74 Merge "Revert "Remove __sinit and __sdidinit."" 2015-12-05 01:53:21 +00:00
Elliott Hughes
c8bae05f3f Revert "Remove __sinit and __sdidinit."
This reverts commit 4371961e00ad83fca033992c8a19c7d262fe6f84.

This broke booting; ueventd crashes with a null pointer dereference
somewhere in __sfp (but the kernel doesn't unwind, so I don't know
what was calling __sfp).

Change-Id: I65375fdfdf1d339a06558b4057b580cacd6324e2
2015-12-04 17:47:20 -08:00
Tom Cherry
071234cfd9 Merge "Do not create prop files for ctl.* properties"
am: 4ade5195f1

* commit '4ade5195f188b84ce3599c71ef058d040b141da4':
  Do not create prop files for ctl.* properties
2015-12-05 00:27:56 +00:00
Tom Cherry
4ade5195f1 Merge "Do not create prop files for ctl.* properties" 2015-12-05 00:21:46 +00:00
Elliott Hughes
70d477c913 Merge "Fix GCC build."
am: ef2ba3dbf9

* commit 'ef2ba3dbf986257ded12531fe15bf0d1d4a87d50':
  Fix GCC build.
2015-12-04 16:02:27 -08:00
Tom Cherry
21eadee6e9 Do not create prop files for ctl.* properties
Change-Id: Ia6660c68c9e0cb89938751dbc0747ee038394778
2015-12-04 15:55:32 -08:00
Elliott Hughes
ef2ba3dbf9 Merge "Fix GCC build." 2015-12-04 23:54:15 +00:00
Elliott Hughes
8766edc098 Fix GCC build.
error: '__sdidinit' initialized and declared 'extern' [-Werror]

Change-Id: I97d9c174da6a99ca61b72572dfb4694813372a60
2015-12-04 15:53:25 -08:00
Elliott Hughes
a3f5912129 Merge "Track rename from base/ to android-base/."
am: 0b40c13a5a

* commit '0b40c13a5a2da127cb1203d33a3d170671b39247':
  Track rename from base/ to android-base/.
2015-12-04 23:33:45 +00:00
Elliott Hughes
942d81c246 Merge "Remove __sinit and __sdidinit."
am: 2558b11230

* commit '2558b112300e0a27590b9e31f627fe94594fa6a0':
  Remove __sinit and __sdidinit.
2015-12-04 23:33:39 +00:00
Elliott Hughes
0b40c13a5a Merge "Track rename from base/ to android-base/." 2015-12-04 23:30:09 +00:00
Elliott Hughes
939a7e0119 Track rename from base/ to android-base/.
Change-Id: I0a4592945400b1fa6892bf7c1fa8659fd711efa3
2015-12-04 15:27:46 -08:00
Elliott Hughes
2558b11230 Merge "Remove __sinit and __sdidinit." 2015-12-04 23:27:07 +00:00
Tom Cherry
e049fa71cb Merge "add checks for initialization for system properties"
am: 136bf8fa45

* commit '136bf8fa45b243b56a8f2543d43970f253118cd7':
  add checks for initialization for system properties
2015-12-04 15:09:42 -08:00
Tom Cherry
136bf8fa45 Merge "add checks for initialization for system properties" 2015-12-04 23:06:31 +00:00
Mark Salyzyn
870f165ceb Add monotonic logging for bionic
Primarily a debug feature that can be switched at runtime to permit
developer to have the option of high-resolution Android logs with
either CLOCK_REALTIME (default) or CLOCK_MONOTONIC to correlate with
other system activities like kernel logs or systrace.

Bug: 23668800
Change-Id: Ib29024899540f51a72cad5dde25517a7134d68f7
2015-12-04 14:45:25 -08:00
Tom Cherry
6ed51c0e85 add checks for initialization for system properties
If a __system_property* function is called before
__system_properties_init() then the app will will abort.  This commit
returns either an error code or a safe return value instead.

Bug 26027140

Change-Id: I95ffd143e9563658ab67a397991e84fb4c46ab77
2015-12-04 13:26:47 -08:00
Dan Willemsen
a29ed0bbce libm: Use LOCAL_SRC_FILES_EXCLUDE_{arch}
Instead of adding the used common files to each arch that doesn't
override a file, make the architectures list the files they override.

Also updates the Android.bp file to match the Android.mk file.

Change-Id: I7d6a9c2e1c6b6cc9430aa818a89a2ccf52f62c98
2015-12-03 18:09:36 -08:00
Yabin Cui
21cca02a52 Merge "Clear pthread_internal_t allocated on user provided stack."
am: 2452cf3c33

* commit '2452cf3c332fdfdae6b6b27b57acaa6786a91c87':
  Clear pthread_internal_t allocated on user provided stack.
2015-12-04 01:05:37 +00:00
Yabin Cui
2452cf3c33 Merge "Clear pthread_internal_t allocated on user provided stack." 2015-12-04 00:58:05 +00:00
Yabin Cui
304348af19 Clear pthread_internal_t allocated on user provided stack.
Several parts in pthread_internal_t should be initialized
to zero, like tls, key_data and thread_local_dtors. So
just clear the whole pthread_internal_t is more convenient.

Bug: 25990348
Change-Id: Ibb6d1200ea5e6e1afbc77971f179197e8239f6ea
2015-12-03 16:51:20 -08:00
Yabin Cui
fb3708640f Merge "Don\'t use StringPrintf() in gtest runner."
am: 514f46b74c

* commit '514f46b74c5424eb10f21349654e90fcf69b3b10':
  Don't use StringPrintf() in gtest runner.
2015-12-04 00:35:30 +00:00
Yabin Cui
514f46b74c Merge "Don't use StringPrintf() in gtest runner." 2015-12-04 00:29:47 +00:00
Yabin Cui
a32fc8685d Don't use StringPrintf() in gtest runner.
Change-Id: I0cd0b3cbb952c65b1c449e88ce12964b93029538
2015-12-03 16:28:03 -08:00
Tom Cherry
e670e2f859 Merge "Remove c++14\'isms from system_properties"
am: b35a2fb370

* commit 'b35a2fb370db711fcea38441a1295cd542fc3daa':
  Remove c++14'isms from system_properties
2015-12-03 23:53:24 +00:00
Dimitry Ivanov
0ee40ef239 Merge "libm: stop exporting __muldc3"
am: bf20d0226b

* commit 'bf20d0226b28a029f4cade8dc8f3aa38d1e51a1a':
  libm: stop exporting __muldc3
2015-12-03 23:53:13 +00:00
Tom Cherry
b35a2fb370 Merge "Remove c++14'isms from system_properties" 2015-12-03 23:48:54 +00:00
Dimitry Ivanov
bf20d0226b Merge "libm: stop exporting __muldc3" 2015-12-03 23:44:59 +00:00
Tom Cherry
845e24a05e Remove c++14'isms from system_properties
Change-Id: If78e7d2770e8f8321f0d1824c3c52f93820dd325
2015-12-03 15:40:23 -08:00
Dimitry Ivanov
a2ead18657 libm: stop exporting __muldc3
Bug: http://b/26004493
Change-Id: I991268d5e7b59bca646da25d0ad90a1cb4a9d4b9
2015-12-03 15:25:37 -08:00
Tom Cherry
84bc4f5cc7 Merge "Separate properties by selabel"
am: 376b94f1e7

* commit '376b94f1e777375eb9ebb04a882b898aafa94625':
  Separate properties by selabel
2015-12-03 22:58:48 +00:00
Tom Cherry
376b94f1e7 Merge "Separate properties by selabel" 2015-12-03 22:55:32 +00:00
Yabin Cui
b561043d3a Merge "Improve unit test runner."
am: f57ae1cd43

* commit 'f57ae1cd433f2bdc02cec6b0d2666f7708f1fc37':
  Improve unit test runner.
2015-12-03 22:34:44 +00:00
Yabin Cui
f57ae1cd43 Merge "Improve unit test runner." 2015-12-03 22:29:29 +00:00
Elliott Hughes
4371961e00 Remove __sinit and __sdidinit.
We're eagerly initializing stdio now, so this can all be simplified.

Change-Id: Icb288f8dd0ee08f02bea0d23670f75e78bed6b99
2015-12-03 13:23:03 -08:00
Yabin Cui
d4c9b9d5ac Improve unit test runner.
1. Read unit test's output while the test is running. Previously
we only read output when the test finishes, which has trouble
when the test outputs too many stuff.
2. Report failed unit test's exit code. It is useful when the
test doesn't fail in ASSERT_xxx, but in somewhere else.

Bug: 25392375
Change-Id: Ie90823337f7c2ee25fa489a5534801d991258f95
2015-12-03 13:20:39 -08:00
Dan Willemsen
5bfa22ceab Merge "Re-add putw for LP32"
am: 22dca83e1c

* commit '22dca83e1c37d3b465b9fa432bbf7cb4bd0df868':
  Re-add putw for LP32
2015-12-03 02:01:07 +00:00
Dan Willemsen
22dca83e1c Merge "Re-add putw for LP32" 2015-12-03 01:56:00 +00:00
Dan Willemsen
b9055518fc Re-add putw for LP32
This was missed when switching to LOCAL_SRC_FILES_EXCLUDE

Change-Id: I6ea23c9eb31abe11e0ec4abfc2ee2f2a43c76ce2
2015-12-02 17:31:32 -08:00
Tom Cherry
49a309ff6a Separate properties by selabel
The purpose of this change is to add read access control to the property
space.

In the current design, a process either has access to the single
/dev/__properties__ file and therefore all properties that it contains
or it has access to no properties.  This change separates properties
into multiple property files based on their selabel, which allows
creation of sepolicies that allow read access of only specific sets of
properties to specific domains.

Bug 21852512

Change-Id: Ice265db79201ca811c6b6cf6d851703f53224f03
2015-12-02 15:17:03 -08:00
Dimitry Ivanov
9f525b66eb Merge "Explicitly disallow default c-tor"
am: b24f7a0513

* commit 'b24f7a0513f7468ccf7563d7d347c6e7bab391d9':
  Explicitly disallow default c-tor
2015-12-02 18:47:27 +00:00
Dimitry Ivanov
b24f7a0513 Merge "Explicitly disallow default c-tor" 2015-12-02 18:44:20 +00:00
Dimitry Ivanov
a5e183c066 Explicitly disallow default c-tor
Change-Id: Ia52995a459443159e80383d5b396c3edd90a08ae
2015-12-01 16:57:19 -08:00
Chih-hung Hsieh
d74566026d Merge "Add bionic-unit-tests-gcc{32,64}, compiled with gcc."
am: 9cbabd8fe5

* commit '9cbabd8fe5ef3834682996ff23b4a5325e0586cb':
  Add bionic-unit-tests-gcc{32,64}, compiled with gcc.
2015-12-01 00:27:13 +00:00
Chih-hung Hsieh
9cbabd8fe5 Merge "Add bionic-unit-tests-gcc{32,64}, compiled with gcc." 2015-12-01 00:23:32 +00:00
Yabin Cui
1f4b0c44b3 Merge "Init stdio in __libc_init_common."
am: 6bef152af2

* commit '6bef152af2c622ee0c57f9c374b76f3dd352e52b':
  Init stdio in __libc_init_common.
2015-11-30 23:58:50 +00:00
Yabin Cui
4262d3e9ac Merge "Enable using clang to build __cxa_thread_atexit_impl."
am: af87c9ccfc

* commit 'af87c9ccfc3afbc7db9f0bc131d122453b5c882d':
  Enable using clang to build __cxa_thread_atexit_impl.
2015-11-30 23:58:41 +00:00
Yabin Cui
6bef152af2 Merge "Init stdio in __libc_init_common." 2015-11-30 23:57:02 +00:00
Yabin Cui
af87c9ccfc Merge "Enable using clang to build __cxa_thread_atexit_impl." 2015-11-30 23:56:41 +00:00
Yabin Cui
9b687dc243 Enable using clang to build __cxa_thread_atexit_impl.
Remove previous workaround as we no longer use
__thread in __cxa_thread_atexit_impl.cpp.

Change-Id: Ic1062995db488859b341acdda0b5f6635e10d7e8
2015-11-30 14:43:52 -08:00
Yabin Cui
51ca18d2a1 Merge "Don\'t use __thread in __cxa_thread_finalize()."
am: 28d3f00cf4

* commit '28d3f00cf4545812503c835ea906fa83309e48ed':
  Don't use __thread in __cxa_thread_finalize().
2015-11-30 22:01:36 +00:00
Yabin Cui
28d3f00cf4 Merge "Don't use __thread in __cxa_thread_finalize()." 2015-11-30 21:59:47 +00:00
Yabin Cui
d68c9e5906 Init stdio in __libc_init_common.
Previously we call __sinit() lazily. But it is likely to cause data
races like in https://android-review.googlesource.com/#/c/183237/. So
we prefer to call __sinit() explicitly at libc initialization.

Bug: 25392375

Change-Id: I181ea7a4b2e4c7350b45f2e6c86886ea023e80b8
2015-11-30 13:51:07 -08:00
Yabin Cui
6ac2fdd0f4 Merge "Fix pthread_test according to tsan report."
am: aec13988da

* commit 'aec13988dab7ff32cb005f42b952e3b9b55a4779':
  Fix pthread_test according to tsan report.
2015-11-30 21:42:42 +00:00
Yabin Cui
aec13988da Merge "Fix pthread_test according to tsan report." 2015-11-30 21:38:59 +00:00
Chih-hung Hsieh
4f94b7bfc0 Merge "Consider when building libc_thread_atexit_impl module"
am: 2bb85c848a

* commit '2bb85c848abb89951ec01342d6c8278311346395':
  Consider $(use_clang) when building libc_thread_atexit_impl module
2015-11-30 19:02:05 +00:00
Chih-hung Hsieh
2bb85c848a Merge "Consider $(use_clang) when building libc_thread_atexit_impl module" 2015-11-30 18:58:59 +00:00
Chih-Hung Hsieh
f688c5d5b4 Add bionic-unit-tests-gcc{32,64}, compiled with gcc.
* bionic-unit-tests{32,64} are compiled with clang/llvm.
* Skip one single test in __cxa_thread_atexit_test.cpp
  when compiled with aarch64 clang/llvm.
  Aarch64 clang/llvm generates relocation references to
  "thread_local" symbols not supported by Android linker.

BUG: 25642296
Change-Id: Ia0497b79c4b335228afeb48a26e0592217909953
2015-11-30 10:52:16 -08:00
Nikola Veljkovic
83f314f060 Consider $(use_clang) when building libc_thread_atexit_impl module
Change-Id: Ia369d94979f418198a2ee891385942d9bc5604d7
2015-11-25 18:09:34 +00:00
Yabin Cui
952e9eb086 Don't use __thread in __cxa_thread_finalize().
Currently we use __thread variable to store thread_local_dtors,
which makes tsan test fork_atexit.cc hang. The problem is as below:
The main thread creates a worker thread, the worker thread calls
pthread_exit() -> __cxa_thread_finalize() -> __emutls_get_address()
-> pthread_once(emutls_init) -> emutls_init().
Then the main thread calls fork(), the child process cals
exit() -> __cxa_thread_finalize() -> __emutls_get_address()
-> pthread_once(emutls_init).
So the child process is waiting for pthread_once(emutls_init)
to finish which will never occur.

It might be the test's fault because POSIX standard says if a
multi-threaded process calls fork(), the new process may only
execute async-signal-safe operations until exec functions are
called. And exit() is not async-signal-safe. But we can make
bionic more reliable by not using __thread in
__cxa_thread_finalize().

Bug: 25392375
Change-Id: Ife403dd7379dad8ddf1859c348c1c0adea07afb3
2015-11-24 17:24:06 -08:00
Colin Cross
a36d1e0d31 Merge "Remove cflags and ldflags from crt defaults"
am: a01108d9bf

* commit 'a01108d9bf415854b9d36334483133adff3d7405':
  Remove cflags and ldflags from crt defaults
2015-11-24 21:41:22 +00:00
Colin Cross
a01108d9bf Merge "Remove cflags and ldflags from crt defaults" 2015-11-24 21:33:54 +00:00
Colin Cross
912e27a4b2 Merge "move arch variant structs down a level"
am: 8bd27182c5

* commit '8bd27182c505cdc8031ab23fea5d1dccb6b7405a':
  move arch variant structs down a level
2015-11-24 20:24:24 +00:00
Colin Cross
8bd27182c5 Merge "move arch variant structs down a level" 2015-11-24 20:21:20 +00:00
Colin Cross
bff87d19f1 Remove cflags and ldflags from crt defaults
After ToolchainCflags were added to soong crt no longer needs to try to
recreate the bare minimum cflags for compiling for each architecture.
Also always use GCC to match crt.mk

Change-Id: I01a833ab70d989033c84f072e3660d060189688c
2015-11-24 11:11:02 -08:00
Dimitry Ivanov
321314f2e9 Merge "Introduce anonymous namespace"
am: db8caa740a

* commit 'db8caa740a409c2ce75f875df84857e6be69eb9f':
  Introduce anonymous namespace
2015-11-24 02:45:14 +00:00
Dimitry Ivanov
db8caa740a Merge "Introduce anonymous namespace" 2015-11-24 02:23:34 +00:00
Dmitriy Ivanov
1ffec1cc4d Introduce anonymous namespace
The anonymous namespace is introduced to
handle cases when linker can not find the
caller. This usually happens when caller
code was not loaded by dynamic linker;
for example mono-generated code.

Bug: http://b/25844435
Bug: http://b/22548808
Change-Id: I9e5b1d23c1c75bc78548d68e79216a6a943a33cf
2015-11-23 16:13:10 -08:00
Colin Cross
6ab8f89d1c move arch variant structs down a level
Use blueprint's new anonymous embedded struct feature to move the arch
variant properties down a level, replacing arch.cortex_a9.srcs with
arch.arm.cortex_a9.srcs, while still supporting top-level properties
like arch.arm.srcs.

Change-Id: Ib41c80e3549440d5efdfd293a15cffa3f51a0fe4
2015-11-23 14:14:57 -08:00
Yabin Cui
edcee4e401 Merge "Change _stdio_handles_locking into _caller_handles_locking."
am: 17554356cc

* commit '17554356cc865908e5cbd7814c8be7e47c9c4ec5':
  Change _stdio_handles_locking into _caller_handles_locking.
2015-11-23 19:02:08 +00:00
Yabin Cui
17554356cc Merge "Change _stdio_handles_locking into _caller_handles_locking." 2015-11-23 18:57:26 +00:00
Dimitry Ivanov
a8f8cbb3fc Merge "Handling invalid section headers"
am: a7fc7f9909

* commit 'a7fc7f9909c221a0f64c5c5ecc5fadd5fba467c5':
  Handling invalid section headers
2015-11-23 07:33:23 +00:00
Dimitry Ivanov
a7fc7f9909 Merge "Handling invalid section headers" 2015-11-23 07:28:32 +00:00
Dmitriy Ivanov
3c5248182e Handling invalid section headers
The linker crashes if native library has invalid section
headers. This change adds boundary checks on target offsets
and generates dlerror instead of crash.

Bug: http://b/25800330
Change-Id: Ibe282029997302b9b557637c3aad064d7d0febc5
2015-11-22 23:25:06 -08:00
Yabin Cui
4469973bfb Merge "Use FUTEX_WAIT_BITSET to avoid converting timeouts."
am: 74ed96d597

* commit '74ed96d59731aa3661494330804d866e825209d3':
  Use FUTEX_WAIT_BITSET to avoid converting timeouts.
2015-11-21 01:55:27 +00:00
Yabin Cui
74ed96d597 Merge "Use FUTEX_WAIT_BITSET to avoid converting timeouts." 2015-11-21 01:50:29 +00:00
Yabin Cui
76144aaa63 Change _stdio_handles_locking into _caller_handles_locking.
It is reported by tsan that funlockfile() can unlock an unlocked mutex.
It happens when printf() is called before fopen() or other stdio stuff.
As FLOCKFILE(fp) is called before __sinit(), _stdio_handles_locking is false,
and _FLOCK(fp) will not be locked. But then cantwrite(fp) in __vfprintf()
calls__sinit(), which makes _stdio_handles_locking become true, and
FUNLOCKFILE(fp) unlocks _FLOCK(fp).

Change _stdio_handles_locking into _caller_handles_locking,
so __sinit() won't change its value. Add test due to my previous fault.

Bug: 25392375
Change-Id: I483e3c3cdb28da65e62f1fd9615bf58c5403b4dd
2015-11-20 17:44:26 -08:00
Dimitry Ivanov
8bd9e9ec69 Merge "Move some utility functions to linker_utils"
am: fb3219fbd1

* commit 'fb3219fbd1dbb0a369d52cbd0200330fd8852bc1':
  Move some utility functions to linker_utils
2015-11-20 21:45:36 +00:00
Dimitry Ivanov
fb3219fbd1 Merge "Move some utility functions to linker_utils" 2015-11-20 21:42:18 +00:00
Dmitriy Ivanov
84bab5a955 Move some utility functions to linker_utils
Also adds unit-tests for page_start, page_offset, and safe_add

Change-Id: Ia1325b4682d367328a01599a19848e4ffcd2c0ea
2015-11-20 21:37:51 +00:00
Dimitry Ivanov
d34c33764e Merge "Improve error message for files with no sections"
am: a1ab0d8ed1

* commit 'a1ab0d8ed1c4025233b0d816164eefb1b84159b9':
  Improve error message for files with no sections
2015-11-20 19:19:40 +00:00
Dimitry Ivanov
a1ab0d8ed1 Merge "Improve error message for files with no sections" 2015-11-20 19:16:14 +00:00
Chih-hung Hsieh
bb06a84672 Merge "Disable clang for mips/mips64 libc."
am: 8d5fb0d787

* commit '8d5fb0d78716379d07eddbd75c88c9b7082436ef':
  Disable clang for mips/mips64 libc.
2015-11-20 18:57:17 +00:00
Dmitriy Ivanov
b76123fed8 Improve error message for files with no sections
Bug: http://b/25801618
Change-Id: I4f4f368e727ff48c84781279e3d17d4ac2d1b6b0
2015-11-20 10:49:12 -08:00
Chih-hung Hsieh
8d5fb0d787 Merge "Disable clang for mips/mips64 libc." 2015-11-20 18:27:14 +00:00
Chih-Hung Hsieh
b4bc156c6c Disable clang for mips/mips64 libc.
* Many processes, including adbd, failed to start in mips/mips64
  emulator when libc.so was compiled by clang.

BUG: 25291096
Change-Id: If3434ebdca4a3a6bf6102b120ee838a7ab66cd74
2015-11-20 09:55:35 -08:00
Elliott Hughes
cb3af215dc Merge "mmap: fix calculation of is_private_anonymous variable"
am: 43c9045017

* commit '43c90450174ab8839c05702ac01c4092f5b6cd19':
  mmap: fix calculation of is_private_anonymous variable
2015-11-20 17:34:03 +00:00
Elliott Hughes
43c9045017 Merge "mmap: fix calculation of is_private_anonymous variable" 2015-11-20 17:19:19 +00:00
Vitaly Vul
ee67dd75e2 mmap: fix calculation of is_private_anonymous variable
Currently is_private_anonymous is calculated as true if _either_
MAP_PRIVATE or MAP_ANONYMOUS is set, which is a mistake.
According to Documentation/vm/ksm.txt, "KSM only merges anonymous
(private) pages, never pagecache (file) pages". MAP_PRIVATE can
still be set on file cache pages so in order to not redundantly
set MADV_MERGEABLE on pages that are not fitted for it, both
MAP_PRIVATE and MAP_ANONYMOUS should be set.

Along with this fix, add an extra check that the mapped page is
not a stack page before setting MADV_MERGEABLE for it. Stack pages
change too quickly and always end up in KSM 'page_volatile' list.

Change-Id: If4954142852f17cc61f02985ea1cb625a7f3dec6
2015-11-20 09:16:59 -08:00
Josh Gao
8af9a739c9 Merge changes I73a39c6d,Iab2af242
am: f30170dfa5

* commit 'f30170dfa514266a0bf007091aa54a866920208c':
  Fix test build break.
  extend the PTRDIFF_MAX size check to mremap
2015-11-20 02:00:16 +00:00
Josh Gao
f30170dfa5 Merge changes I73a39c6d,Iab2af242
* changes:
  Fix test build break.
  extend the PTRDIFF_MAX size check to mremap
2015-11-20 01:55:56 +00:00
Yabin Cui
b690cae8dd Merge "Fix tsan abort for lake of __libc_auxv initialization."
am: 79f8d64632

* commit '79f8d64632a57ccd62315286b809819de09e0317':
  Fix tsan abort for lake of __libc_auxv initialization.
2015-11-20 00:48:40 +00:00
Yabin Cui
79f8d64632 Merge "Fix tsan abort for lake of __libc_auxv initialization." 2015-11-20 00:40:00 +00:00
Colin Cross
75ba57de43 Merge "Update libc/Android.bp to match libc/Android.mk"
am: 9c6157c81d

* commit '9c6157c81d123d8c6ba1aa8d7ee5c67b0840666c':
  Update libc/Android.bp to match libc/Android.mk
2015-11-19 22:58:20 +00:00
Colin Cross
9c6157c81d Merge "Update libc/Android.bp to match libc/Android.mk" 2015-11-19 22:48:33 +00:00
Yabin Cui
284068f44f Fix tsan abort for lake of __libc_auxv initialization.
If tsan is used, the following callchain can happen:
__libc_preinit() -> __libc_init_globals() ->
__libc_init_vdso() -> strcmp() -> __tsan_init()
-> sysconf(_SC_PAGE_SIZE) -> getauxval().
But __libc_auxv is initialized in __libc_init_common(),
after __libc_init_globals(). One simple way to fix
this is to initialize __libc_auxv at __libc_init_globals().

Bug: 25392375
Change-Id: I3893b1f567d5f3b7a8c881c0c1b8234b06b7751b
2015-11-19 14:24:06 -08:00
Colin Cross
a35d23d251 Update libc/Android.bp to match libc/Android.mk
Change-Id: I4dfadc55688213f095949c56306e5071b2ab6135
2015-11-19 14:18:06 -08:00
Josh Gao
2feb9dde60 Fix test build break.
Change-Id: I73a39c6d4bb9baebbfb5572e9259bcd405116039
2015-11-19 13:44:20 -08:00
Yabin Cui
c9a659c57b Use FUTEX_WAIT_BITSET to avoid converting timeouts.
Add unittests for pthread APIs with timeout parameter.

Bug: 17569991

Change-Id: I6b3b9b2feae03680654cd64c3112ce7644632c87
2015-11-19 13:42:03 -08:00
Hung-ying Tyan
ce77e47b2f Merge "Add /odm/lib to shared lib search path"
am: 0ebe2f07c3

* commit '0ebe2f07c35d4b764bc5d8b5226004e3db46da91':
  Add /odm/lib to shared lib search path
2015-11-19 16:45:08 +00:00
Hung-ying Tyan
0ebe2f07c3 Merge "Add /odm/lib to shared lib search path" 2015-11-19 16:38:51 +00:00
Daniel Micay
c22a7de798 extend the PTRDIFF_MAX size check to mremap
This removes another way to obtain objects larger than PTRDIFF_MAX. The
only known remaining hole is now jemalloc's merging of virtual memory
spans.

Technically this could be wrapped in an __LP64__ ifndef since it can't
occur on 64-bit due to the 1:1 split. It doesn't really matter either
way.

Change-Id: Iab2af242b775bc98a59421994d87aca0433215bd
2015-11-19 08:57:47 -05:00
Junichi Uekawa
1ab4088062 Merge "Do not depend on host bits to get the right size to write."
am: 313632db57

* commit '313632db574d101275206ca025d21a5a3cd62150':
  Do not depend on host bits to get the right size to write.
2015-11-19 12:51:01 +00:00
Junichi Uekawa
313632db57 Merge "Do not depend on host bits to get the right size to write." 2015-11-19 12:44:19 +00:00
Junichi Uekawa
ff35b1e659 Do not depend on host bits to get the right size to write.
x86_64 32-bit or 64-bit relocations do not depend on ELF bit size, they
are 32-bit or 64-bit respectively.

Known compiler that emits such code is nacl-clang which emits
R_X86_64_PC32 which should write 32 bits but ended up writing 64 bits.

Change-Id: Ibb6b484c0fea6a7e291362148e8ac749d6674529
2015-11-19 11:28:20 +09:00
Yabin Cui
f091c1f2f1 Merge "Implement pthread spin."
am: 2c09e5de29

* commit '2c09e5de299ca87a9e68807e2b4af41ba61710f3':
  Implement pthread spin.
2015-11-19 02:03:24 +00:00
Yabin Cui
9d4bd6f0ca Merge "Avoid tsan warning about pthread_mutex_destroy."
am: ea5bb151af

* commit 'ea5bb151af5e1e364968cb1eac70c8a2c13ca7a7':
  Avoid tsan warning about pthread_mutex_destroy.
2015-11-19 02:03:13 +00:00
Yabin Cui
2c09e5de29 Merge "Implement pthread spin." 2015-11-19 01:55:37 +00:00
Yabin Cui
ea5bb151af Merge "Avoid tsan warning about pthread_mutex_destroy." 2015-11-19 01:55:25 +00:00
Yabin Cui
fe3a83a934 Implement pthread spin.
In order to run tsan unit tests, we need to support pthread spin APIs.

Bug: 18623621
Bug: 25392375
Change-Id: Icbb4a74e72e467824b3715982a01600031868e29
2015-11-18 17:51:21 -08:00
Hung-ying Tyan
f74b041cce Add /odm/lib to shared lib search path
ODM's shared libs should live in /odm/lib on the ODM partition.

BUG: 25654402
Change-Id: I3f5c26f208af87ff2817e490e51d0b4f5b8ec98e
2015-11-18 23:45:25 +08:00
Dimitry Ivanov
3f539a1655 Merge "Ignore target sdk version for the public namespace"
am: 63f0e0db76

* commit '63f0e0db768ea9be4db3dd6a2fb62ea942afb9d6':
  Ignore target sdk version for the public namespace
2015-11-18 03:52:50 +00:00
Dimitry Ivanov
63f0e0db76 Merge "Ignore target sdk version for the public namespace" 2015-11-18 03:43:59 +00:00
Dmitriy Ivanov
3cc35e224c Ignore target sdk version for the public namespace
This fixes the bug with using the libraries loaded
prior to android_set_target_sdk_version call.

Bug: http://b/22548808
Change-Id: I3ca2d367b0fa930a437bbb65f780834803d2ef0a
2015-11-17 18:45:12 -08:00
Yabin Cui
0307eee293 Avoid tsan warning about pthread_mutex_destroy.
If calling pthread_mutex_trylock from pthread_mutex_destroy, tsan
warns about an attempt to destroy a locked mutex.

Bug: 25392375
Change-Id: I5feee20e7a0d0915adad24da874ec1ccce241381
2015-11-17 16:17:44 -08:00
Yabin Cui
a36158a77d Fix pthread_test according to tsan report.
1. Fix leak threads and data races related to spin_flag.
2. Increase stack size to run under tsan.

This doesn't pass all pthread tests, as some tests are used
to run intentionally in race situations.

Bug: 25392375
Change-Id: Icfba3e141e7170abd890809586e89b99adc8bd02
2015-11-16 21:15:58 -08:00
Yabin Cui
278fe431b6 Merge "Implement pthread barrier."
am: b804b9d67b

* commit 'b804b9d67b9e3a8c63471ff9892f6abea2a58684':
  Implement pthread barrier.
2015-11-17 00:28:20 +00:00
Yabin Cui
b804b9d67b Merge "Implement pthread barrier." 2015-11-17 00:22:54 +00:00
Dimitry Ivanov
159c3d617f Merge "Remove the warning about empty LD_LIBRARY_PATH"
am: 3c8c16022a

* commit '3c8c16022a513a32eb6b92cf23f4ef43ccf7ad6d':
  Remove the warning about empty LD_LIBRARY_PATH
2015-11-16 22:30:32 +00:00
Dimitry Ivanov
3c8c16022a Merge "Remove the warning about empty LD_LIBRARY_PATH" 2015-11-16 22:25:50 +00:00
Dmitriy Ivanov
fbfba64068 Remove the warning about empty LD_LIBRARY_PATH
Change-Id: I3eca11512d8055ab94dd0a6badcd83ce6440d675
2015-11-16 14:23:37 -08:00
Yabin Cui
e7c2fffa16 Implement pthread barrier.
Bug: 24341262
Change-Id: I5472549e5d7545c1c3f0bef78235f545557b9630
2015-11-16 14:02:26 -08:00
Chih-hung Hsieh
4d87f17621 Merge "Enable clang to compile more tests."
am: 949bfb9e3c

* commit '949bfb9e3cceac7913fe1debc39617c9ec01ae5e':
  Enable clang to compile more tests.
2015-11-16 21:36:51 +00:00
Chih-hung Hsieh
949bfb9e3c Merge "Enable clang to compile more tests." 2015-11-16 21:31:36 +00:00
Dimitry Ivanov
b061c9250d Merge "Fix arm64 and x86 builds"
am: 61f186d067

* commit '61f186d067a3efb6a86450092a567fb18c1641c3':
  Fix arm64 and x86 builds
2015-11-16 21:25:31 +00:00
Dimitry Ivanov
61f186d067 Merge "Fix arm64 and x86 builds" 2015-11-16 21:23:18 +00:00
Dmitriy Ivanov
d9b08a0bc0 Fix arm64 and x86 builds
Change-Id: Ic3746b2f200f42218b6ac857c1631e873c767c17
2015-11-16 13:17:27 -08:00
Dimitry Ivanov
2616cdcdb9 Merge "Introducing linker namespaces"
am: 1f0ccbb59c

* commit '1f0ccbb59cd32dfad0e6d9fd9619905e067076a6':
  Introducing linker namespaces
2015-11-16 20:21:05 +00:00
Dimitry Ivanov
1f0ccbb59c Merge "Introducing linker namespaces" 2015-11-16 20:14:37 +00:00
Chih-Hung Hsieh
1e79540807 Enable clang to compile more tests.
* Disable optimization only in gtest.h of atexit_test.c for arm/aarch64
  to keep VTT for std::__1::basic_stringstream<char, std::__1::char_traits<char>,
  std::__1::allocator<char> > to link with g++ compiled modules.
* bionic-unit-tests source files are not affected by clang x86_64 fp128 bug
  so they can be compiled with clang.

BUG: 25643775
Change-Id: I3da2a0de61edcdca07b7fcd73a16de9da4a1f7d6
2015-11-16 11:36:15 -08:00
Dmitriy Ivanov
42d5fcb9f4 Introducing linker namespaces
Bug: http://b/22548808
Change-Id: Ia3af3c0a167f1d16447a3d83bb045d143319b1e1
2015-11-15 12:09:16 -08:00
Elliott Hughes
69536213d6 Merge "Improve libc time zone fallback behavior."
am: 1b42c54471

* commit '1b42c544711316281e09c5da25850fac531b27cb':
  Improve libc time zone fallback behavior.
2015-11-13 18:28:57 +00:00
Elliott Hughes
1b42c54471 Merge "Improve libc time zone fallback behavior." 2015-11-13 18:24:41 +00:00
Elliott Hughes
d1c28a361b Improve libc time zone fallback behavior.
We should fall back to GMT if neither the environment variable nor the
system property is set. This is the case if you wipe a WiFi-only device,
because we currently only take the time zone from cell networks.

Bug: http://b/24773112
Change-Id: I90d236d4d492b6562d75021bd312030b91c1e298
2015-11-13 08:38:48 -08:00
Elliott Hughes
5187baa387 Merge "Fix strftime if tm_zone is null."
am: 5780f9d809

* commit '5780f9d80963fbe7b93f501dd3dd7edc7fab46b0':
  Fix strftime if tm_zone is null.
2015-11-13 03:04:31 +00:00
Elliott Hughes
5780f9d809 Merge "Fix strftime if tm_zone is null." 2015-11-13 02:58:30 +00:00
Nick Kralevich
bb725f7b77 Merge "FORTIFY_SOURCE: make sure gcc unittests are compiled with gcc"
am: 4ea67f6950

* commit '4ea67f695066b73796b24563d83e8b5a9190334d':
  FORTIFY_SOURCE: make sure gcc unittests are compiled with gcc
2015-11-13 01:12:41 +00:00
Nick Kralevich
4ea67f6950 Merge "FORTIFY_SOURCE: make sure gcc unittests are compiled with gcc" 2015-11-13 01:09:44 +00:00
Elliott Hughes
a9cac4c87a Fix strftime if tm_zone is null.
Upstream tzcode said "On platforms with tm_zone, strftime.c now assumes it
is not NULL". Which is fine for any struct tm generated by tzcode, but not
necessarily true of a struct tm constructed by arbitrary code. In particular,
Netflix on Nexus Player was failing to start because they format "%Z" with
a struct tm whose tm_zone is null (the other fields are valid, but, yeah,
that's probably not intentional).

glibc takes a null tm_zone to mean "the current time zone", so let's do that
too. (Historically Android would use the empty string, and POSIX doesn't
clarify which of this is the appropriate behavior when tm_zone is null.)

Bug: http://b/25170306
Change-Id: Idbf68bfe90d143aca7dada8607742905188b1d33
2015-11-12 16:51:31 -08:00
Nick Kralevich
2ed1b29d00 FORTIFY_SOURCE: make sure gcc unittests are compiled with gcc
The default compiler is clang. We need to explicitly indicate
that we should use gcc.

Change-Id: I37859c2e303f2a86a2565fe72eda1fda7c557a59
2015-11-12 15:55:13 -08:00
Chih-hung Hsieh
a2e9d90811 Merge "Still cannot compile with clang on arm64."
am: 7c10ee9473

* commit '7c10ee9473b5c46da733b2d3d24cf90fb8ac7672':
  Still cannot compile with clang on arm64.
2015-11-12 20:51:05 +00:00
Chih-hung Hsieh
7c10ee9473 Merge "Still cannot compile with clang on arm64." 2015-11-12 20:45:48 +00:00
Chih-Hung Hsieh
c04647f8c2 Still cannot compile with clang on arm64.
When __cxa_thread_atexit_impl.cpp is compiled with clang on arm64,
Android cannot boot up.

BUG: 25662915
Change-Id: If997b544f43e956172ce605d86fe147d42fd39e0
2015-11-12 12:39:13 -08:00
Chih-hung Hsieh
c0116bd3db Merge "Enable clang for modules failed with TLS."
am: 0c447053de

* commit '0c447053de4b87d50ebec260c7e1d949fe934065':
  Enable clang for modules failed with TLS.
2015-11-12 01:09:37 +00:00
Chih-hung Hsieh
0c447053de Merge "Enable clang for modules failed with TLS." 2015-11-12 01:04:51 +00:00
Elliott Hughes
fd57638117 Merge "Clean up pthread_gettid_np test."
am: dbc6398e95

* commit 'dbc6398e95df44a18715ce5ba19b8e1a93b969d4':
  Clean up pthread_gettid_np test.
2015-11-12 01:04:38 +00:00
Elliott Hughes
dbc6398e95 Merge "Clean up pthread_gettid_np test." 2015-11-12 00:59:08 +00:00
Chih-Hung Hsieh
5058a005b8 Enable clang for modules failed with TLS.
New 3.8 clang/llvm can compile TLS code now.
* For x86_64, still disable clang due to f128 bug.
* For b/25643775, arm and arm64, disable clang in unit tests.
* Fix thread_local_test.cpp to compile with clang and
  limit gcc workaround only to arm and aarch64.

BUG: 25643775

Change-Id: Iecd006bf1fc417dbcce2c63343a59c4bf1fa77ea
2015-11-11 16:22:38 -08:00
Josh Gao
504e3274a0 Merge "Add 100 column limit to .clang-format."
am: b03e6bf924

* commit 'b03e6bf9247bb36162b9f4c61d07e488a18e126c':
  Add 100 column limit to .clang-format.
2015-11-11 22:25:42 +00:00
Josh Gao
b03e6bf924 Merge "Add 100 column limit to .clang-format." 2015-11-11 22:22:59 +00:00
Josh Gao
615f3aa8b4 Add 100 column limit to .clang-format.
Change-Id: I3c3fa5e61cfb2af7f2888dcee56229692ec1479c
2015-11-11 14:21:09 -08:00
Elliott Hughes
f208361b2b Clean up pthread_gettid_np test.
Change-Id: I0fad26c7824981bfa3ad3a8a0b28a1984062dcd1
2015-11-11 13:32:28 -08:00
Elliott Hughes
2b1e258fec Merge "Fix potential race condition on CTS TC pthread_gettid_np"
am: ffe5c24c86

* commit 'ffe5c24c8693f1f4fc8edb68075fb36df558b801':
  Fix potential race condition on CTS TC pthread_gettid_np
2015-11-11 21:25:38 +00:00
Elliott Hughes
ffe5c24c86 Merge "Fix potential race condition on CTS TC pthread_gettid_np" 2015-11-11 21:21:33 +00:00
Junjie Hu
de1246202a Fix potential race condition on CTS TC pthread_gettid_np
Root cause:
If start_routine thread exits before pthread_gettid_np is invokded, the "tid" field
will be cleared so that pthread_gettid_np will get "0" (which is cleared by kernel, 
due to the flag "CLONE_CHILD_CLEARTID" is set while calling clone system call inside
pthread_create).

Proposed patch:
Use a mutex to guarantee pthread_gettid_np will be invoked and returned before the
start_routine exits

Signed-off-by: Junjie Hu <junjie.hu@mediatek.com>

Change-Id: I22411f1b0f7446d76a0373cef4ccec858fac7018
(cherry picked from commit 4f8010293506d4e08d184e66bf4af44ef3483611)
2015-11-11 21:21:21 +00:00
Nick Kralevich
8640233fef Merge "libc_init_common.cpp: Clarify when environment stripping occurs"
am: 6209b99a73

* commit '6209b99a7351ed732ab25bb2ffa75465366b244f':
  libc_init_common.cpp: Clarify when environment stripping occurs
2015-11-11 02:09:36 +00:00
Nick Kralevich
6209b99a73 Merge "libc_init_common.cpp: Clarify when environment stripping occurs" 2015-11-11 02:06:59 +00:00
Nick Kralevich
2fb02651c8 libc_init_common.cpp: Clarify when environment stripping occurs
The current comment implies that we only strip sensitive
environment variables on executing a setuid program. This is
true but incomplete. The AT_SECURE flag is set whenever a
security transition occurs, such as executing a setuid program,
SELinux security transition, executing a file with file capabilities,
etc...

Fixup the comments.

Change-Id: I30a73992adfde14d6e5f642b3a1ead2ee56726be
2015-11-10 16:45:49 -08:00
Tom Cherry
8e86f33690 Merge "Refactor prop_area into a class"
am: 2a7f1b335d

* commit '2a7f1b335dcd08a480c4acc948ba202bae1a0a1f':
  Refactor prop_area into a class
2015-11-10 21:58:23 +00:00
Tom Cherry
2a7f1b335d Merge "Refactor prop_area into a class" 2015-11-10 21:54:39 +00:00
Tom Cherry
926ebe1094 Refactor prop_area into a class
Bug 21852512

Change-Id: I432bf592f1a71a046c32616fc334ad77c220f0ca
2015-11-09 17:22:44 -08:00
Josh Gao
2fdaa6c599 Merge "Fix test failure."
am: 11b3916b83

* commit '11b3916b83e33fce9e3123659fe4e61ef84d39b5':
  Fix test failure.
2015-11-10 00:10:20 +00:00
Josh Gao
11b3916b83 Merge "Fix test failure." 2015-11-10 00:08:09 +00:00
Josh Gao
09fac86ca3 Fix test failure.
Bug: http://b/25596173
Change-Id: I0cf8f550837d4a936d6a784063a0ec9509150358
2015-11-09 16:04:50 -08:00
Dan Willemsen
dcf501913d Merge "Update Android.bp with latest Android.mk changes"
am: 704e048cbf

* commit '704e048cbfcb69b7906371f9f4cae4cb6357096e':
  Update Android.bp with latest Android.mk changes
2015-11-09 22:31:50 +00:00
Dan Willemsen
704e048cbf Merge "Update Android.bp with latest Android.mk changes" 2015-11-09 22:28:18 +00:00
Dan Willemsen
dc6b0a7b93 Update Android.bp with latest Android.mk changes
Change-Id: I45f6292fcc4d4559519d88f948b4478204b08f25
2015-11-09 14:03:46 -08:00
Yabin Cui
a74eb4dbf5 Merge "Add fileno_unlocked to support thread sanitizer."
am: 0e6542b75b

* commit '0e6542b75b2f3ca155b452782d2122f34f807485':
  Add fileno_unlocked to support thread sanitizer.
2015-11-07 00:30:09 +00:00
Yabin Cui
0e6542b75b Merge "Add fileno_unlocked to support thread sanitizer." 2015-11-07 00:24:52 +00:00
Yabin Cui
fb994f4c04 Add fileno_unlocked to support thread sanitizer.
Bug: 25392375
Change-Id: If3f92a0e08a53f4b59e01397e8efa307d8572349
2015-11-06 16:13:47 -08:00
Elliott Hughes
4eba804ca0 Merge "fix the mremap signature"
am: 8b5b2c4672

* commit '8b5b2c467281de502ba1c8ffbe447ef95fbf5219':
  fix the mremap signature
2015-11-06 21:24:59 +00:00
Elliott Hughes
8b5b2c4672 Merge "fix the mremap signature" 2015-11-06 21:18:08 +00:00
Daniel Micay
4200e260d2 fix the mremap signature
The mremap definition was incorrect (unsigned long instead of int) and
it was missing the optional new_address parameter.

Change-Id: Ib9d0675aaa098c21617cedc9b2b8cf267be3aec4
2015-11-06 13:14:43 -08:00
Dimitry Ivanov
bc0b61e407 Merge "linker: cleanup solist after unsuccessful read"
am: 3482613685

* commit '3482613685342da365a7569220f8e6c27a1fe7e5':
  linker: cleanup solist after unsuccessful read
2015-11-06 19:02:08 +00:00
Dimitry Ivanov
3482613685 Merge "linker: cleanup solist after unsuccessful read" 2015-11-06 19:00:24 +00:00
Dmitriy Ivanov
fd7a91e692 linker: cleanup solist after unsuccessful read
Bug: http://b/25560017
Change-Id: I03c5a1d7aed34c480d341aacfb3b1afdfa037b99
2015-11-06 10:44:37 -08:00
Dimitry Ivanov
2dc1e91dba Merge "Fix linked_list::remove_if()"
am: 004fead6bc

* commit '004fead6bc55d1e65b4fb9ca1ac36646b99e5fdd':
  Fix linked_list::remove_if()
2015-11-06 02:35:02 +00:00
Dimitry Ivanov
004fead6bc Merge "Fix linked_list::remove_if()" 2015-11-06 02:32:34 +00:00
Dmitriy Ivanov
7a9311f7f1 Fix linked_list::remove_if()
When remove_if removes last element from the list
following push_back stops working.

Change-Id: Ia3e92763b83a2e172eaa10de7aecfb7a4be452d7
2015-11-05 17:41:05 -08:00
Colin Cross
10c6a7c7b9 Merge "Use cc_defaults"
am: ef5e647891

* commit 'ef5e647891f1a0aefeab4a87e9225e47087c6301':
  Use cc_defaults
2015-11-05 02:00:22 +00:00
Colin Cross
ef5e647891 Merge "Use cc_defaults" 2015-11-05 01:56:58 +00:00
Josh Gao
824084ce76 Merge "Fix GNU/POSIX basename headers."
am: dd7dcfcfdb

* commit 'dd7dcfcfdbab3b38fc40551defdf81c3b734e336':
  Fix GNU/POSIX basename headers.
2015-11-04 22:28:19 +00:00
Josh Gao
dd7dcfcfdb Merge "Fix GNU/POSIX basename headers." 2015-11-04 22:26:13 +00:00
Josh Gao
eb9b925012 Fix GNU/POSIX basename headers.
Including glibc's <libgen.h> will result in the user getting the POSIX
version of basename always, regardless of when it is included relative
to <string.h>. Prior to this patch, our implementation would result in
the one that's included first winning.

Bug: http://b/25459151
Change-Id: Id4aaf1670dad317d6bbc05763a84ee87596e8e59
2015-11-04 14:19:55 -08:00
Colin Cross
50c21ab47d Use cc_defaults
Use a cc_defaults module to reduce duplication.

Change-Id: Iaee6bf20b84123babcdc68d4feb06308f5f61a59
2015-11-03 17:25:36 -08:00
Dan Willemsen
021d959eba Merge "Update Android.bp with arch-specific version scripts"
am: 4b920f042a

* commit '4b920f042ac4b35c4dd3ff51f7b8f164a22e3500':
  Update Android.bp with arch-specific version scripts
2015-11-03 23:26:08 +00:00
Josh Gao
a59479434c Merge "fix PTRDIFF_MAX check in the 32-bit mmap wrapper"
am: af909869d8

* commit 'af909869d868585a47914ab51536192da50935cb':
  fix PTRDIFF_MAX check in the 32-bit mmap wrapper
2015-11-03 23:25:55 +00:00
Dan Willemsen
4b920f042a Merge "Update Android.bp with arch-specific version scripts" 2015-11-03 22:38:23 +00:00
Dan Willemsen
9e6f98fe9d Update Android.bp with arch-specific version scripts
Change-Id: I59b34f21b54e8a2084bb318a08c4092064f48083
2015-11-03 14:30:57 -08:00
Bill Yi
a4bff2106b Merge commit '6ebfb7b4ea158005a725f43564267e0aed764d80' into HEAD 2015-11-03 14:28:57 -08:00
Josh Gao
af909869d8 Merge "fix PTRDIFF_MAX check in the 32-bit mmap wrapper" 2015-11-03 19:35:05 +00:00
Daniel Micay
706186d266 fix PTRDIFF_MAX check in the 32-bit mmap wrapper
It wasn't making use of the page-rounded size.

Change-Id: I911345fcfd6419a4dbc18a4622b42e1b76729abb
2015-11-03 05:30:29 -05:00
Christopher Ferris
9fe02f3e3c Merge "Fix comment to reflect the actual reality."
am: e07558fb80

* commit 'e07558fb80da4e196e8b7e371041c1e75c56b29b':
  Fix comment to reflect the actual reality.
2015-11-02 21:10:19 +00:00
Christopher Ferris
e07558fb80 Merge "Fix comment to reflect the actual reality." 2015-11-02 21:07:04 +00:00
Christopher Ferris
384ffe3463 Fix comment to reflect the actual reality.
The original comment implied that Android 32 bit was the only one
using a bad time_t, but it turns out 32 bit glibc has the same time_t
as Android. Update the comment to reflect this reality.

Change-Id: I72cdd2c677a6521f7b43d4695a52fd8fdc3305bd
2015-11-02 12:56:37 -08:00
Dimitry Ivanov
86bf87c054 Merge "Generate libdl.so per-architecture version script"
am: 75dd3710e7

* commit '75dd3710e72e819ce6710e93672f937550ed3818':
  Generate libdl.so per-architecture version script
2015-10-31 18:20:28 +00:00
Dimitry Ivanov
75dd3710e7 Merge "Generate libdl.so per-architecture version script" 2015-10-31 18:17:17 +00:00
Christopher Ferris
0ba085de2c Merge "Make _signal hidden in all cases."
am: 6a8a09f7c4

* commit '6a8a09f7c40fb677a8dc8a233b58f62df8ae79dc':
  Make _signal hidden in all cases.
2015-10-31 16:15:17 +00:00
Christopher Ferris
6a8a09f7c4 Merge "Make _signal hidden in all cases." 2015-10-31 16:11:48 +00:00
Dmitriy Ivanov
bc75047a1b Generate libdl.so per-architecture version script
Bug: http://b/24767418
Change-Id: I3d5775ba44d4c8e7fc5f2fbebae10e022100f1e2
2015-10-30 17:43:27 -07:00
Christopher Ferris
1721cd6a74 Make _signal hidden in all cases.
_signal was static in 64 bit, and hidden on 32 bit. There is no
reason to have this distinction, so make it hidden in all cases.

Change-Id: I09d5d93ac8cab4fe14dc7bdfeb25aa46a3b7413d
2015-10-30 17:10:47 -07:00
Elliott Hughes
a8f69017e5 Merge "Add prlimit to LP32."
am: c36be975ce

* commit 'c36be975ce4525b452435f43beb1fb9fc26a7fdc':
  Add prlimit to LP32.
2015-10-30 23:40:48 +00:00
Elliott Hughes
c36be975ce Merge "Add prlimit to LP32." 2015-10-30 23:35:40 +00:00
Elliott Hughes
caa61b03b2 Merge "Remove <sys/shm.h>."
am: bdac9ec142

* commit 'bdac9ec142347a0dc9784bddd0f8336535e73529':
  Remove <sys/shm.h>.
2015-10-30 22:16:58 +00:00
Elliott Hughes
bdac9ec142 Merge "Remove <sys/shm.h>." 2015-10-30 22:06:26 +00:00
Christopher Ferris
6297e3231c Merge "Move __set_errno to ndk_cruft.cpp."
am: e75453d5dd

* commit 'e75453d5dd8b373f6e7ef61ec22a6a3074d51e02':
  Move __set_errno to ndk_cruft.cpp.
2015-10-30 16:06:45 +00:00
Christopher Ferris
e75453d5dd Merge "Move __set_errno to ndk_cruft.cpp." 2015-10-30 16:02:01 +00:00
Elliott Hughes
38eca07826 Remove <sys/shm.h>.
Android doesn't allow SysV IPC, so this only serves two purposes. It's
good in that it helps random code (especially code that doesn't actually
need this header) to compile anyway. But it's bad for the same reason:
it's misleading for configure scripts that test for the header but not
for the corresponding functions.

Bug: http://b/19340456
Change-Id: I4a5f319d9aecf46fc512fc94bb4f9e3f6ea64e71
2015-10-29 19:52:44 -07:00
Christopher Ferris
9978a9a82e Move __set_errno to ndk_cruft.cpp.
Change-Id: I5caa1cc161961d2e4629429c0d406875b93cdbd0
2015-10-29 18:11:32 -07:00
Elliott Hughes
4151db5f99 Add prlimit to LP32.
Bug: http://b/24918750
Change-Id: I0151cd66ccf79a6169610de35bb9c288c0fa4917
2015-10-28 20:04:59 -07:00
Dimitry Ivanov
6ebfb7b4ea Merge "Fix mips and x86 builds" am: 50e9279589
am: fedb167c55

* commit 'fedb167c551540133d88d46a1de7c17b865cbf32':
  Fix mips and x86 builds
2015-10-29 00:59:46 +00:00
Dimitry Ivanov
fedb167c55 Merge "Fix mips and x86 builds"
am: 50e9279589

* commit '50e92795890c0d8b4bf54c535f66f3b2edf7bd59':
  Fix mips and x86 builds
2015-10-29 00:56:57 +00:00
Dimitry Ivanov
50e9279589 Merge "Fix mips and x86 builds" 2015-10-29 00:53:52 +00:00
Dmitriy Ivanov
c176440c90 Fix mips and x86 builds
Change-Id: Idda2494876fd6bf64b3efe6de2e384da9b6a0dbc
2015-10-28 17:51:47 -07:00
Dimitry Ivanov
316938a676 Merge "Fix LDFLAGS for arm and x86" am: 5ccad497d4
am: bd5bf272a0

* commit 'bd5bf272a0fbb65ad1658106cde4c2ec5f5ce520':
  Fix LDFLAGS for arm and x86
2015-10-29 00:50:51 +00:00
Dimitry Ivanov
bd5bf272a0 Merge "Fix LDFLAGS for arm and x86"
am: 5ccad497d4

* commit '5ccad497d43e7587ec5581845e5094488093f76d':
  Fix LDFLAGS for arm and x86
2015-10-29 00:47:16 +00:00
Dimitry Ivanov
5ccad497d4 Merge "Fix LDFLAGS for arm and x86" 2015-10-29 00:43:00 +00:00
Dmitriy Ivanov
e85fb580c8 Fix LDFLAGS for arm and x86
Change-Id: I5366f4499cb4da3a51b8484ab3e4ff785f0888ab
2015-10-28 17:25:34 -07:00
Dimitry Ivanov
c5f943eb2e Merge "Generate per-architecture version scripts." am: 578d949e8d
am: b420ddd27e

* commit 'b420ddd27e1ce0becf0e57c0fc0efe9ec726ab21':
  Generate per-architecture version scripts.
2015-10-28 23:55:10 +00:00
Dimitry Ivanov
b420ddd27e Merge "Generate per-architecture version scripts."
am: 578d949e8d

* commit '578d949e8df782134127b4ae384f731d9d7c6694':
  Generate per-architecture version scripts.
2015-10-28 23:51:49 +00:00
Elliott Hughes
7f337bd1e3 Merge "Remove the legacy endusershell/getusershell/setusershell stubs." am: d9146c2404
am: 601183efaf

* commit '601183efafffb2a145736b4a3f73be1034d761b0':
  Remove the legacy endusershell/getusershell/setusershell stubs.
2015-10-28 23:48:12 +00:00
Dimitry Ivanov
578d949e8d Merge "Generate per-architecture version scripts." 2015-10-28 23:44:03 +00:00
Elliott Hughes
601183efaf Merge "Remove the legacy endusershell/getusershell/setusershell stubs."
am: d9146c2404

* commit 'd9146c24041ad571e3725ab630d9ac94df3ff6d1':
  Remove the legacy endusershell/getusershell/setusershell stubs.
2015-10-28 23:43:05 +00:00
Dmitriy Ivanov
284b468524 Generate per-architecture version scripts.
Bug: http://b/24767418
Change-Id: I23e49d8d30c0def3215ffbd99d09f207d9483624
2015-10-28 16:40:53 -07:00
Elliott Hughes
d9146c2404 Merge "Remove the legacy endusershell/getusershell/setusershell stubs." 2015-10-28 23:35:25 +00:00
Elliott Hughes
d7c7daada2 Remove the legacy endusershell/getusershell/setusershell stubs.
These don't work, aren't thread-safe, aren't in POSIX (or our header
files), and are only used by one app (whose developers I've contacted).
But the presence of these symbols causes configure to be confused, which
is a pain for Brillo.

Bug: http://b/24812426
Change-Id: I7fa6ef82864d5563929d9b8a7f8fcacb30b26d45
2015-10-28 14:20:16 -07:00
Elliott Hughes
2c11b07ee0 Merge "Implement scandirat and scandirat64." am: 1721be2229
am: a1be410fd7

* commit 'a1be410fd7f916063164fd9daf28ca992af828d7':
  Implement scandirat and scandirat64.
2015-10-27 22:02:54 +00:00
Elliott Hughes
a1be410fd7 Merge "Implement scandirat and scandirat64."
am: 1721be2229

* commit '1721be2229d07b5eea830f02a76e7be56d172aa9':
  Implement scandirat and scandirat64.
2015-10-27 21:57:55 +00:00
Elliott Hughes
1721be2229 Merge "Implement scandirat and scandirat64." 2015-10-27 21:40:31 +00:00
Elliott Hughes
6331e806de Implement scandirat and scandirat64.
Bug: http://b/12612339
Change-Id: Id3b249a884fe08964b26a017ae9574961f0cb441
2015-10-27 13:47:36 -07:00
Dimitry Ivanov
75347e52b0 Merge "Implement load at fixed address feature" am: 5238eb0984
am: 9e599956b2

* commit '9e599956b2ece835b480182eee27209b4a831a19':
  Implement load at fixed address feature
2015-10-27 19:17:38 +00:00
Dimitry Ivanov
9e599956b2 Merge "Implement load at fixed address feature"
am: 5238eb0984

* commit '5238eb09844f9c1578353d4c9e297aadb34c71be':
  Implement load at fixed address feature
2015-10-27 19:12:34 +00:00
Dimitry Ivanov
5238eb0984 Merge "Implement load at fixed address feature" 2015-10-27 19:03:53 +00:00
Dmitriy Ivanov
126af757c6 Implement load at fixed address feature
Bug: http://b/24683631
Change-Id: I3a39ab526c8f9e213339b60e135e5459d0f41381
2015-10-27 11:27:34 -07:00
Elliott Hughes
3b9b14830b Merge "Fix <utmp.h> declarations." am: 60752a2eea
am: 6e780f2f47

* commit '6e780f2f47655ce264cfe90c4a721eb609fdbfec':
  Fix <utmp.h> declarations.
2015-10-27 15:15:10 +00:00
Elliott Hughes
6e780f2f47 Merge "Fix <utmp.h> declarations."
am: 60752a2eea

* commit '60752a2eeab8cd0b344b27c67a47e30628962211':
  Fix <utmp.h> declarations.
2015-10-27 15:11:58 +00:00
Elliott Hughes
60752a2eea Merge "Fix <utmp.h> declarations." 2015-10-27 15:07:12 +00:00
Elliott Hughes
9216a64c90 Fix <utmp.h> declarations.
If we're going to keep this useless header -- and I think it's too late to
remove it -- it may as well be correct.

Bug: http://b/17700469
Change-Id: Ifec4f8f1a984483d7fa7d81d47786f75b70ff4ba
2015-10-26 19:29:12 -07:00
Elliott Hughes
164bd7349b Merge "Remove swap16/swap32/swap64 header pollution." am: a2cf3783d4
am: 00e9bfe523

* commit '00e9bfe523a045131142b13a766774f1ee43555e':
  Remove swap16/swap32/swap64 header pollution.
2015-10-27 02:14:39 +00:00
Elliott Hughes
00e9bfe523 Merge "Remove swap16/swap32/swap64 header pollution."
am: a2cf3783d4

* commit 'a2cf3783d4e9a4008ed468ef3204593f8f549934':
  Remove swap16/swap32/swap64 header pollution.
2015-10-27 02:11:17 +00:00
Elliott Hughes
a2cf3783d4 Merge "Remove swap16/swap32/swap64 header pollution." 2015-10-27 02:07:35 +00:00
Elliott Hughes
bf4c32df6b Remove swap16/swap32/swap64 header pollution.
This seems to be obsolete BSD stuff, and the only references to it in the
tree are people #undef'ing it.

Bug: http://b/2735009
Change-Id: Icde523ae2d15cf1025357d861f97b415e89e4f9a
2015-10-26 17:51:42 -07:00
Dimitry Ivanov
159f0d4013 Merge "Implement Library Load Order Randomization" am: 6a4ddeb56e
am: 3d784087cd

* commit '3d784087cd292f5ed10f9560f28152db3c4d550e':
  Implement Library Load Order Randomization
2015-10-26 22:43:06 +00:00
Dimitry Ivanov
3d784087cd Merge "Implement Library Load Order Randomization"
am: 6a4ddeb56e

* commit '6a4ddeb56ef2144e98437ae82f84b09ea785e411':
  Implement Library Load Order Randomization
2015-10-26 22:38:01 +00:00
Dimitry Ivanov
6a4ddeb56e Merge "Implement Library Load Order Randomization" 2015-10-26 22:30:35 +00:00
Christopher Ferris
382524878a Merge "Fix arm64 fenv warnings, and make warnings errors." am: 1ab8251030
am: 25a7efa7e9

* commit '25a7efa7e9a4bee5cae872c59a5edab8cae147da':
  Fix arm64 fenv warnings, and make warnings errors.
2015-10-24 16:10:07 +00:00
Christopher Ferris
25a7efa7e9 Merge "Fix arm64 fenv warnings, and make warnings errors."
am: 1ab8251030

* commit '1ab8251030407ec397009b46db025f8e9688abc8':
  Fix arm64 fenv warnings, and make warnings errors.
2015-10-24 16:06:17 +00:00
Christopher Ferris
1ab8251030 Merge "Fix arm64 fenv warnings, and make warnings errors." 2015-10-24 16:00:29 +00:00
Christopher Ferris
fa7752986d Fix arm64 fenv warnings, and make warnings errors.
Even though the control registers being read/written in fenv.c only
have 32 bits that are used, the instructions take a 64 bit register.
Make sure the inline assembler in the macros use 64 bit values.

Verified that before the change and after the change, the disassembly
is exactly the same.

In addition, add -Werror to the cflags.

Change-Id: I6603779327488c23e3aab13300edf2e02b101916
2015-10-23 16:41:17 -07:00
Christopher Ferris
c9ad2274b2 Merge "Rename LIBC64_HIDDEN to LIBC32_LEGACY_PUBLIC." am: ca430d9787
am: c5b9c4d72f

* commit 'c5b9c4d72f141fea8b03561c0c8f5f7068ea93ea':
  Rename LIBC64_HIDDEN to LIBC32_LEGACY_PUBLIC.
2015-10-23 21:08:31 +00:00
Dimitry Ivanov
172cdd79a5 Merge "refactoring: introduce MappedFileFragment" am: e08ab4b414
am: 67e282d511

* commit '67e282d5111fd8920b271dd1bbbb7348e06f719f':
  refactoring: introduce MappedFileFragment
2015-10-23 21:08:26 +00:00
Christopher Ferris
c5b9c4d72f Merge "Rename LIBC64_HIDDEN to LIBC32_LEGACY_PUBLIC."
am: ca430d9787

* commit 'ca430d9787f1c11c2df8e908c64fe2ef2e6d54ed':
  Rename LIBC64_HIDDEN to LIBC32_LEGACY_PUBLIC.
2015-10-23 21:02:56 +00:00
Dimitry Ivanov
67e282d511 Merge "refactoring: introduce MappedFileFragment"
am: e08ab4b414

* commit 'e08ab4b4144b8c4c920221b403daa220b43df2fb':
  refactoring: introduce MappedFileFragment
2015-10-23 21:02:51 +00:00
Christopher Ferris
ca430d9787 Merge "Rename LIBC64_HIDDEN to LIBC32_LEGACY_PUBLIC." 2015-10-23 20:56:09 +00:00
Dimitry Ivanov
e08ab4b414 Merge "refactoring: introduce MappedFileFragment" 2015-10-23 20:54:00 +00:00
Christopher Ferris
a818445622 Rename LIBC64_HIDDEN to LIBC32_LEGACY_PUBLIC.
Change-Id: If4da9e46398ca5524f6f0680d70588e3dc7e80b4
2015-10-23 12:32:52 -07:00
Andreas Gampe
bdff4ce8ed resolve merge conflicts of 216bff9ff3 to mnc-dr-dev.
am: 807032d0e1

* commit '807032d0e12877a4c92ac7f6072d5dd9e1f76f3c':
  Sync with upstream NetBSD lib/libc/regex.
2015-10-23 05:39:52 +00:00
Andreas Gampe
807032d0e1 resolve merge conflicts of 216bff9ff3 to mnc-dr-dev.
Change-Id: I63c4f3a4e56f30d6f476ad2c623c23ee7e1a3778
2015-10-22 22:15:26 -07:00
Yabin Cui
12b46fb00e Merge "Use bionic lock in pthread_internal_t." am: c45f3bf3e6
am: 0507b6e9e6

* commit '0507b6e9e65132a95bc0e366faa0df729b219b43':
  Use bionic lock in pthread_internal_t.
2015-10-23 04:36:12 +00:00
Yabin Cui
0507b6e9e6 Merge "Use bionic lock in pthread_internal_t."
am: c45f3bf3e6

* commit 'c45f3bf3e691f48af63c5ea2bf7a348a698013ac':
  Use bionic lock in pthread_internal_t.
2015-10-23 04:32:44 +00:00
Yabin Cui
c45f3bf3e6 Merge "Use bionic lock in pthread_internal_t." 2015-10-23 04:26:54 +00:00
Yabin Cui
d26e780df6 Use bionic lock in pthread_internal_t.
It removes calling to pthread_mutex_lock() at the beginning of new
thread, which helps to support thread sanitizer.

Change-Id: Ia3601c476de7976a9177b792bd74bb200cee0e13
2015-10-22 20:14:33 -07:00
Dmitriy Ivanov
4f7a7ad3fe Implement Library Load Order Randomization
Bug: http://b/24047022
Change-Id: I36e05b403bfbaae8542a95147f9114a8b9c8ac0e
2015-10-22 18:26:07 -07:00
Dmitriy Ivanov
cf1cbbe432 refactoring: introduce MappedFileFragment
Change-Id: I97b0c1131711ed0ac13ab33e3357e99e0b6b1a4e
2015-10-22 18:01:56 -07:00
Christopher Ferris
216bff9ff3 resolve merge conflicts of d676080a37 to lmp-mr1-ub-dev.
am: afff4442ae

* commit 'afff4442ae092469f298a71862d61c65ceb67b03':
  Sync with upstream NetBSD lib/libc/regex.
2015-10-22 22:27:54 +00:00
Christopher Ferris
afff4442ae resolve merge conflicts of d676080a37 to lmp-mr1-ub-dev.
Change-Id: I56c1bb2adb4b6a48733c928415e788e689b4944e
2015-10-21 14:56:52 -07:00
Elliott Hughes
d676080a37 Sync with upstream NetBSD lib/libc/regex.
am: 055a66c9b1

* commit '055a66c9b1017c01b82c12b65a571bf9efad8b19':
  Sync with upstream NetBSD lib/libc/regex.
2015-10-21 21:45:01 +00:00
Dan Willemsen
258a775d75 Merge "Switch to LOCAL_SRC_FILES_EXCLUDE" am: 5edf077c5b
am: 788eae7286

* commit '788eae728675bcf59f2b0809e85532c6ac357e2c':
  Switch to LOCAL_SRC_FILES_EXCLUDE
2015-10-20 20:58:25 +00:00
Dan Willemsen
788eae7286 Merge "Switch to LOCAL_SRC_FILES_EXCLUDE"
am: 5edf077c5b

* commit '5edf077c5b92f0db212e45ed5402339a6e4c7334':
  Switch to LOCAL_SRC_FILES_EXCLUDE
2015-10-20 20:52:01 +00:00
Dan Willemsen
5edf077c5b Merge "Switch to LOCAL_SRC_FILES_EXCLUDE" 2015-10-20 20:44:29 +00:00
Dan Willemsen
268a673bd1 Switch to LOCAL_SRC_FILES_EXCLUDE
This moves the generic arm/arm64/x86 settings into the main makefiles
and makes the rest of them derivatives. This better aligns with how
soong handles arch/cpu variants.

Also updates the Android.bp to make it consistent with the make
versions.

Change-Id: I5a0275d992bc657459eb6fe1697ad2336731d122
2015-10-20 11:58:28 -07:00
Mike Frysinger
4e0c4032d1 Merge "dlfcn: update ifdef around old_name_" am: 5c495dacda
am: 0fb6704e82

* commit '0fb6704e82fef450a01cca3b13d2fa02f66d47a5':
  dlfcn: update ifdef around old_name_
2015-10-20 18:42:59 +00:00
Mike Frysinger
0fb6704e82 Merge "dlfcn: update ifdef around old_name_"
am: 5c495dacda

* commit '5c495dacdadff9dfbe48be31d4b30c5fe75ac7db':
  dlfcn: update ifdef around old_name_
2015-10-20 18:31:32 +00:00
Mike Frysinger
5c495dacda Merge "dlfcn: update ifdef around old_name_" 2015-10-20 18:23:22 +00:00
Mike Frysinger
747d30ebf3 dlfcn: update ifdef around old_name_
Commit 9185e04f72c16d2a66d92ac89b38ee926d7f706b changed the ifdef around
old_name_ from __arm__ to __work_around_b_###__, but missed one place in
dlfcn.cpp.  So if you do a build w/out that workaround for arm, you end
up with a build failure:
bionic/linker/dlfcn.cpp:275:27: error: no member named 'old_name_' in 'soinfo'
    strlcpy(__libdl_info->old_name_, __libdl_info->soname_, sizeof(__libdl_info->old_name_));
            ~~~~~~~~~~~~  ^
bionic/linker/dlfcn.cpp:275:82: error: no member named 'old_name_' in 'soinfo'
    strlcpy(__libdl_info->old_name_, __libdl_info->soname_, sizeof(__libdl_info->old_name_));
                                                                   ~~~~~~~~~~~~  ^

Bug: 24425865
Change-Id: Idbe1cc1c28083afeee6d90203c221f30f661c69c
2015-10-20 14:06:25 -04:00
Josh Gao
56ecb9bf2a Merge "Remove deprecated use of ldm/stm in ARM setjmp." am: f5ea085844
am: 053867ded8

* commit '053867ded82271f3f2795f3dcf62b4e7735619c8':
  Remove deprecated use of ldm/stm in ARM setjmp.
2015-10-20 01:48:47 +00:00
Josh Gao
053867ded8 Merge "Remove deprecated use of ldm/stm in ARM setjmp."
am: f5ea085844

* commit 'f5ea085844c66e7a65709edd7485a49396e556ce':
  Remove deprecated use of ldm/stm in ARM setjmp.
2015-10-20 01:30:32 +00:00
Josh Gao
f5ea085844 Merge "Remove deprecated use of ldm/stm in ARM setjmp." 2015-10-20 01:01:19 +00:00
Josh Gao
b24d743f62 Remove deprecated use of ldm/stm in ARM setjmp.
ARM deprecates using the SP register in the register lists for ldm
and stm, which LLVM emits a warning for.

Bug: http://b/25017080
Change-Id: Ib427e3dfd5740e251f1ad91ebb66534e0d7b72a9
2015-10-19 17:13:51 -07:00
Elliott Hughes
64f628f8d3 am 43b1f823: am 1a61896b: am 98384649: am 75316283: am 2d23418e: am 18442e02: (-s ours) am beb6e08a: Sync with upstream NetBSD lib/libc/regex.
* commit '43b1f823b5a739437cbe14e24d8449028e3c8f6e':
  Sync with upstream NetBSD lib/libc/regex.
2015-10-19 17:46:59 +00:00
Elliott Hughes
055a66c9b1 Sync with upstream NetBSD lib/libc/regex.
Bug: http://b/22850181
Change-Id: I11a51a2031e68a953ccd5691da98c699c7d01904

(cherry-picked from commit 71927a82379f7a72559ea96e6678d6215090937f)
2015-10-19 10:42:31 -07:00
Elliott Hughes
43b1f823b5 am 1a61896b: am 98384649: am 75316283: am 2d23418e: am 18442e02: (-s ours) am beb6e08a: Sync with upstream NetBSD lib/libc/regex.
* commit '1a61896b1bc470f9377eeeafec461aba0d0dda6c':
  Sync with upstream NetBSD lib/libc/regex.
2015-10-19 17:32:59 +00:00
Elliott Hughes
1a61896b1b am 98384649: am 75316283: am 2d23418e: am 18442e02: (-s ours) am beb6e08a: Sync with upstream NetBSD lib/libc/regex.
* commit '98384649b2d3f3eb5b03077bc0004e14a99a4d55':
  Sync with upstream NetBSD lib/libc/regex.
2015-10-19 17:29:49 +00:00
Elliott Hughes
98384649b2 am 75316283: am 2d23418e: am 18442e02: (-s ours) am beb6e08a: Sync with upstream NetBSD lib/libc/regex.
* commit '753162836a0d3a82739611c9e30aa872363558b1':
  Sync with upstream NetBSD lib/libc/regex.
2015-10-19 17:25:29 +00:00
Elliott Hughes
753162836a am 2d23418e: am 18442e02: (-s ours) am beb6e08a: Sync with upstream NetBSD lib/libc/regex.
* commit '2d23418e68acdab7e142cc75db2850a54aa829aa':
  Sync with upstream NetBSD lib/libc/regex.
2015-10-19 10:14:41 -07:00
Elliott Hughes
2d23418e68 am 18442e02: (-s ours) am beb6e08a: Sync with upstream NetBSD lib/libc/regex.
* commit '18442e023536c5cf205b820ed5d74b972b710acb':
  Sync with upstream NetBSD lib/libc/regex.
2015-10-19 10:07:34 -07:00
Elliott Hughes
18442e0235 am beb6e08a: Sync with upstream NetBSD lib/libc/regex.
* commit 'beb6e08abf1393663151afde2742bb23eccab4e1':
  Sync with upstream NetBSD lib/libc/regex.
2015-10-19 15:34:19 +00:00
Elliott Hughes
630855a6d5 am 6764e0b5: am d29ba555: Merge "Opt Brillo out of the ndk cruft."
* commit '6764e0b5e546c318d13fcac0ddbf0bea88271768':
  Opt Brillo out of the ndk cruft.
2015-10-17 03:16:47 +00:00
Elliott Hughes
6764e0b5e5 am d29ba555: Merge "Opt Brillo out of the ndk cruft."
* commit 'd29ba555130f1e61164cf6186cd6a29c7aa14719':
  Opt Brillo out of the ndk cruft.
2015-10-16 20:10:48 -07:00
Elliott Hughes
d29ba55513 Merge "Opt Brillo out of the ndk cruft." 2015-10-17 03:06:41 +00:00
Elliott Hughes
beb6e08abf Sync with upstream NetBSD lib/libc/regex.
Bug: http://b/22850181
(cherry-picked from commit 71927a82379f7a72559ea96e6678d6215090937f)

Change-Id: I11a51a2031e68a953ccd5691da98c699c7d01904
2015-10-16 17:52:55 -07:00
Dimitry Ivanov
a60b1aebb7 am 114605b0: am 5fd94dfe: Merge "Replace auto -> const auto&/auto&&"
* commit '114605b03666230f11113990b828356bfe692278':
  Replace auto -> const auto&/auto&&
2015-10-16 20:48:32 +00:00
Dimitry Ivanov
56cd1962b2 am c0e917ab: am 9c2122e8: Merge "Fix R_AARCH64_ABS/PREL relocations"
* commit 'c0e917abe5e94ce9729a8302b5ef3cb318003ea5':
  Fix R_AARCH64_ABS/PREL relocations
2015-10-16 20:48:30 +00:00
Dimitry Ivanov
114605b036 am 5fd94dfe: Merge "Replace auto -> const auto&/auto&&"
* commit '5fd94dfe3b36ee56e54d2002ad3a5e0fa8bff683':
  Replace auto -> const auto&/auto&&
2015-10-16 13:41:45 -07:00
Dimitry Ivanov
c0e917abe5 am 9c2122e8: Merge "Fix R_AARCH64_ABS/PREL relocations"
* commit '9c2122e803a01c80bef550eac2b24b5a79635a2a':
  Fix R_AARCH64_ABS/PREL relocations
2015-10-16 13:41:44 -07:00
Dimitry Ivanov
5fd94dfe3b Merge "Replace auto -> const auto&/auto&&" 2015-10-16 20:37:34 +00:00
Dimitry Ivanov
9c2122e803 Merge "Fix R_AARCH64_ABS/PREL relocations" 2015-10-16 20:36:25 +00:00
Dmitriy Ivanov
77f91c6d99 Fix R_AARCH64_ABS/PREL relocations
According to specification arm64 relocations
should not use *reloc value.

See http://infocenter.arm.com/help/topic/com.arm.doc.ihi0056b/IHI0056B_aaelf64.pdf
section 4.6.5

Bug: http://b/24977219
Bug: http://b/24527155
Change-Id: I3813255771f408ba957963c6ad56ed08e5110d83
2015-10-16 10:42:16 -07:00
Neil Fuller
3676052ce7 am 842866bd: Merge "Update timezone data to 2015g" into mnc-dr-dev
* commit '842866bd00220119e03fd8d2e6b77d7187b4b38c':
  Update timezone data to 2015g
2015-10-15 09:21:59 +00:00
Neil Fuller
842866bd00 Merge "Update timezone data to 2015g" into mnc-dr-dev 2015-10-15 08:25:58 +00:00
Dmitriy Ivanov
845dd0266b resolved conflicts for 95ac6dbb to mnc-dr-dev-plus-aosp
Change-Id: I8937cd33aa375824965d4f919038a99b30ab75ea
2015-10-14 18:41:36 -07:00
Dimitry Ivanov
c70d479dc6 am 8c9cb682: am 074efa02: Merge "Ensure that readlink has access to /proc/self/fd"
* commit '8c9cb6820fca3f73414219d816e10355a7052dbd':
  Ensure that readlink has access to /proc/self/fd
2015-10-15 01:37:37 +00:00
Dimitry Ivanov
8c9cb6820f am 074efa02: Merge "Ensure that readlink has access to /proc/self/fd"
* commit '074efa02a7de67589c36f75222e3b45c3f15206a':
  Ensure that readlink has access to /proc/self/fd
2015-10-15 01:31:15 +00:00
Christopher Ferris
9e2d37ccae am 3c30a156: Merge "Sync with upstream NetBSD lib/libc/regex." into mnc-dr-dev
* commit '3c30a156523f40250361e6ed8791919d1c71a4bb':
  Sync with upstream NetBSD lib/libc/regex.
2015-10-15 01:29:05 +00:00
Dimitry Ivanov
074efa02a7 Merge "Ensure that readlink has access to /proc/self/fd" 2015-10-15 01:27:17 +00:00
Dmitriy Ivanov
4e50d0247b Ensure that readlink has access to /proc/self/fd
/proc/self/fd is not available when PR_DUMPABLE is set to 0
which is default for the user builds. It leads to permission
denials on readlink.

This change fixes the problem by setting PR_DUMPABLE flag to 1
for readlink and restoring it's previous value after the call.

Bug: http://b/24912743
Change-Id: I3fd179c5c6b56af96d6a15ee597024ccb15e1a13
(cherry picked from commit cf92738fa5dee24050028a1235f815f2a0fd33b5)
2015-10-14 18:24:54 -07:00
Dimitry Ivanov
95ac6dbbb2 Merge "Ensure that readlink has access to /proc/self/fd" into mnc-dr-dev 2015-10-15 01:17:55 +00:00
Christopher Ferris
3c30a15652 Merge "Sync with upstream NetBSD lib/libc/regex." into mnc-dr-dev 2015-10-15 01:15:22 +00:00
Josh Gao
b16f1b4b89 am 559d9cf5: am c433a36f: Merge "Move malloc dispatch table to __libc_globals."
* commit '559d9cf5fa6d5339d1578530a73ecb81a91c27d9':
  Move malloc dispatch table to __libc_globals.
2015-10-14 23:54:59 +00:00
Josh Gao
559d9cf5fa am c433a36f: Merge "Move malloc dispatch table to __libc_globals."
* commit 'c433a36fb5fb8a1050e8ecbd94d215123b829e07':
  Move malloc dispatch table to __libc_globals.
2015-10-14 23:50:51 +00:00
Josh Gao
c433a36fb5 Merge "Move malloc dispatch table to __libc_globals." 2015-10-14 23:47:41 +00:00
Elliott Hughes
9a9572d577 Sync with upstream NetBSD lib/libc/regex.
Bug: http://b/22850181

(cherry picked from commit 71927a82379f7a72559ea96e6678d6215090937f)

Change-Id: I4a914f0594a66f38efb3026b7ba9d28a4887cb2d
2015-10-14 16:30:08 -07:00
Dmitriy Ivanov
cf92738fa5 Ensure that readlink has access to /proc/self/fd
/proc/self/fd is not available when PR_DUMPABLE is set to 0
which is default for the user builds. It leads to permission
denials on readlink.

This change fixes the problem by setting PR_DUMPABLE flag to 1
for readlink and restoring it's previous value after the call.

Bug: http://b/24912743
Change-Id: I3fd179c5c6b56af96d6a15ee597024ccb15e1a13
2015-10-14 11:15:45 -07:00
Neil Fuller
cd9278798a Update timezone data to 2015g
Changes affecting future time stamps

    Turkey's 2015 fall-back transition is scheduled for Nov. 8, not Oct. 25.
    (Thanks to Fatih.)

    Norfolk moves from +1130 to +1100 on 2015-10-04 at 02:00 local time.
    (Thanks to Alexander Krivenyshev.)

    Fiji's 2016 fall-back transition is scheduled for January 17, not 24.
    (Thanks to Ken Rylander.)

    Fort Nelson, British Columbia will not fall back on 2015-11-01. It has
    effectively been on MST (-0700) since it advanced its clocks on 2015-03-08.
    New zone America/Fort_Nelson.  (Thanks to Matt Johnson.)

  Changes affecting past time stamps

    Norfolk observed DST from 1974-10-27 02:00 to 1975-03-02 02:00.

Bug: 24595281
(cherry-picked from commit 31740bfdb942399235e42ea920b6b717dfa0279c)

Change-Id: I6a57fbdaf12a4b4ebf2a760fd3bd872055621106
2015-10-14 08:54:17 +00:00
Josh Gao
87bb58064d am 36ebee4f: am 198d13e8: Merge "make mmap fail on requests larger than PTRDIFF_MAX"
* commit '36ebee4f495b0c49ed686221dfe127f4ccd12b52':
  make mmap fail on requests larger than PTRDIFF_MAX
2015-10-14 02:27:42 +00:00
Josh Gao
36ebee4f49 am 198d13e8: Merge "make mmap fail on requests larger than PTRDIFF_MAX"
* commit '198d13e8c25e69f7dbda3f5e1a3258b13fe8db5d':
  make mmap fail on requests larger than PTRDIFF_MAX
2015-10-14 02:21:04 +00:00
Josh Gao
198d13e8c2 Merge "make mmap fail on requests larger than PTRDIFF_MAX" 2015-10-14 02:17:10 +00:00
Dimitry Ivanov
b8ab96910f am 090278d6: am 11c2179d: Merge "Log dlopen failures caused by text relocations"
* commit '090278d6c6e3501836c70ce555996511b96a38d9':
  Log dlopen failures caused by text relocations
2015-10-13 23:01:36 +00:00
Dimitry Ivanov
090278d6c6 am 11c2179d: Merge "Log dlopen failures caused by text relocations"
* commit '11c2179d468bba3336c3a3e8418ddaa98f58afce':
  Log dlopen failures caused by text relocations
2015-10-13 22:53:03 +00:00
Dimitry Ivanov
11c2179d46 Merge "Log dlopen failures caused by text relocations" 2015-10-13 22:50:05 +00:00
Dmitriy Ivanov
fae39d2bf9 Log dlopen failures caused by text relocations
Some apps will fail to load native libraries with
text relocations when switching target sdk version to M.
It could be hard to diagnose because some of them
suppress dlerror and/or UnsatisfiedLinkError.

This change unconditionally logs the error message making
the cause of the failure more visible to developers.

Bug: http://b/24876001
Change-Id: I0477a0d1307d0879000f3a3a43b974b4cf34bdb2
(cherry picked from commit f32b689d3dbe7a1317bce58d1d9bef9bba173c66)
2015-10-13 15:48:57 -07:00
Dmitriy Ivanov
1002265d0a resolved conflicts for f32b689d to mnc-dr-dev-plus-aosp
Change-Id: I95f90eb68dcb4b3f4b3d80260b2285c78692b535
2015-10-13 14:59:20 -07:00
Dimitry Ivanov
7197c2909d am 5db60c04: am 30cd7065: Merge "Correctly resolve realpath for absolute paths"
* commit '5db60c04c68ed5f0d9ef9bc0e8c2a84062287b8d':
  Correctly resolve realpath for absolute paths
2015-10-13 20:51:11 +00:00
Dimitry Ivanov
5db60c04c6 am 30cd7065: Merge "Correctly resolve realpath for absolute paths"
* commit '30cd7065b6cd37342e23904cb512c409b8bbd4f1':
  Correctly resolve realpath for absolute paths
2015-10-13 20:43:36 +00:00
Dimitry Ivanov
30cd7065b6 Merge "Correctly resolve realpath for absolute paths" 2015-10-13 20:37:55 +00:00
Dmitriy Ivanov
5dce8948b6 Replace auto -> const auto&/auto&&
Change-Id: Ie484e5a296b5dd222a9545d8539d40d97a6c158c
2015-10-13 12:14:16 -07:00
Dmitriy Ivanov
f32b689d3d Log dlopen failures caused by text relocations
Some apps will fail to load native libraries with
text relocations when switching target sdk version to M.
It could be hard to diagnose because some of them
suppress dlerror and/or UnsatisfiedLinkError.

This change unconditionally logs the error message making
the cause of the failure more visible to developers.

Bug: http://b/24876001
Change-Id: I0477a0d1307d0879000f3a3a43b974b4cf34bdb2
2015-10-13 11:13:19 -07:00
Lazar Trsic
6f2d3104c8 Correctly resolve realpath for absolute paths
Introduced by: https://android-review.googlesource.com/174475

Change-Id: I44e00040b28be167d5141454f919340afec6084e
2015-10-13 10:57:41 -07:00
Neil Fuller
1cdd99bcb9 am 12b4f21e: am fb7f45b6: Merge "Update timezone data to 2015g"
* commit '12b4f21e1969b0eceeedb52b2ff0f77a1f791908':
  Update timezone data to 2015g
2015-10-13 09:24:08 +00:00
Neil Fuller
12b4f21e19 am fb7f45b6: Merge "Update timezone data to 2015g"
* commit 'fb7f45b6a3242c9a9a547705de08cf59e6b7f935':
  Update timezone data to 2015g
2015-10-13 09:14:17 +00:00
Neil Fuller
fb7f45b6a3 Merge "Update timezone data to 2015g" 2015-10-13 08:26:44 +00:00
Dimitry Ivanov
433cdaa85f am 5a805d91: am a5ad727e: Merge "linker: Switch to clang"
* commit '5a805d919c0a531c0e8bbae746d192db218d625d':
  linker: Switch to clang
2015-10-13 01:46:10 +00:00
Dimitry Ivanov
5a805d919c am a5ad727e: Merge "linker: Switch to clang"
* commit 'a5ad727e7619f4497792d67ae05b8ef15315b362':
  linker: Switch to clang
2015-10-13 01:40:49 +00:00
Dimitry Ivanov
a5ad727e76 Merge "linker: Switch to clang" 2015-10-13 01:34:59 +00:00
Dmitriy Ivanov
b28ffc7744 linker: Switch to clang
x86_64 gcc exports malloc/free and co functions because they
are defined with visibility "default" somewhere in gcc builtins;
and vector d-tors for some reason. Switching to clang fixes
this problem.

Bug: http://b/24785482
Change-Id: I741503b4b446523e7ff3fb16de13ed99991fd0c0
2015-10-12 18:20:26 -07:00
Josh Gao
3c8fc2fea9 Move malloc dispatch table to __libc_globals.
Change-Id: Ic20b980d1e8b6c2d4b773ebe336658fd17c737cb
2015-10-12 17:54:58 -07:00
Elliott Hughes
fb8fd5076e Opt Brillo out of the ndk cruft.
Bug: http://b/24812426
Change-Id: I6a858d8ceebce9e2285e5b12de9fd89d2b42b352
2015-10-12 17:53:48 -07:00
Dmitriy Ivanov
78f1871f4e resolved conflicts for a828a2f8 to mnc-dr-dev-plus-aosp
Change-Id: Ibe8c145eaadcd1fa9229d8a6eda1e33c0e59fb12
2015-10-12 15:02:28 -07:00
Elliott Hughes
452ab8f7e3 am 25cba7df: Merge "Make struct FILE opaque."
* commit '25cba7df5120a32b144769843781442031fc597b':
  Make struct FILE opaque.
2015-10-12 20:40:41 +00:00
Elliott Hughes
25cba7df51 Merge "Make struct FILE opaque." 2015-10-12 20:33:04 +00:00
Elliott Hughes
f0141dfab1 Make struct FILE opaque.
Bug: http://b/24807045
Change-Id: I3cb4e436325a65bef3b203e3970e4d967101fcce
2015-10-12 12:53:42 -07:00
Elliott Hughes
7c585f2b01 am e7839263: Merge "Fix stdio read after EOF behavior."
* commit 'e78392637d5086384a5631ddfdfa8d7ec8326ee3':
  Fix stdio read after EOF behavior.
2015-10-12 15:23:48 +00:00
Elliott Hughes
e78392637d Merge "Fix stdio read after EOF behavior." 2015-10-12 15:20:29 +00:00
Elliott Hughes
8ab433df13 Fix stdio read after EOF behavior.
Bug: https://code.google.com/p/android/issues/detail?id=184847
Change-Id: Ia20ce94007c2a09649f0763b1dc7ba959f2f618d
2015-10-09 17:57:26 -07:00
Elliott Hughes
d8c03b774e am 1ab3f303: Merge "Fix inet_aton on LP32."
* commit '1ab3f303d2e7c8cc498a28fc3c8d9ded1fc46994':
  Fix inet_aton on LP32.
2015-10-10 00:44:51 +00:00
Elliott Hughes
1ab3f303d2 Merge "Fix inet_aton on LP32." 2015-10-10 00:39:11 +00:00
Elliott Hughes
7b77cb35af Fix inet_aton on LP32.
I wasn't checking for overflow. Luckily, I had a test that overflows on LP32.

Change-Id: If2cf33d88f459eb26d0ce75f3c5ed192f516ab7a
2015-10-09 17:36:05 -07:00
Mike Frysinger
132b9c90fc am c6f704bf: Merge "utmp.h: add more ut_type defines"
* commit 'c6f704bf77576b2cf27decd8ee50c99aeeb9e209':
  utmp.h: add more ut_type defines
2015-10-09 23:37:18 +00:00
Mike Frysinger
c6f704bf77 Merge "utmp.h: add more ut_type defines" 2015-10-09 23:33:37 +00:00
Josh Gao
ac47790ad8 am 902ab885: Merge "Move setjmp cookie to a shared globals struct."
* commit '902ab8859f360d81d6bd03a76a77900743018a15':
  Move setjmp cookie to a shared globals struct.
2015-10-09 23:33:32 +00:00
Josh Gao
dc9ff1b80b am 73a91218: Merge "Move VDSO pointers to a shared globals struct."
* commit '73a91218d1f0b334b97648461b19eed96e6c4336':
  Move VDSO pointers to a shared globals struct.
2015-10-09 23:33:30 +00:00
Josh Gao
902ab8859f Merge "Move setjmp cookie to a shared globals struct." 2015-10-09 23:27:07 +00:00
Josh Gao
73a91218d1 Merge "Move VDSO pointers to a shared globals struct." 2015-10-09 23:26:53 +00:00
Josh Gao
fe9d0ed6cb Move setjmp cookie to a shared globals struct.
Change-Id: I59a4c187d61524c4e48655c4c6376dba0d41eee2
2015-10-09 15:59:04 -07:00
Josh Gao
93c0f5ee00 Move VDSO pointers to a shared globals struct.
Change-Id: I01cbc9cf0917dc1fac52d9205bda2c68529d12ef
2015-10-09 15:59:04 -07:00
Elliott Hughes
8733118fa5 am 487a1823: Merge "Fix inet_addr/inet_aton/inet_network."
* commit '487a1823e8617011009eded8eae9a75c1f871887':
  Fix inet_addr/inet_aton/inet_network.
2015-10-09 22:53:45 +00:00
Mike Frysinger
68af0adeb9 utmp.h: add more ut_type defines
This fills out the defines that utmp.h normally offers on other systems
such as glibc.

BUG=24810744

Change-Id: If57f9ced22e8673f072245fce3f5c0f8e1f591e5
2015-10-09 18:52:49 -04:00
Elliott Hughes
487a1823e8 Merge "Fix inet_addr/inet_aton/inet_network." 2015-10-09 22:48:13 +00:00
Elliott Hughes
047866672c Fix inet_addr/inet_aton/inet_network.
Rewrite inet_addr and inet_network in terms of inet_aton, and reimplement
that to include all the missing error checks.

Bug: http://b/24754503
Change-Id: I5dfa971c87201968985a0894df419f0fbf54768a
2015-10-09 15:44:24 -07:00
Elliott Hughes
c1d7d92201 am f41fe717: Merge "Sync with upstream tzcode (2015g)."
* commit 'f41fe717655f01affc1d8244ff9efccc04d86620':
  Sync with upstream tzcode (2015g).
2015-10-09 22:42:25 +00:00
Elliott Hughes
f41fe71765 Merge "Sync with upstream tzcode (2015g)." 2015-10-09 22:35:24 +00:00
Elliott Hughes
9fb22a3ec4 Sync with upstream tzcode (2015g).
This is quite a large patch because we haven't updated for some time,
but the good news is that upstream is now thread-safe so a lot of our
changes go away in this update and the remaining diff is a lot smaller.

(Note that our whitespace still doesn't match upstream. I use diff -wub
to compare. Upstream doesn't even really have a consistent style. New
code seems to be two spaces, old code tabs.)

From the intervening changelogs (eliding the changes that only affected
the tools, which we don't use):

2014a:
     An uninitialized-storage bug in 'localtime' has been fixed.
     (Thanks to Logan Chien.)

2014b:
     'zic' and 'localtime' no longer reject locations needing four
     transitions per year for the forseeable future.  (Thanks to Andrew
     Main (Zefram).)

2014c:
     <None>

2014d:
     <None>

2014e:
     <None>

2014f:
     'localtime', 'mktime', etc. now use much less stack space if
     ALL_STATE is defined.  (Thanks to Elliott Hughes for reporting the
     problem.)

     Some lint has been removed when using GCC_DEBUG_FLAGS with GCC
     4.9.0.

2014g:
     Unless NETBSD_INSPIRED is defined to 0, the tz library now
     supplies functions for creating and using objects that represent
     time zones. The new functions are tzalloc, tzfree, localtime_rz,
     mktime_z, and (if STD_INSPIRED is also defined) posix2time_z and
     time2posix_z.  They are intended for performance: for example,
     localtime_rz (unlike localtime_r) is trivially thread-safe without
     locking.  (Thanks to Christos Zoulas for proposing NetBSD-inspired
     functions, and to Alan Barrett and Jonathan Lennox for helping to
     debug the change.)

     If THREAD_SAFE is defined to 1, the tz library is now thread-safe.
     Although not needed for tz's own applications, which are single-threaded,
     this supports POSIX better if the tz library is used in multithreaded apps.

     Some crashes have been fixed when zdump or the tz library is given
     invalid or outlandish input.

     The tz library no longer mishandles leap seconds on platforms with
     unsigned time_t in time zones that lack ordinary transitions after 1970.

     The tz code now attempts to infer TM_GMTOFF and TM_ZONE if not
     already defined, to make it easier to configure on common platforms.
     Define NO_TM_GMTOFF and NO_TM_ZONE to suppress this.

     Unless the new macro UNINIT_TRAP is defined to 1, the tz code now
     assumes that reading uninitialized memory yields garbage values
     but does not cause other problems such as traps.

     If TM_GMTOFF is defined and UNINIT_TRAP is 0, mktime is now
     more likely to guess right for ambiguous time stamps near
     transitions where tm_isdst does not change.

     If HAVE_STRFTIME_L is defined to 1, the tz library now defines
     strftime_l for compatibility with recent versions of POSIX.
     Only the C locale is supported, though.  HAVE_STRFTIME_L defaults
     to 1 on recent POSIX versions, and to 0 otherwise.

     tzselect -c now uses a hybrid distance measure that works better
     in Africa.  (Thanks to Alan Barrett for noting the problem.)

     The C source code now ports to NetBSD when GCC_DEBUG_FLAGS is used,
     or when time_tz is defined.

     When HAVE_UTMPX_H is set the 'date' command now builds on systems
     whose <utmpx.h> file does not define WTMPX_FILE, and when setting
     the date it updates the wtmpx file if _PATH_WTMPX is defined.
     This affects GNU/Linux and similar systems.

     For easier maintenance later, some C code has been simplified,
     some lint has been removed, and the code has been tweaked so that
     plain 'make' is more likely to work.

     The C type 'bool' is now used for boolean values, instead of 'int'.

     The long-obsolete LOCALE_HOME code has been removed.

     The long-obsolete 'gtime' function has been removed.

2014h:
     The tz library's localtime and mktime functions now set tzname to a value
     appropriate for the requested time stamp, and zdump now uses this
     on platforms not defining TM_ZONE, fixing a 2014g regression.
     (Thanks to Tim Parenti for reporting the problem.)

     The tz library no longer sets tzname if localtime or mktime fails.

     An access to uninitalized data has been fixed.
     (Thanks to Jörg Richter for reporting the problem.)

     When THREAD_SAFE is defined, the code ports to the C11 memory model.
     A memory leak has been fixed if ALL_STATE and THREAD_SAFE are defined
     and two threads race to initialize data used by gmtime-like functions.
     (Thanks to Andy Heninger for reporting the problems.)

2014i:
     The time-related library functions now set errno on failure,
     and some crashes in the new tzalloc-related library functions
     have been fixed.  (Thanks to Christos Zoulas for reporting
     most of these problems and for suggesting fixes.)

     If USG_COMPAT is defined and the requested time stamp is
     standard time, the tz library's localtime and mktime functions
     now set the extern variable timezone to a value appropriate
     for that time stamp; and similarly for ALTZONE, daylight
     saving time, and the altzone variable.  This change is a
     companion to the tzname change in 2014h, and is designed to
     make timezone and altzone more compatible with tzname.

     The tz library's functions now set errno to EOVERFLOW if they
     fail because the result cannot be represented.  ctime and
     ctime_r now return NULL and set errno when a time stamp is out
     of range, rather than having undefined behavior.

     Some bugs associated with the new 2014g functions have been
     fixed.  This includes a bug that largely incapacitated the new
     functions time2posix_z and posix2time_z.  (Thanks to Christos
     Zoulas.)  It also includes some uses of uninitialized
     variables after tzalloc.  The new code uses the standard type
     'ssize_t', which the Makefile now gives porting advice about.

2014j:
     <None>

2015a:
     tzalloc now scrubs time zone abbreviations compatibly with the way
     that tzset always has, by replacing invalid bytes with '_' and by
     shortening too-long abbreviations.

2015b:
     Fix integer overflow bug in reference 'mktime' implementation.
     (Problem reported by Jörg Richter.)

     Allow -Dtime_tz=time_t compilations, and allow -Dtime_tz=... libraries
     to be used in the same executable as standard-library time_t functions.
     (Problems reported by Bradley White.)

2015c:
     <None>

2015d:
     <None>

2015e:
     <None>

2015f:
     <None>

2015g:
    localtime no longer mishandles America/Anchorage after 2037.
    (Thanks to Bradley White for reporting the bug.)

    On hosts with signed 32-bit time_t, localtime no longer mishandles
    Pacific/Fiji after 2038-01-16 14:00 UTC.

    The localtime module allows the variables 'timezone', 'daylight',
    and 'altzone' to be in common storage shared with other modules,
    and declares them in case the system <time.h> does not.
    (Problems reported by Kees Dekker.)

    On platforms with tm_zone, strftime.c now assumes it is not NULL.
    This simplifies the code and is consistent with zdump.c.
    (Problem reported by Christos Zoulas.)

Change-Id: I9eb0a8323cb8bd9968fcfe612dc14f45aa3b59d2
2015-10-09 15:15:39 -07:00
Dimitry Ivanov
533d7e403d am 6a59289b: Merge "Remove textrels support for platform libs"
* commit '6a59289b06deafe5eed49d86753297c604eadc86':
  Remove textrels support for platform libs
2015-10-09 21:14:26 +00:00
Dimitry Ivanov
6a59289b06 Merge "Remove textrels support for platform libs" 2015-10-09 21:09:46 +00:00
Dmitriy Ivanov
8068786ae6 Remove textrels support for platform libs
Bug: http://b/20013628
Change-Id: Ia9382c7113e09bb6aed65072543e4ebe33026cf8
2015-10-09 13:59:42 -07:00
Josh Gao
786807b26c am d8df28ff: Merge "Implement setjmp cookies on MIPS and MIPS64"
* commit 'd8df28ff3833e620db1b61dd4038028dd160c870':
  Implement setjmp cookies on MIPS and MIPS64
2015-10-09 18:39:57 +00:00
Josh Gao
d8df28ff38 Merge "Implement setjmp cookies on MIPS and MIPS64" 2015-10-09 18:32:20 +00:00
Neil Fuller
31740bfdb9 Update timezone data to 2015g
Changes affecting future time stamps

    Turkey's 2015 fall-back transition is scheduled for Nov. 8, not Oct. 25.
    (Thanks to Fatih.)

    Norfolk moves from +1130 to +1100 on 2015-10-04 at 02:00 local time.
    (Thanks to Alexander Krivenyshev.)

    Fiji's 2016 fall-back transition is scheduled for January 17, not 24.
    (Thanks to Ken Rylander.)

    Fort Nelson, British Columbia will not fall back on 2015-11-01. It has
    effectively been on MST (-0700) since it advanced its clocks on 2015-03-08.
    New zone America/Fort_Nelson.  (Thanks to Matt Johnson.)

  Changes affecting past time stamps

    Norfolk observed DST from 1974-10-27 02:00 to 1975-03-02 02:00.

Bug: 24595281
Change-Id: I7e4e4c53b4843110540f573ba82d3761c871c096
2015-10-09 17:58:58 +01:00
Nikola Veljkovic
1b519c0ae4 Implement setjmp cookies on MIPS and MIPS64
Bug: http://b/23942752
Change-Id: Ie58892a97b5075d30d7607667251007cda99d38c
2015-10-09 13:42:58 +02:00
Dan Albert
17e3aec523 am 599af934: Merge "Fix bionic_coverage for kati."
* commit '599af9346e3ea697dda1b0c38a99cce842154307':
  Fix bionic_coverage for kati.
2015-10-08 22:08:28 +00:00
Dimitry Ivanov
ec48a72a00 am 268f7391: Merge "Make dt_runpath work for libraries opened from apk"
* commit '268f73917831e709bc6a201658c19ffb5c8cbfd1':
  Make dt_runpath work for libraries opened from apk
2015-10-08 22:08:17 +00:00
Dan Albert
599af9346e Merge "Fix bionic_coverage for kati." 2015-10-08 21:35:12 +00:00
Dan Albert
697e261d4b Fix bionic_coverage for kati.
Kati won't override something set with :=, only ?=.

Note that the actually reveals that our coverage build has been broken
for... some time. The issue is that we have static libraries built
with clang and others built with gcc linked into the same .so. If we
use both libclang_rt.profile and libgcov together, we get duplicate
symbol errors. If we only use one or the other, we don't have all the
symbols we need.

This will be fixed once chh's TLS stuff makes it into our clang and we
can start building libc_thread_atexit_impl with clang.

Change-Id: I45d0f2e558a881ad8be71088102320724ced8fe5
2015-10-08 14:04:53 -07:00
Dimitry Ivanov
268f739178 Merge "Make dt_runpath work for libraries opened from apk" 2015-10-08 19:45:45 +00:00
Torne (Richard Coles)
a828a2f8e6 linker: don't pass dlextinfo to dependent loads.
Don't pass the parent load's dlextinfo to dependent loads, since this
causes the linker to try to load the dependencies using the same
addresses/relro/fds/etc as the main library, which is never going to
work. This was how it worked before ae69a95 which broke this.

Bug: 23742664
Change-Id: I53d8cdf0982d8758e6d2ced4864c704cdf74118f
2015-10-08 12:28:39 -07:00
Josh Gao
10f71abc4e am cc56abbb: Merge "Add missing register preserve in x86/x86_64 longjmp."
* commit 'cc56abbb007e090b830f510df6cb300ae12e1a89':
  Add missing register preserve in x86/x86_64 longjmp.
2015-10-07 21:32:47 +00:00
Josh Gao
cc56abbb00 Merge "Add missing register preserve in x86/x86_64 longjmp." 2015-10-07 21:17:47 +00:00
Josh Gao
8dbf02d76a Add missing register preserve in x86/x86_64 longjmp.
Change-Id: I3fc442f819229640e9c0ec4f9c865d9bf0e70881
2015-10-07 14:01:45 -07:00
Dmitriy Ivanov
a1feb117e4 Make dt_runpath work for libraries opened from apk
This patch also fixes realpath for libraries opened directly
from apks.

Bug: http://b/21960914
Bug: http://b/21961857
Change-Id: I35ade661c87f1d448191f385811f6e9fd3cacf11
2015-10-07 11:44:53 -07:00
Yabin Cui
b5e05d29b5 am f9604906: Merge "Remove the workaround which fixes JOB_COUNT in CTS test."
* commit 'f96049062f04a922fda937aecc562517101a38cc':
  Remove the workaround which fixes JOB_COUNT in CTS test.
2015-10-07 17:20:29 +00:00
Yabin Cui
f96049062f Merge "Remove the workaround which fixes JOB_COUNT in CTS test." 2015-10-07 17:05:29 +00:00
Yabin Cui
bc6379d7da Remove the workaround which fixes JOB_COUNT in CTS test.
Bug: 24376925
Change-Id: Ib195ce1577ee9412068cc1b6223fc051b5bcfcaa
2015-10-06 16:30:14 -07:00
Dimitry Ivanov
29fe356575 am 98be6be1: am 748421be: Merge "Fix linker tests"
* commit '98be6be171b3792c51d83d19f015052112f8ddbf':
  Fix linker tests
2015-10-05 20:24:37 +00:00
Dimitry Ivanov
98be6be171 am 748421be: Merge "Fix linker tests"
* commit '748421beef0ed8625920a27b3753a79c2652b6ef':
  Fix linker tests
2015-10-05 20:17:39 +00:00
Dimitry Ivanov
748421beef Merge "Fix linker tests" 2015-10-05 20:10:26 +00:00
Dmitriy Ivanov
a0f187bec7 Fix linker tests
Change-Id: I4794f2d9dcc5ceb419e1bf9151607a650eb801d9
2015-10-05 12:06:40 -07:00
Elliott Hughes
8daf53db75 am df62e317: am 5c50449b: Merge "Use const auto& in for loops."
* commit 'df62e3171ca52cbdadb3c3edc93c42cfacbad054':
  Use const auto& in for loops.
2015-10-03 16:35:32 +00:00
Elliott Hughes
df62e3171c am 5c50449b: Merge "Use const auto& in for loops."
* commit '5c50449b0c098cb8191fe3f7791e91a7ec4f7029':
  Use const auto& in for loops.
2015-10-03 16:29:55 +00:00
Elliott Hughes
5c50449b0c Merge "Use const auto& in for loops." 2015-10-03 16:23:19 +00:00
Elliott Hughes
0b2acdfcc9 Use const auto& in for loops.
Change-Id: Ic437c59797ee4e7dc38291da35c72d827bc89c8d
2015-10-02 18:25:19 -07:00
Mark Salyzyn
991a8a6bf7 am ee9dea83: am f7cf8b2c: Merge "bionic: tzset running hot"
* commit 'ee9dea83fbaf2261066fbb20e5942c147018c949':
  bionic: tzset running hot
2015-10-02 21:17:39 +00:00
Mark Salyzyn
ee9dea83fb am f7cf8b2c: Merge "bionic: tzset running hot"
* commit 'f7cf8b2c1fbf6250e12d1e59aa353990eca4f109':
  bionic: tzset running hot
2015-10-02 21:10:18 +00:00
Mark Salyzyn
f7cf8b2c1f Merge "bionic: tzset running hot" 2015-10-02 21:04:50 +00:00
Mark Salyzyn
d0578949ac bionic: tzset running hot
logd makes a non-insignificant number of calls to localtime, 3% of
the time in logd is spent performing __system_property_get within the
context of tzset_locked().

Bug: 23685592
Change-Id: I75f8c2d436b60374e92c166b87393abda9487af7
2015-10-02 13:30:34 -07:00
Josh Gao
e22d32d06c am a7d5919c: am cf92ebcf: Merge "Use foreach loop to match setuid unsafe env vars."
* commit 'a7d5919cc92db395a943d8f5094e47d50148c39c':
  Use foreach loop to match setuid unsafe env vars.
2015-10-02 18:41:55 +00:00
Josh Gao
a7d5919cc9 am cf92ebcf: Merge "Use foreach loop to match setuid unsafe env vars."
* commit 'cf92ebcfe323ee2ea58168ed008d2a08565809ce':
  Use foreach loop to match setuid unsafe env vars.
2015-10-02 18:37:22 +00:00
Josh Gao
cf92ebcfe3 Merge "Use foreach loop to match setuid unsafe env vars." 2015-10-02 18:32:44 +00:00
Josh Gao
a5d5d16c3c Use foreach loop to match setuid unsafe env vars.
Change-Id: I1e94daefac8e601281f38c7ce29ba3172a4a60bb
2015-10-02 11:31:09 -07:00
Dimitry Ivanov
a978ec9e7b am 27f2e04c: am 143409d7: Merge "Fix the comment"
* commit '27f2e04c8c31cb4fbcc842ff457a1a4e53b61f4d':
  Fix the comment
2015-10-01 22:59:58 +00:00
Dimitry Ivanov
27f2e04c8c am 143409d7: Merge "Fix the comment"
* commit '143409d75b093c89042e25cab1757d6b2bae8ec5':
  Fix the comment
2015-10-01 22:11:31 +00:00
Dimitry Ivanov
143409d75b Merge "Fix the comment" 2015-10-01 21:18:36 +00:00
Dmitriy Ivanov
7e039937b8 Fix the comment
Change-Id: Ic8126cf92d12851cccaa3e2e781f075c9f6c283a
2015-10-01 14:02:19 -07:00
Stephen Hines
03d14f9276 am 14b7c94f: am 4a65557d: Merge "Remove invalid left shifts of -1."
* commit '14b7c94f40c845715561d1f4031f650a03df0336':
  Remove invalid left shifts of -1.
2015-10-01 05:42:13 +00:00
Stephen Hines
14b7c94f40 am 4a65557d: Merge "Remove invalid left shifts of -1."
* commit '4a65557d0ebd167e557958687f50510742cb238a':
  Remove invalid left shifts of -1.
2015-10-01 05:33:49 +00:00
Stephen Hines
4a65557d0e Merge "Remove invalid left shifts of -1." 2015-10-01 05:23:14 +00:00
Christopher Ferris
240a0a9068 am dc813fe3: am ad157a3c: Merge "Add a no dwarf version of assembler macros."
* commit 'dc813fe338626b28a8e9066c81fac6dac0982af5':
  Add a no dwarf version of assembler macros.
2015-09-30 23:59:48 +00:00
Christopher Ferris
b33e6097fe am 8bb2141b: am 3230d96a: Merge "libc: krait: Use performance version of memcpy"
* commit '8bb2141b7707b593245b77e3c73c26b7bb6f29fd':
  libc: krait: Use performance version of memcpy
2015-09-30 23:59:47 +00:00
Christopher Ferris
dc813fe338 am ad157a3c: Merge "Add a no dwarf version of assembler macros."
* commit 'ad157a3c3353ba69d3bd155a7c09f9943a22f8d2':
  Add a no dwarf version of assembler macros.
2015-09-30 23:44:34 +00:00
Christopher Ferris
8bb2141b77 am 3230d96a: Merge "libc: krait: Use performance version of memcpy"
* commit '3230d96a10ab0cfa128487ef03fa5f08c77ebf20':
  libc: krait: Use performance version of memcpy
2015-09-30 23:44:12 +00:00
Christopher Ferris
ad157a3c33 Merge "Add a no dwarf version of assembler macros." 2015-09-30 23:18:32 +00:00
Christopher Ferris
3230d96a10 Merge "libc: krait: Use performance version of memcpy" 2015-09-30 22:54:09 +00:00
Christopher Ferris
8f8308c974 Add a no dwarf version of assembler macros.
For the __release and __release_rt functions, the previous macros
would add a dwarf cfi entry for the function with no values. This works
with libunwind since it always tries the arm unwind information first.

This change removes those entries by creating a no dwarf version of the
assembler macro.

Change-Id: Ib93e42fff5a79b8d770eab0071fdee7d2afa988d
2015-09-30 15:32:15 -07:00
Brent DeGraaf
1d0268c6b8 libc: krait: Use performance version of memcpy
Change-Id: Iaa52635240da8b8746693186b66b69778e833c32
2015-09-30 20:59:36 +00:00
Dimitry Ivanov
84b24d62d0 am 889dd564: am a0b9cad0: Merge "Optimize dlopen from a zip file"
* commit '889dd56428fdecedb55e11b990609993294561ff':
  Optimize dlopen from a zip file
2015-09-30 20:16:52 +00:00
Dimitry Ivanov
889dd56428 am a0b9cad0: Merge "Optimize dlopen from a zip file"
* commit 'a0b9cad07629439bab926373515d964253426a69':
  Optimize dlopen from a zip file
2015-09-30 20:10:49 +00:00
Dimitry Ivanov
a0b9cad076 Merge "Optimize dlopen from a zip file" 2015-09-30 19:11:30 +00:00
Dmitriy Ivanov
b48275045d Optimize dlopen from a zip file
This change makes dynamic linker reuse ZipArchiveHandles in
ld_library_path on dlopen to optimize the lookup of dt_needed
libraries.

Bug: http://b/21960534
Change-Id: I65f897910d46dd2ffabdcb0b7842db2f127eee30
2015-09-30 10:47:11 -07:00
Yabin Cui
8db320637c am 8cd11809: am c1eebd5f: Merge "Fix the way to count online cpus."
* commit '8cd1180904a0b8713c20feed5255bbedcfabe4e9':
  Fix the way to count online cpus.
2015-09-30 01:33:22 +00:00
Yabin Cui
8cd1180904 am c1eebd5f: Merge "Fix the way to count online cpus."
* commit 'c1eebd5ff42cdf8f8a08be76bfdeaad6a327976c':
  Fix the way to count online cpus.
2015-09-30 01:23:33 +00:00
Yabin Cui
c1eebd5ff4 Merge "Fix the way to count online cpus." 2015-09-30 01:17:32 +00:00
Yabin Cui
cb6f599c44 Fix the way to count online cpus.
Read /proc/stat to count online cpus is not correct for all android
kernels. Change to reading /sys/devices/system/cpu/online instead.

Bug: 24376925
Change-Id: I3785a6c7aa15a467022a9a261b457194d688fb38
2015-09-29 17:49:37 -07:00
Stephen Hines
23360cc498 Remove invalid left shifts of -1.
Bug: 24492248

Shifting sign bits left is considered undefined behavior, so we need to
switch these uses to unsigned equivalents. The time_t-related code is
updated relative to upstream sources.

Change-Id: I226e5a929a10f5c57dfcb90c748fdac34eb377c2
2015-09-29 10:04:54 -07:00
Christopher Ferris
86fdb6bf23 am 4f3e3591: am 93a91f0c: Force cts to only run one test at a time.
* commit '4f3e3591ace36b6d86e3a1bc8b3f438989cb0618':
  Force cts to only run one test at a time.
2015-09-29 15:26:43 +00:00
Christopher Ferris
4f3e3591ac am 93a91f0c: Force cts to only run one test at a time.
* commit '93a91f0cf4f015762ac1ed57395c4c0de8ba7db3':
  Force cts to only run one test at a time.
2015-09-29 15:11:45 +00:00
Colin Cross
6a753ffec6 am 1c34fea8: am 8b279ead: Merge "Pass -q is zip for test"
* commit '1c34fea8033d64b7f2c54366add908aba7fa44dc':
  Pass -q is zip for test
2015-09-28 23:17:43 +00:00
Colin Cross
1c34fea803 am 8b279ead: Merge "Pass -q is zip for test"
* commit '8b279eadd3a635c31df9c570ab2144212bfd07cc':
  Pass -q is zip for test
2015-09-28 23:11:58 +00:00
Colin Cross
8b279eadd3 Merge "Pass -q is zip for test" 2015-09-28 23:07:04 +00:00
Colin Cross
195a5bef1f am 289e58e8: am c80aa3f9: Merge "Turn common INFO messages down to VLOG(1)"
* commit '289e58e83e62b600c2b1764c6f9cfd07f1717bdc':
  Turn common INFO messages down to VLOG(1)
2015-09-28 22:57:48 +00:00
Colin Cross
298d176813 Pass -q is zip for test
Pass -q to zip for dlext_testzip to avoid printing:
  adding: empty_file.txt (stored 0%)
on every compile.

Bug: 24409581
Change-Id: I2320f31182a9a332b3ef8b32a22561092ab5aceb
2015-09-28 15:56:18 -07:00
Colin Cross
289e58e83e am c80aa3f9: Merge "Turn common INFO messages down to VLOG(1)"
* commit 'c80aa3f9e2be9f9390b1e11f8f2b67a2adbd1faa':
  Turn common INFO messages down to VLOG(1)
2015-09-28 22:52:32 +00:00
Colin Cross
c80aa3f9e2 Merge "Turn common INFO messages down to VLOG(1)" 2015-09-28 22:46:11 +00:00
Colin Cross
4032d344d4 Turn common INFO messages down to VLOG(1)
Turn messages that are printed on every run of relocation_packer down to
VLOG(1) to clean up ninja build output.

Bug: 24409581
Change-Id: I040aed6a7b4261eefa6f7278fa451180115b0716
2015-09-28 15:30:37 -07:00
Dan Willemsen
3fb798c8ac am bfd9255d: am f16f4f8a: Merge "Fix file-check-cxx to handle quoted arguments"
* commit 'bfd9255ddba7db2e07de6483bf55f567c7f1f7a3':
  Fix file-check-cxx to handle quoted arguments
2015-09-28 20:48:00 +00:00
Dan Willemsen
bfd9255ddb am f16f4f8a: Merge "Fix file-check-cxx to handle quoted arguments"
* commit 'f16f4f8a6bac035db5f25538ddb4fe810d0719db':
  Fix file-check-cxx to handle quoted arguments
2015-09-28 20:43:06 +00:00
Dan Willemsen
f16f4f8a6b Merge "Fix file-check-cxx to handle quoted arguments" 2015-09-28 20:37:07 +00:00
Dan Willemsen
808602a485 Fix file-check-cxx to handle quoted arguments
If the OVERRIDE_C_DATE_TIME environment variable is set, the build
system will add a macro to the global cflags that contains a static
quoted date, like:

  -D__DATE__="\"Sep 28 2015\""

file-check-cxx needs to properly pass that through as a single, still
quoted argument. So use the quoted "$@" instead of turning each word
into an argument.

Change-Id: I6929d712c280d0452062640e0cba8a176d045c97
2015-09-28 13:14:19 -07:00
Dimitry Ivanov
2027e5e4ca am 97233047: am d5e8a049: Merge "Fix bug number for linker related workarounds"
* commit '972330476c26d5f610026fc006d05b128dc45e56':
  Fix bug number for linker related workarounds
2015-09-28 18:34:00 +00:00
Dimitry Ivanov
972330476c am d5e8a049: Merge "Fix bug number for linker related workarounds"
* commit 'd5e8a0499b9efa147d45aabd47cfb2d2204c2323':
  Fix bug number for linker related workarounds
2015-09-28 18:23:48 +00:00
Dimitry Ivanov
d5e8a0499b Merge "Fix bug number for linker related workarounds" 2015-09-28 17:54:23 +00:00
Dmitriy Ivanov
280d54680d Fix bug number for linker related workarounds
Bug: 24425865
Change-Id: I2021674a9df0e768f312ca024d906302db1c494f
2015-09-28 10:31:12 -07:00
Colin Cross
fd7251acd4 am b99b3f77: am 55f87a0c: Merge "Force non-color output for bionic FileCheck tests"
* commit 'b99b3f773cef7d160481f8c30b41c01839ca7090':
  Force non-color output for bionic FileCheck tests
2015-09-25 22:39:49 +00:00
Colin Cross
b74e9ddda5 am 0f575d44: am 4a54ec82: Merge "Add .PHONY for phony bionic test targets"
* commit '0f575d4482cebbedcc9d44634ba453fa57f21c3f':
  Add .PHONY for phony bionic test targets
2015-09-25 22:39:48 +00:00
Colin Cross
b99b3f773c am 55f87a0c: Merge "Force non-color output for bionic FileCheck tests"
* commit '55f87a0c0bb587ee85b5662967563462d52db560':
  Force non-color output for bionic FileCheck tests
2015-09-25 22:33:53 +00:00
Colin Cross
0f575d4482 am 4a54ec82: Merge "Add .PHONY for phony bionic test targets"
* commit '4a54ec8200356a755aeeb212c4dd9cefad39754c':
  Add .PHONY for phony bionic test targets
2015-09-25 22:33:51 +00:00
Christopher Ferris
93a91f0cf4 Force cts to only run one test at a time.
Also, slightly increase the timeout for each test run.

Bug: 24198050

(cherry picked from commit daaaed18ce1d2f2da9d2240e974922299d937670)

Change-Id: I29e169e962da803a89abf0a28e071abcafa315b7
2015-09-25 15:33:20 -07:00
Colin Cross
55f87a0c0b Merge "Force non-color output for bionic FileCheck tests" 2015-09-25 22:27:16 +00:00
Colin Cross
4a54ec8200 Merge "Add .PHONY for phony bionic test targets" 2015-09-25 22:25:58 +00:00
Christopher Ferris
a64bb4c172 am c1d4ba88: am b48ca46d: Merge "Force cts to only run one test at a time."
* commit 'c1d4ba88cfd824b938feed68a706d2a06e993d3a':
  Force cts to only run one test at a time.
2015-09-25 22:17:12 +00:00
Christopher Ferris
c1d4ba88cf am b48ca46d: Merge "Force cts to only run one test at a time."
* commit 'b48ca46d88d9e664763eff39604f772a57d8e2fb':
  Force cts to only run one test at a time.
2015-09-25 22:11:46 +00:00
Christopher Ferris
b48ca46d88 Merge "Force cts to only run one test at a time." 2015-09-25 21:50:35 +00:00
Colin Cross
840be7cb79 Force non-color output for bionic FileCheck tests
Turning on color output will break the bionic compilation tests that
check for expected warnings, as they will be matching color output
against non-color expected values.  Turn off color locally.

Bug: 24273983
Change-Id: Ia3b3262ccece121217f0dc0997734b3ad65b928b
2015-09-25 14:42:07 -07:00
Colin Cross
b67afb3eb5 Add .PHONY for phony bionic test targets
Bug: 24384320
Change-Id: I41038ff8b34391d03ce1e204e30e5ae34ec56614
2015-09-25 14:36:15 -07:00
Christopher Ferris
aaff959fc0 am 4344a02a: am 931e1399: Merge "Add cortex-a53.a57 target for 32 bit big/little."
* commit '4344a02a9efc93ff4f772f5722f1a455d8ef25cd':
  Add cortex-a53.a57 target for 32 bit big/little.
2015-09-25 16:44:03 +00:00
Christopher Ferris
4344a02a9e am 931e1399: Merge "Add cortex-a53.a57 target for 32 bit big/little."
* commit '931e1399f13b35a139977354e179403184c649fa':
  Add cortex-a53.a57 target for 32 bit big/little.
2015-09-25 16:35:53 +00:00
Christopher Ferris
931e1399f1 Merge "Add cortex-a53.a57 target for 32 bit big/little." 2015-09-25 16:29:33 +00:00
Christopher Ferris
daaaed18ce Force cts to only run one test at a time.
Also, slightly increase the timeout for each test run.

Bug: 24198050
Change-Id: I2b0ebdebb909023d0f179e0a433c564266a99161
2015-09-25 09:16:31 -07:00
Christopher Ferris
774a4703e8 am 6eb06b03: am 70a9f0a3: Merge "Fix over read in strcpy/stpcpy/strcat."
* commit '6eb06b0399c95f52cd28ff7971582ebec42f45f7':
  Fix over read in strcpy/stpcpy/strcat.
2015-09-24 21:48:52 +00:00
Christopher Ferris
6eb06b0399 am 70a9f0a3: Merge "Fix over read in strcpy/stpcpy/strcat."
* commit '70a9f0a3bc310c863b5c90c9860aae842f82e47f':
  Fix over read in strcpy/stpcpy/strcat.
2015-09-24 21:38:47 +00:00
Christopher Ferris
70a9f0a3bc Merge "Fix over read in strcpy/stpcpy/strcat." 2015-09-24 21:26:40 +00:00
Christopher Ferris
fdfcfce7c6 Fix over read in strcpy/stpcpy/strcat.
This bug will happen when these circumstances are met:

- Destination address & 0x7 == 1, strlen of src is 11, 12, 13.
- Destination address & 0x7 == 2, strlen of src is 10, 11, 12.
- Destination address & 0x7 == 3, strlen of src is 9, 10, 11.
- Destination address & 0x7 == 4, strlen of src is 8, 9, 10.

In these cases, the dest alignment code does a ldr which reads 4 bytes,
and it will read past the end of the source. In most cases, this is
probably benign, but if this crosses into a new page it could cause a
crash.

Fix the labels in the cortex-a9 strcat.

Modify the overread test to vary the dst alignment to expost this bug.
Also, shrink the strcat/strlcat overread cases since the dst alignment
variation increases the runtime too much.

Bug: 24345899
Change-Id: Ib34a559bfcebd89861985b29cae6c1e47b5b5855
2015-09-24 14:17:36 -07:00
Christopher Ferris
54ee0407dc Add cortex-a53.a57 target for 32 bit big/little.
The routines optimized for cortex-a7 and cortex-a53 cause performance
drops on cortex-a57. Instead create a target that is the middle ground
that works relatively well on either core.

Change-Id: Ie2b6cc9a59a01c7b30602ee368b2b90f5e886289
2015-09-24 14:00:00 -07:00
Yabin Cui
609716ae95 am 01030c24: Increase alternative signal stack size on 64-bit devices.
* commit '01030c24b0e3ace1b4cdaf415354e2f315f4f3a9':
  Increase alternative signal stack size on 64-bit devices.
2015-09-24 00:21:13 +00:00
Yabin Cui
01030c24b0 Increase alternative signal stack size on 64-bit devices.
Bug: 23041777
Bug: 24187462
Change-Id: I7d84c0cc775a74753a3e8e101169c0fb5dbf7437
2015-09-23 16:36:20 -07:00
Dan Albert
2c60af3e81 am 56446a6c: am c38cee59: Merge "Prevent the build system from hiding our ABI."
* commit '56446a6c8e2fd54f23a348060a2bc121c0846603':
  Prevent the build system from hiding our ABI.
2015-09-23 20:22:04 +00:00
Dan Albert
56446a6c8e am c38cee59: Merge "Prevent the build system from hiding our ABI."
* commit 'c38cee59dcba23576cc01bfbb97cecc5eb01a75c':
  Prevent the build system from hiding our ABI.
2015-09-23 20:15:35 +00:00
Dan Albert
c38cee59dc Merge "Prevent the build system from hiding our ABI." 2015-09-23 20:08:09 +00:00
Elliott Hughes
678752ed2a am 83911975: am cb696c50: Merge "Remove libpagemap include hack."
* commit '839119757d4d841359ad5f16d3bde8e4581f8322':
  Remove libpagemap include hack.
2015-09-23 19:04:18 +00:00
Elliott Hughes
839119757d am cb696c50: Merge "Remove libpagemap include hack."
* commit 'cb696c50c293f387c7de46cd3c8573a335e273bf':
  Remove libpagemap include hack.
2015-09-23 18:56:25 +00:00
Elliott Hughes
cb696c50c2 Merge "Remove libpagemap include hack." 2015-09-23 18:49:22 +00:00
Elliott Hughes
7660a088cd Remove libpagemap include hack.
Change-Id: I4c75ae4e311342c9ab4f317026904f893e931384
2015-09-22 22:40:22 -07:00
Elliott Hughes
fff13b9196 am 12432ca4: am 8d92afe3: Merge "Fix another duplicate maps parser."
* commit '12432ca4839b4df9b040b2bd3b4401a48e1f8a06':
  Fix another duplicate maps parser.
2015-09-23 00:36:13 +00:00
Elliott Hughes
12432ca483 am 8d92afe3: Merge "Fix another duplicate maps parser."
* commit '8d92afe32265be8c36ea2adb3c4059298cd583eb':
  Fix another duplicate maps parser.
2015-09-23 00:26:38 +00:00
Elliott Hughes
8d92afe322 Merge "Fix another duplicate maps parser." 2015-09-23 00:18:50 +00:00
Dan Albert
0aa96aedbe Prevent the build system from hiding our ABI.
Unfortunately --exclude-libs (now passed globally) clobbers our
version script, so we have to prevent the build system from using this
flag.

Bug: http://b/24166967
Change-Id: I33c766d399c418fdc17983c8c0a56608d463201e
2015-09-22 16:49:40 -07:00
Elliott Hughes
15dfd63aba Fix another duplicate maps parser.
Change-Id: Icb69f59ffbd0d5de7f727142260fae152d36a904
2015-09-22 16:40:14 -07:00
Elliott Hughes
afba67bd2f am f599ea97: am 9e3a2491: Merge "Clean up /proc/<pid>/maps sscanfs."
* commit 'f599ea9743098a694262b7ab6c3b3d3f11eeb0dd':
  Clean up /proc/<pid>/maps sscanfs.
2015-09-22 23:05:43 +00:00
Elliott Hughes
f599ea9743 am 9e3a2491: Merge "Clean up /proc/<pid>/maps sscanfs."
* commit '9e3a24915241c07d8ea886533c8de6a85744a734':
  Clean up /proc/<pid>/maps sscanfs.
2015-09-22 22:54:45 +00:00
Elliott Hughes
9e3a249152 Merge "Clean up /proc/<pid>/maps sscanfs." 2015-09-22 22:49:20 +00:00
Elliott Hughes
0dec228921 Clean up /proc/<pid>/maps sscanfs.
sscanf will swallow whitespace for us.

Change-Id: I59931cbad00f0144fd33ed4749ac0aaad15e6de6
2015-09-22 15:45:50 -07:00
Jorge Lucangeli Obes
eb83e971b4 am 9583f7e7: am dd514539: Merge "Add preliminary OEM UID/GID support."
* commit '9583f7e7c2863c63596429ccb23a34fdbf272102':
  Add preliminary OEM UID/GID support.
2015-09-22 22:09:43 +00:00
Elliott Hughes
4e9118c25c am 1085de1c: am efcb5d9d: Merge "Remove some <sys/cdefs.h> cruft."
* commit '1085de1cc5f56bf3538ff75ec93939b8c868eb2a':
  Remove some <sys/cdefs.h> cruft.
2015-09-22 22:09:42 +00:00
Jorge Lucangeli Obes
9583f7e7c2 am dd514539: Merge "Add preliminary OEM UID/GID support."
* commit 'dd51453904f609347ce7951661eff8bc12a1c0a4':
  Add preliminary OEM UID/GID support.
2015-09-22 21:59:02 +00:00
Elliott Hughes
1085de1cc5 am efcb5d9d: Merge "Remove some <sys/cdefs.h> cruft."
* commit 'efcb5d9d4c4b482cf21318b2bb4aec6cf6d8e0f5':
  Remove some <sys/cdefs.h> cruft.
2015-09-22 21:59:00 +00:00
Jorge Lucangeli Obes
dd51453904 Merge "Add preliminary OEM UID/GID support." 2015-09-22 21:53:39 +00:00
Elliott Hughes
efcb5d9d4c Merge "Remove some <sys/cdefs.h> cruft." 2015-09-22 21:52:28 +00:00
Yabin Cui
78f5504b92 am 042a61de: am 3d00f79f: Merge "Increase alternative signal stack size on 64-bit devices."
* commit '042a61de21296a7c5e4243b1e50ec591d124de98':
  Increase alternative signal stack size on 64-bit devices.
2015-09-22 20:59:44 +00:00
Yabin Cui
042a61de21 am 3d00f79f: Merge "Increase alternative signal stack size on 64-bit devices."
* commit '3d00f79f98c8b981a36a79657f07a303a2288a55':
  Increase alternative signal stack size on 64-bit devices.
2015-09-22 20:51:36 +00:00
Yabin Cui
3d00f79f98 Merge "Increase alternative signal stack size on 64-bit devices." 2015-09-22 20:44:05 +00:00
Elliott Hughes
cccb36036f am d97f4224: am 822c40a3: Merge "<netinet/udp.h> should include <linux/udp.h>."
* commit 'd97f422405cfb3f1d6287f879ce828f7195e68d3':
  <netinet/udp.h> should include <linux/udp.h>.
2015-09-22 20:34:32 +00:00
Jorge Lucangeli Obes
a39e30141d Add preliminary OEM UID/GID support.
Until we implement full support for passwd/group files, add a simple
way to use the new OEM UID/GID range (5000-5999).

oem_XXX -> 5000 + XXX iff 0 <= XXX < 1000.

Bug: 23225475

Change-Id: If48b88135d5df538313414f747d6c4c63bf0a103
2015-09-22 13:33:17 -07:00
Elliott Hughes
d97f422405 am 822c40a3: Merge "<netinet/udp.h> should include <linux/udp.h>."
* commit '822c40a3389a953d9b43f05ad6e40640fd55f9c4':
  <netinet/udp.h> should include <linux/udp.h>.
2015-09-22 20:25:03 +00:00
Elliott Hughes
822c40a338 Merge "<netinet/udp.h> should include <linux/udp.h>." 2015-09-22 20:19:14 +00:00
Elliott Hughes
44ddb31e75 Remove some <sys/cdefs.h> cruft.
In particular, we don't need to record the peculiarities of every
version of GCC ever shipped. It just makes this file harder to follow.

Change-Id: Ie9035d78eae86b4aed9dff3576c6f54e268aaced
2015-09-22 13:00:21 -07:00
Elliott Hughes
f8a2243ebe <netinet/udp.h> should include <linux/udp.h>.
The comment about "other stuff" referred to pre-uapi headers. Everything
in the current <linux/udp.h> should be exposed to userspace. The only
problem is that BSD and Linux use different names for the members of
struct udphdr. We can move the Linux udphdr out of the way and use an
anonymous union to get the best of both worlds. (Though unfortunately
this means that code that includes <linux/udp.h> directly instead of
using <netinet/udp.h> now won't have any definition of struct udphdr.
We've taken the stance in the past that you shouldn't include a linux/
header if there's a standard equivalent --- you should rely on us
transitively including it for you.)

Change-Id: Ie625892441b0edd8df3b76d3fcf2cbe299077bc4
2015-09-22 12:34:13 -07:00
Yabin Cui
33ac04a215 Increase alternative signal stack size on 64-bit devices.
Bug: 23041777
Bug: 24187462
Change-Id: I7d84c0cc775a74753a3e8e101169c0fb5dbf7437
2015-09-22 11:18:26 -07:00
Dan Albert
a2308b7f67 am 208d8e36: am 13997591: Merge "Add a hint about using --no-isolate for GDB."
* commit '208d8e369604e76363027289c09e08c9b4fc818b':
  Add a hint about using --no-isolate for GDB.
2015-09-19 19:59:53 +00:00
Christopher Ferris
a1ae03e21d am 4ed36397: am 777bd95c: Merge "Import scsi headers."
* commit '4ed363972e1120f924c84a56c513eb7e8077dcbc':
  Import scsi headers.
2015-09-19 19:59:52 +00:00
Greg Hackmann
672ff19c65 am 5fb12bc2: am 96b1323a: Merge "Define WIFCONTINUED()"
* commit '5fb12bc23273266b6afb08b61f1b5e558165c3d1':
  Define WIFCONTINUED()
2015-09-19 19:59:52 +00:00
Greg Hackmann
51c4d51d8f am a4ab398c: am 7c460451: Merge "Fix SOCK_* flag definitions"
* commit 'a4ab398c617055f5f5895f6b9f6ca5bf0f6e520f':
  Fix SOCK_* flag definitions
2015-09-19 19:59:51 +00:00
Dan Albert
208d8e3696 am 13997591: Merge "Add a hint about using --no-isolate for GDB."
* commit '1399759118f50071d499f88b18828e36aa2bad00':
  Add a hint about using --no-isolate for GDB.
2015-09-19 19:52:23 +00:00
Christopher Ferris
4ed363972e am 777bd95c: Merge "Import scsi headers."
* commit '777bd95c63fcbb461deac40b303d706d3b672837':
  Import scsi headers.
2015-09-19 19:52:13 +00:00
Greg Hackmann
5fb12bc232 am 96b1323a: Merge "Define WIFCONTINUED()"
* commit '96b1323a403bbd946487e4107a076b0a307136b1':
  Define WIFCONTINUED()
2015-09-19 19:52:12 +00:00
Greg Hackmann
a4ab398c61 am 7c460451: Merge "Fix SOCK_* flag definitions"
* commit '7c4604518bcd27e27fb305388188275f49dea468':
  Fix SOCK_* flag definitions
2015-09-19 19:52:09 +00:00
Dan Albert
1399759118 Merge "Add a hint about using --no-isolate for GDB." 2015-09-18 21:18:06 +00:00
Christopher Ferris
777bd95c63 Merge "Import scsi headers." 2015-09-18 20:44:58 +00:00
Greg Hackmann
96b1323a40 Merge "Define WIFCONTINUED()" 2015-09-18 20:39:07 +00:00
Greg Hackmann
7c4604518b Merge "Fix SOCK_* flag definitions" 2015-09-18 20:38:54 +00:00
Greg Hackmann
c6043f6b27 Define WIFCONTINUED()
Change-Id: Id0feebd90d0525f3b479eb119b942eae8ca568d1
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2015-09-18 13:37:53 -07:00
Greg Hackmann
d75abb9614 Fix SOCK_* flag definitions
MIPS and the rest of the world only disagree on the first two SOCK_*
constants, so restructure the #ifdef accordingly.

As a deliberate side effect, this fixes SOCK_DCCP being missing on
non-MIPS platforms.

Change-Id: I2267008f1121a7eebe1ed9097afab6e612bce7f0
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2015-09-18 13:37:53 -07:00
Dan Albert
1af434cc02 Add a hint about using --no-isolate for GDB.
Change-Id: Ib9df5ed986a1c4082c9c7cd793a4d670be21ca66
2015-09-18 13:17:02 -07:00
Elliott Hughes
10292607e4 am c0c6bcc8: am 355f3d0c: Merge "Fix mips FP abi bug in the linker."
* commit 'c0c6bcc8f7f90a7bb65d683efc97825625f072b0':
  Fix mips FP abi bug in the linker.
2015-09-18 15:34:09 +00:00
Elliott Hughes
c0c6bcc8f7 am 355f3d0c: Merge "Fix mips FP abi bug in the linker."
* commit '355f3d0c12a3cca3bf8304073f81b5e0d544ac59':
  Fix mips FP abi bug in the linker.
2015-09-18 15:29:12 +00:00
Elliott Hughes
355f3d0c12 Merge "Fix mips FP abi bug in the linker." 2015-09-18 15:20:40 +00:00
Christopher Ferris
1e9b59d37e am 577c64eb: am d9639559: Merge "Add support for manually modified kernel headers."
* commit '577c64ebbfc3fe183394e14b67d543d8ec0f6425':
  Add support for manually modified kernel headers.
2015-09-18 04:30:42 +00:00
Christopher Ferris
577c64ebbf am d9639559: Merge "Add support for manually modified kernel headers."
* commit 'd9639559ccccf055919a4d1487ca8a6cba953715':
  Add support for manually modified kernel headers.
2015-09-18 04:23:55 +00:00
Christopher Ferris
6048173b36 Import scsi headers.
Linux's scsi headers are a mix of userspace-facing and kernel-facing
declarations that can't be directly used by userspace.  The glibc
maintainers manually copy-and-pasted these definitions into their own
scsi headers and haven't substantially updated them in 15 years.  musl
has a similar set of definitions in its scsi headers.

This change generates the scsi headers from external/kernel-headers,
using the updated generation script so that the single modified scsi.h
takes the place of the non-modified one.

Change-Id: Ic14d155aa534b0edc1ee686d61113ce5cdf0e6af
2015-09-17 21:22:44 -07:00
Christopher Ferris
d9639559cc Merge "Add support for manually modified kernel headers." 2015-09-18 04:15:32 +00:00
Christopher Ferris
d12c332018 Add support for manually modified kernel headers.
This changes the scripts so that if some kernel files exists
in external/kernel-headers/modified, that they will be preferred
over the same files found in original. This is to support the case
where the kernel headers cannot be taken without some small modifications.

Included with this change, is a general cleanup of the python scripts.

This also modifies the generate uapi headers script to indicate if the
source of the modified headers has changed.

Change-Id: Id13523b244ced52a2ecd9f1399c43996dd8296fa
2015-09-17 21:02:52 -07:00
Dan Willemsen
e06ef6709f am 305af045: am 353e7e5d: Merge "Update Android.bp for setjmp cookies"
* commit '305af04561b9b8bd612f16350f0dd41a25be7cc2':
  Update Android.bp for setjmp cookies
2015-09-17 22:52:33 +00:00
Dan Willemsen
305af04561 am 353e7e5d: Merge "Update Android.bp for setjmp cookies"
* commit '353e7e5d11fa59750c5358ad3e239765dcbeb335':
  Update Android.bp for setjmp cookies
2015-09-17 22:44:57 +00:00
Dan Willemsen
353e7e5d11 Merge "Update Android.bp for setjmp cookies" 2015-09-17 22:34:35 +00:00
Josh Gao
ec94ca9284 am 91624eae: am 57866a6d: Merge changes Iea8d03de,I2014f959
* commit '91624eae9aa90e123ae37843d94861120d2433a4':
  Implement setjmp cookies on x86_64.
  Implement setjmp cookies on x86.
2015-09-17 22:31:45 +00:00
Dan Willemsen
35e91a10e0 Update Android.bp for setjmp cookies
Change-Id: I57245e4eedf9b8e1edc7de46208be5aa47c94b28
2015-09-17 15:28:45 -07:00
Josh Gao
91624eae9a am 57866a6d: Merge changes Iea8d03de,I2014f959
* commit '57866a6ddef66e9c331df4f20e6c39920aba2a99':
  Implement setjmp cookies on x86_64.
  Implement setjmp cookies on x86.
2015-09-17 22:22:33 +00:00
Douglas Leung
dccc40883a Fix mips FP abi bug in the linker.
Change-Id: I1ffab938eb06f9dc0963ee15bc10eca216618792
2015-09-17 15:17:06 -07:00
Josh Gao
57866a6dde Merge changes Iea8d03de,I2014f959
* changes:
  Implement setjmp cookies on x86_64.
  Implement setjmp cookies on x86.
2015-09-17 22:14:41 +00:00
Josh Gao
2342e643d4 Implement setjmp cookies on x86_64.
Bug: http://b/23942752
Change-Id: Iea8d03de1dd9ca5a128c072c94b10de3a8056348
2015-09-17 14:51:44 -07:00
Josh Gao
85c14fb086 Implement setjmp cookies on x86.
Bug: http://b/23942752
Change-Id: I2014f95989d0ab094b225234d98ccee477166c9d
2015-09-17 14:51:44 -07:00
Josh Gao
5c12a504cf am 9e3d8730: am 823cff84: Merge changes I81408ef0,Id0eb8d06
* commit '9e3d873036b581b9986f42cc40f2d43f057ed7f1':
  Implement setjmp cookies on AArch64.
  Implement setjmp cookies on ARM.
2015-09-17 21:22:32 +00:00
Josh Gao
9e3d873036 am 823cff84: Merge changes I81408ef0,Id0eb8d06
* commit '823cff847b3b202b235ddd84650338f07bc61511':
  Implement setjmp cookies on AArch64.
  Implement setjmp cookies on ARM.
2015-09-17 21:15:57 +00:00
Josh Gao
823cff847b Merge changes I81408ef0,Id0eb8d06
* changes:
  Implement setjmp cookies on AArch64.
  Implement setjmp cookies on ARM.
2015-09-17 21:09:23 +00:00
Josh Gao
54db0df8d6 Implement setjmp cookies on AArch64.
Bug: http://b/23942752
Change-Id: I81408ef0dd53010140b51e3083d357d3f2961112
2015-09-17 14:07:24 -07:00
Josh Gao
7fda8d2aa4 Implement setjmp cookies on ARM.
Reuse the top bits of _JB_SIGFLAG field previously used to store a
boolean to store a cookie that's validated by [sig]longjmp to make it
harder to use as a ROP gadget. Additionally, encrypt saved registers
with the cookie so that an attacker can't modify a register's value to
a specific value without knowing the cookie.

Bug: http://b/23942752
Change-Id: Id0eb8d06916e89d5d776bfcaa9458f8826717ba3
2015-09-17 14:07:24 -07:00
Dan Willemsen
c101cc20bf am 64ce4787: am 90fc8e24: Merge "Add Android.bp for libc/libm/libdl"
* commit '64ce4787e593a547dab41210b28bc74e19318820':
  Add Android.bp for libc/libm/libdl
2015-09-17 19:52:53 +00:00
Dan Willemsen
64ce4787e5 am 90fc8e24: Merge "Add Android.bp for libc/libm/libdl"
* commit '90fc8e24876412a816776d44bedc77e1f1888a13':
  Add Android.bp for libc/libm/libdl
2015-09-17 19:40:42 +00:00
Dan Willemsen
90fc8e2487 Merge "Add Android.bp for libc/libm/libdl" 2015-09-17 19:31:07 +00:00
Yabin Cui
a59905b80c am 72e678c8: am cbd0a15b: Merge "Fix the way to get main thread stack start address."
* commit '72e678c8a7f78a04dffc57a6b2add45aeee4d1ec':
  Fix the way to get main thread stack start address.
2015-09-17 02:50:56 +00:00
Yabin Cui
72e678c8a7 am cbd0a15b: Merge "Fix the way to get main thread stack start address."
* commit 'cbd0a15be881abb8ce1feb5b389da2f517a9a4c6':
  Fix the way to get main thread stack start address.
2015-09-17 02:42:52 +00:00
Yabin Cui
cbd0a15be8 Merge "Fix the way to get main thread stack start address." 2015-09-17 02:37:20 +00:00
Dan Willemsen
208ae17e5f Add Android.bp for libc/libm/libdl
Change-Id: I3537363849ba1244348996ff17c5ace1b95dbeee
2015-09-16 16:50:01 -07:00
Mor-sarid, Nitzan
569333293a Fix the way to get main thread stack start address.
For previous way to get the stack using the [stack] string from
/proc/self/task/<pid>/maps is not enough. On x86/x86_64, if an
alternative signal stack is used while a task switch happens,
the [stack] indicator may no longer be correct.

Instead, stack_start from /proc/self/stat which is always inside
the main stack, is used to find the main stack in /proc/self/maps.

Change-Id: Ieb010e71518b57560d541cd3b3563e5aa9660750
Signed-off-by: Nitzan Mor-sarid <nitzan.mor-sarid@intel.com>
Signed-off-by: Mingwei Shi <mingwei.shi@intel.com>
2015-09-16 11:45:13 -07:00
Elliott Hughes
5278af69ac am bab1044d: am 14545d4c: Merge "Move several FreeBSD functions to OpenBSD."
* commit 'bab1044d27cc5b88809f2fc0e5be7e23f2ab6623':
  Move several FreeBSD functions to OpenBSD.
2015-09-15 15:25:18 +00:00
Elliott Hughes
bab1044d27 am 14545d4c: Merge "Move several FreeBSD functions to OpenBSD."
* commit '14545d4ce3dd446f20a14dcff37d60ff8d756f7a':
  Move several FreeBSD functions to OpenBSD.
2015-09-15 15:19:20 +00:00
Elliott Hughes
8abd365509 am 364dbb3c: am 44c8ac8b: Merge "Sync with upstream NetBSD lib/libc/regex."
* commit '364dbb3cf493b00e48d8f29e4a845e78f8139f4f':
  Sync with upstream NetBSD lib/libc/regex.
2015-09-15 15:18:56 +00:00
Elliott Hughes
14545d4ce3 Merge "Move several FreeBSD functions to OpenBSD." 2015-09-15 15:13:35 +00:00
Elliott Hughes
364dbb3cf4 am 44c8ac8b: Merge "Sync with upstream NetBSD lib/libc/regex."
* commit '44c8ac8bd7747d907720c63538625a4b95245234':
  Sync with upstream NetBSD lib/libc/regex.
2015-09-15 15:12:36 +00:00
Elliott Hughes
44c8ac8bd7 Merge "Sync with upstream NetBSD lib/libc/regex." 2015-09-15 15:05:21 +00:00
Elliott Hughes
26a8322972 Move several FreeBSD functions to OpenBSD.
There's no difference between the two BSDs for these functions, so let's go
with the majority.

Change-Id: Ic296f23153a48bed5ad152f5b31989c4e00e60bd
2015-09-14 19:01:58 -07:00
Elliott Hughes
71927a8237 Sync with upstream NetBSD lib/libc/regex.
Bug: http://b/22850181
Change-Id: I11a51a2031e68a953ccd5691da98c699c7d01904
2015-09-14 18:45:52 -07:00
Daniel Micay
5ca66528c5 make mmap fail on requests larger than PTRDIFF_MAX
Allocations larger than PTRDIFF_MAX can be successfully created on
32-bit with a 3:1 split, or in 32-bit processes running on 64-bit.

Allowing these allocations to succeed is dangerous, as it introduces
overflows for `end - start` and isn't compatible with APIs (mis)using
ssize_t to report either the size or an error. POSIX is guilty of this,
as are many other Android APIs. LLVM even considers the `ptr + size`
case to be undefined, as all pointer arithmetic compiles down to signed
operations and overflow is treated as undefined for standard C pointer
arithmetic (GNU C `void *` arithmetic works differently).

This also prevents dlmalloc from allocating > PTRDIFF_MAX as it doesn't
merge mappings like jemalloc. A similar check will need to be added in
jemalloc's code path for huge allocations.

The musl libc implementation also performs this sanity check.

Change-Id: I5f849543f94a39719f5d27b00cef3079bb5933e9
2015-09-12 01:52:12 -04:00
Dan Albert
a4b45b70f5 am a1a46a8e: am cd0ed2f1: Merge "CMSG_DATA should return an unsigned char*."
* commit 'a1a46a8e946d1fd1c50f44e7e23f462e179ddbb1':
  CMSG_DATA should return an unsigned char*.
2015-09-11 23:04:58 +00:00
Dan Albert
a1a46a8e94 am cd0ed2f1: Merge "CMSG_DATA should return an unsigned char*."
* commit 'cd0ed2f174d9015da5ae7206bc4c5190cd0bb51e':
  CMSG_DATA should return an unsigned char*.
2015-09-11 22:14:07 +00:00
Dan Albert
cd0ed2f174 Merge "CMSG_DATA should return an unsigned char*." 2015-09-11 17:39:12 +00:00
Dan Albert
268af26359 CMSG_DATA should return an unsigned char*.
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_socket.h.html
> CMSG_DATA(cmsg)
>    If the argument is a pointer to a cmsghdr structure, this macro
>    shall return an unsigned character pointer to the data array
>    associated with the cmsghdr structure.

Change-Id: I3f89ba19cbca4e6727abc65a2bbcd59267892ba8
2015-09-11 09:47:27 -07:00
Dan Albert
b3c3fb5b59 am 32ec7498: am 1c7b84ca: Merge changes Ia1777fd4,I3998d88b
* commit '32ec74987344cedb5596e6da1891a9d54962f149':
  Unify unistd.h.
  Use attribute availability.
2015-09-08 20:38:46 +00:00
Dan Albert
32ec749873 am 1c7b84ca: Merge changes Ia1777fd4,I3998d88b
* commit '1c7b84ca0095e0dc4da8434e9e0c59cd2326f763':
  Unify unistd.h.
  Use attribute availability.
2015-09-08 20:32:37 +00:00
Dan Albert
1c7b84ca00 Merge changes Ia1777fd4,I3998d88b
* changes:
  Unify unistd.h.
  Use attribute availability.
2015-09-08 20:24:39 +00:00
Dan Albert
af4713e6a5 Unify unistd.h.
Make unistd.h usable from all platform versions.

Also name all function parameters for Android Studio.

Bug: http://b/21952040
Change-Id: Ia1777fd4a6d4e37f25cc402c28fb78c003e481e3
2015-09-04 13:02:09 -07:00
Dan Albert
a6435a186d Use attribute availability.
Bug: http://b/21952040
Change-Id: I3998d88bc6076d60ae5cf7efd112817f80f17971
2015-09-04 13:02:03 -07:00
Elliott Hughes
a775a41130 am edc73f62: am ba9c1705: Merge "linker: don\'t pass dlextinfo to dependent loads"
* commit 'edc73f6286bcd1f7d0278d25d4484bf23a0e53b2':
  linker: don't pass dlextinfo to dependent loads
2015-09-04 18:21:34 +00:00
Elliott Hughes
edc73f6286 am ba9c1705: Merge "linker: don\'t pass dlextinfo to dependent loads"
* commit 'ba9c17053456aed4452a349cf45c5960d9231f25':
  linker: don't pass dlextinfo to dependent loads
2015-09-04 18:12:33 +00:00
Elliott Hughes
ba9c170534 Merge "linker: don't pass dlextinfo to dependent loads" 2015-09-04 18:02:18 +00:00
Christopher Ferris
23ff8fc4ee am 2fe50aa3: am cb0d96e6: Merge "Only close stdin/stdout/stderr for debug malloc."
* commit '2fe50aa3806f2c367dddfc5ddedd1c636223b823':
  Only close stdin/stdout/stderr for debug malloc.
2015-09-04 01:31:18 +00:00
Christopher Ferris
2fe50aa380 am cb0d96e6: Merge "Only close stdin/stdout/stderr for debug malloc."
* commit 'cb0d96e6a218cc37eb0ab764740a8bf1ea385511':
  Only close stdin/stdout/stderr for debug malloc.
2015-09-04 01:17:48 +00:00
Christopher Ferris
cb0d96e6a2 Merge "Only close stdin/stdout/stderr for debug malloc." 2015-09-04 01:09:11 +00:00
Christopher Ferris
efc134dba3 Only close stdin/stdout/stderr for debug malloc.
The debug malloc code unconditionally closes stdin/stdout/stderr,
which means that other atexit functions cannot use them. Only
close these if there is a debug malloc final function to call.

This doesn't appear to be a problem on most normal applications or the
atexit_exit bionic unit test would be failing. However, if you
enable stat dumping in jemalloc, nothing prints. Most likely trying
to add an atexit function from within libc is causing that atexit
to run after the debug malloc atexit function.

Change-Id: I963720d4ccaaa511e44af07a7461f17eb3f84e8e
2015-09-03 17:45:33 -07:00
Christopher Ferris
407dea47bd am 7bb544cc: am b423ffa6: Merge "Update to v3.18.21 kernel headers."
* commit '7bb544cc7c3d70af5f06dd5cf8b33e841b816ded':
  Update to v3.18.21 kernel headers.
2015-09-03 18:14:10 +00:00
Christopher Ferris
7bb544cc7c am b423ffa6: Merge "Update to v3.18.21 kernel headers."
* commit 'b423ffa6c27ade8485f1f061fd3775553e9bb457':
  Update to v3.18.21 kernel headers.
2015-09-03 18:00:09 +00:00
Christopher Ferris
b423ffa6c2 Merge "Update to v3.18.21 kernel headers." 2015-09-03 17:52:47 +00:00
Christopher Ferris
915bf813ad Update to v3.18.21 kernel headers.
Change-Id: I4ade68d62981c7f6f361750cc811e8d84be9d5b9
2015-09-02 17:23:31 -07:00
Dmitriy Ivanov
edfc9f63a2 linker: don't pass dlextinfo to dependent loads
Don't pass the parent load's dlextinfo to dependent loads, since this
causes the linker to try to load the dependencies using the same
addresses/relro/fds/etc as the main library, which is never going to
work. This was how it worked before ae69a95 which broke this.

Bug: http://b/23742664
Bug: http://b/20948231
Bug: http://b/20841817
Change-Id: I340ebae1127666d5c6c6f9c6521b89fb93f15bdd
2015-09-02 16:32:02 -07:00
Elliott Hughes
eb457e212e am 67c6da80: am cc251966: Merge "Rename debug_stacktrace to debug_backtrace."
* commit '67c6da80bb3b6b4febc783db04ce19cdeb187092':
  Rename debug_stacktrace to debug_backtrace.
2015-09-02 04:00:02 +00:00
Elliott Hughes
67c6da80bb am cc251966: Merge "Rename debug_stacktrace to debug_backtrace."
* commit 'cc25196662cab824117e7cb79e435bd3aaf37dcc':
  Rename debug_stacktrace to debug_backtrace.
2015-09-02 03:52:24 +00:00
Elliott Hughes
cc25196662 Merge "Rename debug_stacktrace to debug_backtrace." 2015-09-02 03:44:31 +00:00
Yabin Cui
80dbedc95a am d3c7f67a: am 32c85daa: Merge "build bionic gtest runner on mac."
* commit 'd3c7f67aed0b5ac0bd7fd03c6925cbaf6b1305ba':
  build bionic gtest runner on mac.
2015-09-01 23:29:21 +00:00
Yabin Cui
d3c7f67aed am 32c85daa: Merge "build bionic gtest runner on mac."
* commit '32c85daa1570e589ce953c42b40fb34cf2b5e989':
  build bionic gtest runner on mac.
2015-09-01 23:08:34 +00:00
Elliott Hughes
32bf43f44a Rename debug_stacktrace to debug_backtrace.
All the functions say "backtrace", so it's weird that the filename
says "stacktrace".

Change-Id: I1c88a56c1f9adb1bae4615edc8af3e73db270a8c
2015-09-01 16:01:50 -07:00
Yabin Cui
32c85daa15 Merge "build bionic gtest runner on mac." 2015-09-01 22:58:23 +00:00
Yabin Cui
767fb1c5c6 build bionic gtest runner on mac.
Change-Id: I39a7e94b6662256646dfaeb8f9ecd5c03cd5fbc6
2015-09-01 15:40:38 -07:00
Elliott Hughes
695d4c62fd am c121e179: am a992004c: Merge "Regenerate NOTICE files."
* commit 'c121e179a2897e3e21d8455420dbd62822b32e53':
  Regenerate NOTICE files.
2015-08-29 04:14:22 +00:00
Elliott Hughes
c121e179a2 am a992004c: Merge "Regenerate NOTICE files."
* commit 'a992004c9edf4db0c11aae8610cce6ebf13d53b4':
  Regenerate NOTICE files.
2015-08-29 04:07:20 +00:00
Elliott Hughes
0cc8e665fd am 74c5bba5: am cb58f528: Merge "Sync with upstream FreeBSD libm."
* commit '74c5bba5404f2c286eae3a492898656e80097b11':
  Sync with upstream FreeBSD libm.
2015-08-29 04:02:34 +00:00
Elliott Hughes
a992004c9e Merge "Regenerate NOTICE files." 2015-08-29 04:00:21 +00:00
Elliott Hughes
74c5bba540 am cb58f528: Merge "Sync with upstream FreeBSD libm."
* commit 'cb58f528bfc19bbc32d8a8b9d7e954f61d622c52':
  Sync with upstream FreeBSD libm.
2015-08-29 03:55:19 +00:00
Elliott Hughes
cb58f528bf Merge "Sync with upstream FreeBSD libm." 2015-08-29 03:46:21 +00:00
Elliott Hughes
44ead71726 Regenerate NOTICE files.
Change-Id: Ia5c340220bb75e4e3166cc483ea77d19cfb08a71
2015-08-28 20:23:52 -07:00
Elliott Hughes
8cff2f95d8 Sync with upstream FreeBSD libm.
Change-Id: I97e9b23903f1d993d84825806065e85626007d31
2015-08-28 20:21:43 -07:00
Elliott Hughes
0f0c7197b5 am b57e9efd: am c2e634dd: Merge "Fix regoff_t for LP32 and _FILE_OFFSET_BITS=64."
* commit 'b57e9efd40d5765f9ff62f2aa3b6b2ca8523b024':
  Fix regoff_t for LP32 and _FILE_OFFSET_BITS=64.
2015-08-27 23:32:58 +00:00
Elliott Hughes
b57e9efd40 am c2e634dd: Merge "Fix regoff_t for LP32 and _FILE_OFFSET_BITS=64."
* commit 'c2e634dd303a44b11e30ab31e39ffc4eae5467f8':
  Fix regoff_t for LP32 and _FILE_OFFSET_BITS=64.
2015-08-27 23:24:33 +00:00
Elliott Hughes
c2e634dd30 Merge "Fix regoff_t for LP32 and _FILE_OFFSET_BITS=64." 2015-08-27 23:17:43 +00:00
Dan Albert
5e98eaee2d am a71f81a0: am 46c7bc83: Merge "Don\'t re-export libunwind_llvm."
* commit 'a71f81a08b6a94ef79c96b62733bb97de5350d79':
  Don't re-export libunwind_llvm.
2015-08-27 22:37:01 +00:00
Dan Albert
a71f81a08b am 46c7bc83: Merge "Don\'t re-export libunwind_llvm."
* commit '46c7bc83ab0324983312f16bd40cc1cdfe11cce6':
  Don't re-export libunwind_llvm.
2015-08-27 22:27:38 +00:00
Dan Albert
46c7bc83ab Merge "Don't re-export libunwind_llvm." 2015-08-27 22:20:51 +00:00
Elliott Hughes
adf5c7237d Fix regoff_t for LP32 and _FILE_OFFSET_BITS=64.
bionic is built without _FILE_OFFSET_BITS=64, so internally regoff_t
was 32-bit on LP32, but code compiled with _FILE_OFFSET_BITS would
expect rm_so and rm_eo in struct regmatch_t to be 64-bit, leading to
confusion.

Bug: http://b/23566443
Change-Id: Iae92fa545104068e4f64ce1977f5ec616859638c
2015-08-27 14:48:32 -07:00
Chih-hung Hsieh
4afb130399 am e7a09ff7: am bfaee4bd: Merge "Add test cases for __emutls_get_address."
* commit 'e7a09ff7d99740c5e74308abc1e209522811b814':
  Add test cases for __emutls_get_address.
2015-08-27 12:40:33 +00:00
Elliott Hughes
a0d1cda1a6 am c6effb3a: am 848808c6: Merge "Add preadv/pwritev."
* commit 'c6effb3af6f27c1acfbc2f776bb516e5f4d24476':
  Add preadv/pwritev.
2015-08-27 12:40:32 +00:00
Chih-hung Hsieh
e7a09ff7d9 am bfaee4bd: Merge "Add test cases for __emutls_get_address."
* commit 'bfaee4bd6ad901a699df21fd44d95f34e2e7444d':
  Add test cases for __emutls_get_address.
2015-08-27 05:22:56 +00:00
Elliott Hughes
c6effb3af6 am 848808c6: Merge "Add preadv/pwritev."
* commit '848808c660ec4811f4ff5a2748b6f754b008cd21':
  Add preadv/pwritev.
2015-08-27 05:22:55 +00:00
Christopher Ferris
ed90d4caea am 1154bcb3: (-s ours) am d518a6d3: Merge "Fix the 16 bit/32 bit instruction check for arm."
* commit '1154bcb3c095606fcaa5e836e935cb3406f6703d':
2015-08-27 05:06:25 +00:00
Elliott Hughes
a56db54d1d am 03deb828: (-s ours) am 629ed517: Merge "Add strchrnul."
* commit '03deb8287b019e9d526b193a0b7fa5e3fa6e8f77':
2015-08-27 05:06:24 +00:00
Elliott Hughes
83c7b596e4 am 5f55f32e: (-s ours) am 4d5c4f08: Merge "Add the missing aarch64 user structs."
* commit '5f55f32e49c804b21a66b7656297e8a426660afe':
2015-08-27 05:06:24 +00:00
Neil Fuller
268344457e am 1c751e5e: (-s ours) am 82911942: Update timezone data to 2015f
* commit '1c751e5ec76085aced87d50757495083a0f46a73':
2015-08-27 05:06:23 +00:00
Neil Fuller
b455457761 am 58cf5d6b: (-s ours) am 53f2abb5: Merge "Update timezone data to 2015f"
* commit '58cf5d6b1daf54b50c7864df563227787cb91375':
2015-08-27 05:06:22 +00:00
Neil Fuller
356868f8ac am 7336be05: (-s ours) am f7286a26: Merge "Move tzdata scripts from bionic to external/icu"
* commit '7336be059850edf23ad51f16520a9a08eff7cfe5':
2015-08-27 05:06:21 +00:00
Elliott Hughes
11a740e879 am 0ed97d1b: (-s ours) am 5bf79420: Merge "Revert "Revert "Use compiler builtins for fabs."""
* commit '0ed97d1b5fc136226d1ab62a2aa982ee5d99cabd':
2015-08-27 05:06:20 +00:00
Elliott Hughes
82f20c916e am 1a265558: (-s ours) am c868b4c3: Merge "Revert "Use compiler builtins for fabs.""
* commit '1a26555846f49a9f7d15772ab014e01cac7a6f5b':
2015-08-27 05:06:18 +00:00
Josh Gao
d32cadd1a5 am ebcaf389: (-s ours) am 0f8f9300: Merge "Add exported __popcount_tab for libgcc compat under compiler-rt."
* commit 'ebcaf389cdcb1d18622c500a6c7021259171dd39':
2015-08-27 05:06:17 +00:00
Josh Gao
b8c276b778 am df4492f3: (-s ours) am fad8370c: Merge "Improve .clang-format."
* commit 'df4492f339662ae1468bce3ee33270142227146c':
2015-08-27 05:06:16 +00:00
Elliott Hughes
756574d53e am 51b0bf03: (-s ours) am a19a9348: Merge "Use compiler builtins for fabs."
* commit '51b0bf03c074aa36f100a3d4d688f9b1687d3300':
2015-08-27 05:06:15 +00:00
Dan Albert
4ca3de4502 am 8c6b0d16: (-s ours) am a80ae8b8: Merge "Add a .clang-format file."
* commit '8c6b0d164e0d7a1a3ae4a2497e3bb9d5ae208a02':
2015-08-27 05:06:14 +00:00
Nick Kralevich
437c3e48f9 am f94b491c: (-s ours) am 4d7d05bd: Merge "Revert "fix incompatibility with -fstack-protector-strong""
* commit 'f94b491c2b9f8f01038af73863b6ba3945f70d0b':
2015-08-27 05:06:13 +00:00
Nick Kralevich
40773fb797 am abd1975d: (-s ours) am 5f7a5125: Merge "fix incompatibility with -fstack-protector-strong"
* commit 'abd1975dcc814087afb1fe262b5f2ce389fb4ff9':
2015-08-27 05:06:12 +00:00
Yabin Cui
3aa60b82ef am 65248069: (-s ours) am 62c26ed9: Merge "add fortified implementations of write/pwrite{,64}"
* commit '652480695172d90209e5163e92180a3952fba29a':
2015-08-27 05:06:10 +00:00
Elliott Hughes
806055dace am 9835b61d: (-s ours) am 49715dcc: Merge "Fix a mistype in segment overrange checking"
* commit '9835b61d636720712f79e49a5672518ead4753f9':
2015-08-27 05:06:09 +00:00
Christopher Ferris
f962a1848e am 55cd7b0b: (-s ours) am 079fc833: Merge "Modify ip to get the instr being executed."
* commit '55cd7b0b761ffb62ea522204fb2b0567862e920d':
2015-08-27 05:06:08 +00:00
Dan Albert
91aeb800d6 am af86eeec: (-s ours) am df0891ad: Merge "Add a TLS slot for TSAN."
* commit 'af86eeecc90442530ae6fa6f99188913c0198281':
2015-08-27 05:06:07 +00:00
Christopher Ferris
393e69d77e am 888ad399: (-s ours) am e4d51cf3: Merge "Add optimized cortex-a7/cortex-a53 memset/memcpy."
* commit '888ad399ee0b4da90d745fb9b45e89aec18bd8e1':
2015-08-27 05:06:06 +00:00
Elliott Hughes
a849fe6e2e am 37763e7a: (-s ours) am 4a8c4ce4: Merge "libc: remove bcopy from memmove on 64-bit architectures"
* commit '37763e7a7a3fc4b045d8a330306d652991bfed62':
2015-08-27 05:06:04 +00:00
Ying Wang
8abc375ec9 am e46c4212: (-s ours) am 85197af9: Merge "Don\'t attach linker_asan to linker in module definition."
* commit 'e46c4212d6478975dbbb7f7105ad05c2cdb07d7b':
2015-08-27 05:06:03 +00:00
Elliott Hughes
f92664cbe5 am 3034028d: (-s ours) am 6816d8cc: Merge "Use __builtin_* in <math.h>."
* commit '3034028d7a1f93e46e212061efe7b57fe8758107':
2015-08-27 05:06:01 +00:00
Elliott Hughes
b635c4ebb2 am 0ff5dda1: (-s ours) am dd8adc35: Merge "libm: ARM: reorganize a bit to match ARM64"
* commit '0ff5dda1020c4da9c4d21d8d3d4ad9ba15848441':
2015-08-27 05:06:00 +00:00
Elliott Hughes
ec6a557b38 am 1789ac90: (-s ours) am b4f2112f: Merge "[MIPS] Invalidate cached pid in vfork."
* commit '1789ac90f7ca94c161958640297b6b4aafa152fd':
2015-08-27 05:05:58 +00:00
Dan Albert
79697a7096 am 9423fb23: (-s ours) am f2985ed8: Merge "Fix test steps for 64-bit bionic"
* commit '9423fb23757a0d6d4f112a3f231717896444207b':
2015-08-27 05:05:57 +00:00
Dan Albert
8cc0d89a9d am 34afc42a: (-s ours) am 2b934924: Merge "Add missing include."
* commit '34afc42ae749c9cd7ce660ef6ab0c50bdbb41497':
2015-08-27 05:05:53 +00:00
Yabin Cui
0bbda9838b am 2bcb25c1: (-s ours) am 0660be89: am a6a12a78: am 0fdcdd00: Merge "Fix flaky test time.timer_settime_0." into lollipop-mr1-cts-dev
* commit '2bcb25c1c3153a28229bffcdd4d289ac72b987cc':
2015-08-27 05:05:46 +00:00
Dan Albert
3ce99a04a9 am ee8576d1: (-s ours) am a3c01467: Merge "Move up to C++14."
* commit 'ee8576d11413c7b9d42f466fb378921b4cdb01f3':
2015-08-27 05:05:44 +00:00
Yabin Cui
7b02991de7 am c23143a5: (-s ours) am ff4afc13: Merge "Omit comment when reading --gtest_list_tests option\'s output."
* commit 'c23143a5fdd32a1cc0ca0efdb435d9f46b596113':
2015-08-27 05:05:42 +00:00
Elliott Hughes
29eaaa6ee5 am 23e0bdf7: (-s ours) am 182b91f6: Merge "Invalidate cached pid in vfork."
* commit '23e0bdf7d4476399c04557396e288ad21938e65f':
2015-08-27 05:05:40 +00:00
Andreas Gampe
34df06eb8a am fd202300: (-s ours) am e80369ab: Merge "Bionic: Add a TLS slot for ART for Thread self"
* commit 'fd202300d8639065406f054e7232e9135572bb81':
2015-08-27 05:05:38 +00:00
Elliott Hughes
45f262c084 am 711d7b9f: (-s ours) am b3db7764: Merge "name the arc4random structure mappings"
* commit '711d7b9f90648183af684f80b9de80fc83b43824':
2015-08-27 05:05:37 +00:00
Elliott Hughes
a31ba88d4c am 65941221: (-s ours) am f57f7945: Merge "Cherrypick upstream fnmatch.c fix."
* commit '65941221b5985c824783f8c549241695a0cb6f92':
2015-08-27 05:05:35 +00:00
Elliott Hughes
f1a2cd9713 am dc181dd7: (-s ours) am 2278d29a: Merge "[MIPS] Link .dex or .oat code lacking .MIPS.abiflags segment"
* commit 'dc181dd7882e1a633400fe410266dc58152c7c10':
2015-08-27 05:05:32 +00:00
Yabin Cui
37c4110f41 am 993a2bee: (-s ours) am 7e919dae: Merge "add a fortified implementation of getcwd"
* commit '993a2bee84e25604e7ef8c1d386e7cd3904627e0':
2015-08-27 05:05:30 +00:00
Elliott Hughes
ba06d5519e am 5b916453: (-s ours) am 25907058: Merge "Sync current upstream fnmatch.c."
* commit '5b916453f3d75ca9bbac6825191442c4b159e6a9':
2015-08-27 05:05:25 +00:00
Elliott Hughes
dc5970d025 am 9d7c6a7e: (-s ours) am 61c21b63: Merge "Revert "add a fortified implementation of getcwd""
* commit '9d7c6a7e570a8b91a094f0df4407b5624b469730':
2015-08-27 05:05:22 +00:00
Yabin Cui
e6623ebcaf am 4279bac2: (-s ours) am 442a3fca: Merge "add a fortified implementation of getcwd"
* commit '4279bac26a15b69a85d3d98a57ff7094b579f207':
2015-08-27 05:05:20 +00:00
Elliott Hughes
b51b07117c am 19a8b3fc: (-s ours) am 807f27f9: Merge "Stop sending SIGPIPE to debuggerd."
* commit '19a8b3fc8296974a4c65f52bd5da050b442bf901':
2015-08-27 05:05:18 +00:00
Elliott Hughes
1dd6f6436b am d473681f: (-s ours) am 44989174: Merge "Prevent buffer over-read in linker.cpp\'s parse_path."
* commit 'd473681fb1ba8e93154a16ca5d9290c66c6da224':
2015-08-27 05:05:15 +00:00
Elliott Hughes
3cb8b52334 am 89a64c0f: (-s ours) am 34c5f5ea: Merge "Remove PAGE_SIZE from <limits.h>."
* commit '89a64c0f2ee1abfbda37049b7700c104a0092946':
2015-08-27 05:05:12 +00:00
Elliott Hughes
d4cc5122d2 am 5c104603: (-s ours) am 374adfee: Merge "Don\'t transitively include <limits.h> from <sys/user.h>."
* commit '5c104603a01ef3bffa6819313508a29722756bcf':
2015-08-27 05:05:09 +00:00
Elliott Hughes
6ed2717b28 am c5de153b: (-s ours) am 1ff4094a: Merge "Remove PAGESIZE."
* commit 'c5de153bc6600a73722a594416a9398361dfb942':
2015-08-27 05:05:06 +00:00
Elliott Hughes
6141acb75f am a3c3a6b2: (-s ours) am c8ba22c8: Merge "Move PAGE_MASK into <sys/user.h>."
* commit 'a3c3a6b2df6de20f22139fae79c6bd124fc7fdb6':
2015-08-27 05:04:56 +00:00
Mark Salyzyn
9f80696d4e am 835a23cc: (-s ours) am 1923d4c0: Merge "deprecate TARGET_USES_LOGD"
* commit '835a23cc9caeeee7f591bd241dc88fbd205c7ef8':
2015-08-27 05:04:53 +00:00
Elliott Hughes
21b3d798e8 am c9bee108: (-s ours) am 4955cde2: Merge "Add a regression test for a fixed strnlen bug."
* commit 'c9bee108050ab367953f8f1d9cb73e837c1d06df':
2015-08-27 05:04:49 +00:00
Chih-hung Hsieh
8a955e1493 am c11758f2: (-s ours) am cebef1a7: Merge "Add one simple thread local storage test."
* commit 'c11758f2c9ff88d069c1fa22be5165220a07dc5c':
2015-08-27 05:04:47 +00:00
Christopher Ferris
741d5ae03d am e1f1a635: (-s ours) am e8ceb95c: Merge "Remove pushes from memsets (krait/cortex-a9)."
* commit 'e1f1a6353a4a537cca7ecc1a128bf98bf3790df1':
2015-08-27 05:04:44 +00:00
Yabin Cui
73a6ac348d am 0e63c39c: (-s ours) am 8af32633: Merge "add fortified implementations of fread/fwrite"
* commit '0e63c39cca56ae1d2b5877b6ffced3c6a4ca312b':
2015-08-27 05:04:41 +00:00
Elliott Hughes
273292a11a am d79de83b: (-s ours) am f16c6e17: Merge "Restore protection flags for ifunc during relocs."
* commit 'd79de83bfca0da705dbced60e0294f29da4aa63d':
2015-08-27 05:04:34 +00:00
Dmitriy Ivanov
a3b90f275a am ab6ca484: (-s ours) am de0fb393: Restore protection flags for ifunc during relocs.
* commit 'ab6ca484bd69842e9a56f01c7eef72e5368936d1':
2015-08-27 05:04:29 +00:00
Elliott Hughes
89722d9f65 am fd3cd1cc: (-s ours) am bff19682: Merge "name the atexit handler pages"
* commit 'fd3cd1cc2a508a8a70780253fbe60ef1798aca21':
2015-08-27 05:04:26 +00:00
Elliott Hughes
010563c886 am 7835c65c: (-s ours) am adc5795f: Merge "Use AT_PAGESZ for sysconf(_SC_PAGE_SIZE)."
* commit '7835c65ca777cd88b9ec656d780a7a48b591467f':
2015-08-27 05:04:24 +00:00
Christopher Ferris
f616c70e20 am dd3eb086: (-s ours) am a3a61983: Merge "Make all labels local."
* commit 'dd3eb0862e8a025783f952a32c3b785a255035c2':
2015-08-27 05:04:21 +00:00
Yabin Cui
fda41cce04 am 0bfe75bc: (-s ours) am b8320b80: Don\'t abort when failed to write tracing message.
* commit '0bfe75bc317d351404df13c560242dd3e44cf54b':
2015-08-27 05:04:11 +00:00
Yabin Cui
1ebd90caf1 am b9da7c15: (-s ours) am 9e1c862c: Merge "Don\'t abort when failed to write tracing message."
* commit 'b9da7c151df389426b379477676ddaceff43543a':
2015-08-27 05:04:09 +00:00
Yabin Cui
5ca7a74838 am c0c9704e: (-s ours) am 2565492d: Merge "Add getgrgid_r/getgrnam_r."
* commit 'c0c9704e1128bcc1e172e23032b63b7b31c75283':
2015-08-27 05:04:07 +00:00
Elliott Hughes
775339f00e am da24f8af: (-s ours) am 3b49d61a: Merge "libc: arch-x86: implement kernel vdso time functions"
* commit 'da24f8af38cb7829a3947ee320449c05f79f6a63':
2015-08-27 05:04:05 +00:00
Ying Wang
5f8b4eb2a8 am 9c4f3522: (-s ours) am 86ac443c: Merge "We don\'t have CXX_BARE any more"
* commit '9c4f35229df162e42a34aae94b3eb2e2436c4469':
2015-08-27 05:04:03 +00:00
Elliott Hughes
0931e46f64 am 2329b721: (-s ours) am bc0b8ff2: Merge "Use a less misleading name for the code that sets up the main thread."
* commit '2329b7218e2ca65767020f135b524d1c22957791':
2015-08-27 05:04:01 +00:00
Dan Albert
9405119369 am 8cc83e5c: (-s ours) am 7e52dbe4: Merge "Revert "Stop libc from cross-referencing unwind symbols"" into mnc-dev
* commit '8cc83e5c6669fe815d69abf9d3263425e751c741':
2015-08-27 05:03:59 +00:00
Ying Wang
8f137f06ea am 40e2b72f: (-s ours) am e39b279b: Merge "We don\'t have CXX_BARE any more" into mnc-dev
* commit '40e2b72fb30cd0aace5b85185e1d0989c9ff2e1a':
2015-08-27 05:03:57 +00:00
Christopher Ferris
3ff0bae759 am 953611ba: (-s ours) am aa55e7ad: Add support for non-zero vaddr in maps.
* commit '953611bae03e92e728226a729b990b9516914f9c':
2015-08-27 05:03:55 +00:00
Christopher Ferris
3a647e158d am a41556d3: (-s ours) am c99fabb7: Merge "Add support for non-zero vaddr in maps."
* commit 'a41556d398e3222d6e6d468c997a78c809c146fd':
2015-08-27 05:03:53 +00:00
Elliott Hughes
78f34b981e am ded55525: (-s ours) am 3bcfd47c: Merge "Revert "Revert "make vdso function pointers read-only at runtime"""
* commit 'ded555256d72c0f8491b5edc0e4550c45d61059d':
2015-08-27 05:03:51 +00:00
Dan Albert
930936ae7b am a645ebed: (-s ours) am f37c237b: Merge "Revert "Stop libc from cross-referencing unwind symbols""
* commit 'a645ebed9c42264f41bece4f9bf378ed37abc97b':
2015-08-27 05:03:49 +00:00
Dmitriy Ivanov
f98c881d8e am 8bdf8ab9: (-s ours) am e70d7a78: Merge "Fix dt_runpath test."
* commit '8bdf8ab97c59f6c0a0152d923dcb668681e4e031':
2015-08-27 05:03:47 +00:00
Elliott Hughes
70a5005ea6 am f8457c2d: (-s ours) am e5544ae1: Merge "<sys/time.h> should include [most of] <sys/select.h>."
* commit 'f8457c2d95e217f26553e8454f1e91673cf7ac8f':
2015-08-27 05:03:46 +00:00
Elliott Hughes
4110bb6452 am 6071a7b9: (-s ours) am 6c9ad82b: Merge "Revert "make vdso function pointers read-only at runtime""
* commit '6071a7b9ef107d0928588b9232c0bcbd4de82a53':
2015-08-27 05:03:44 +00:00
Elliott Hughes
f86b5a751c am ba1c89e9: (-s ours) am 4f2e1d3b: Merge "Add all the glibc one-line "synonym" header files."
* commit 'ba1c89e9b33c4bde320bcafcb564ac69c0303d92':
2015-08-27 05:03:42 +00:00
Elliott Hughes
93ec254b9e am 4ec3dcf8: (-s ours) am ca7bc509: Merge "make vdso function pointers read-only at runtime"
* commit '4ec3dcf8ecd34d6d530c94b0e45775eac43a92f4':
2015-08-27 05:03:40 +00:00
Dmitriy Ivanov
3d397fa661 am 436ff890: (-s ours) am a58d2498: Merge "Fix potential race condition on dlopen"
* commit '436ff890df2dedc6fc1083a8a71873a9731bb6c1':
2015-08-27 05:03:37 +00:00
Bertrand SIMONNET
09f2ae9b40 am df6eee9f: (-s ours) am 60bc9090: Merge "Add timespec/timeval conversion helpers."
* commit 'df6eee9f85d9482c9b561b6817fcfd8ce1a56d5c':
2015-08-27 05:03:35 +00:00
Dmitriy Ivanov
256e992517 am 0ee0dd8b: (-s ours) am cd588f84: Merge "Add constant for zip separator"
* commit '0ee0dd8b3d66e05a86ca12c35d16752b574bcad0':
2015-08-27 05:03:33 +00:00
Evgenii Stepanov
4972c73602 am fb186d55: (-s ours) am b3140904: Merge "Replace spaces with tabs in a Makefile."
* commit 'fb186d55e87c2c5817872fda81c29c18e9e0a22d':
2015-08-27 05:03:31 +00:00
Evgenii Stepanov
67e5c7f06f am 760345a9: (-s ours) am e9774a52: Merge "A special linker for ASan executables."
* commit '760345a959fdc9fbc849e6f72bbf386960f2d838':
2015-08-27 05:03:29 +00:00
Yabin Cui
9d4bfe17b9 am a89821ab: (-s ours) am 60a11dcb: Merge "Add test for an Android kernel bug about prctl."
* commit 'a89821abe3f2f3e763a95ac1e8e330fbbbca4996':
2015-08-27 05:03:27 +00:00
Christopher Ferris
eafe28f85a am bf880978: (-s ours) am a8d82f12: Merge "Update to v3.18.18 kernel headers."
* commit 'bf8809782ea6f13ae0c14750d53d5077e51c0205':
2015-08-27 05:03:25 +00:00
Christopher Ferris
74484e8bd4 am 72361125: (-s ours) am 5e3dc45a: Merge "Do not hold hash table lock while backtracing."
* commit '723611256117f2328101a1db4a7cad8ac8043978':
2015-08-27 05:03:20 +00:00
Christopher Ferris
ac02082fa0 am 6db9c199: (-s ours) am 43d35c35: Merge "Do not hold hash table lock while backtracing." into mnc-dev
* commit '6db9c199a81e8c104abc011246796faa22bfacc8':
2015-08-27 05:03:17 +00:00
Elliott Hughes
44cb343e4d am 45baf0f3: (-s ours) am 147a50d0: Merge "Prevent user-defined basename_r from breaking basename(3)."
* commit '45baf0f384e6e2cbaa5383765a8671a00c85ea55':
2015-08-27 05:03:15 +00:00
Neil Fuller
44808d163f am c64ed22e: (-s ours) am 64c82544: Merge "Update timezone data to 2015e" into mnc-dev
* commit 'c64ed22e9b7c341d7e95ce526b37aaacadd420e2':
2015-08-27 05:03:13 +00:00
Dmitriy Ivanov
91ceb2b70a am db996ae7: (-s ours) am a5bb841d: Fix memory-leak on soinfo_free()
* commit 'db996ae74c36e334899ad381d84a84c67cbe8bcc':
2015-08-27 05:03:11 +00:00
Dmitriy Ivanov
e875510e17 am 7974b834: (-s ours) am 880a2933: Merge "Fix memory-leak on soinfo_free()"
* commit '7974b83443d782c361f2bb92abfcdcba6dffa3c9':
2015-08-27 05:03:09 +00:00
Pirama Arumuga Nainar
9b8179fb7e am fcd01714: (-s ours) am d1e10d7d: Merge "Use delete[] to de-allocate pointers from new[]"
* commit 'fcd017148ba7ecf181f2f4065437c01c1c66cd4e':
2015-08-27 05:03:04 +00:00
Daniel Erat
22b9e685bc am 818295c3: (-s ours) am c6f25641: Merge "libc: Add sys/fcntl.h for compatibility."
* commit '818295c3f7e204baa1cd3f2d6e44c773dcd052af':
2015-08-27 05:03:02 +00:00
Evgenii Stepanov
9b484289e1 am b4f5d6d8: (-s ours) am 33ef6c20: Merge "Respect caller DT_RUNPATH in dlopen()."
* commit 'b4f5d6d89471ffc4cd5f528e95b4fbf869c339d5':
2015-08-27 05:02:59 +00:00
Christopher Ferris
82ff96be56 am ce302bff: (-s ours) am 90de6820: Merge "Replace bx lr with update of pc from the stack."
* commit 'ce302bff6ad655a46a04ef680d332b6ad72e2650':
2015-08-27 05:02:57 +00:00
Elliott Hughes
e75d37eb5a am b82a5a96: (-s ours) am 7a9732d6: Merge "Add some glibc-like #defines for libchrome."
* commit 'b82a5a96f8df82bc02878628d8549366bbe78fa0':
2015-08-27 05:02:53 +00:00
Elliott Hughes
0746d0f175 am 95997b69: (-s ours) am 89bbb846: Merge "Fix alignment after variable-length data."
* commit '95997b691f788c06b68710ad015c9dc668e7b91f':
2015-08-27 05:02:49 +00:00
Elliott Hughes
fca5c4413a am a6441ac5: (-s ours) am 65dd8582: Fix alignment after variable-length data.
* commit 'a6441ac5bf85d187aa47be7a22483c7d5d321599':
2015-08-27 05:02:45 +00:00
Elliott Hughes
12ec03e3af am 4059fcd2: (-s ours) am f542b309: Merge "Name the thread stack and signal stack guard pages."
* commit '4059fcd29ba2731b30001f7a8a12300431461cd3':
2015-08-27 05:02:40 +00:00
Chih-hung Hsieh
bfaee4bd6a Merge "Add test cases for __emutls_get_address." 2015-08-26 22:27:35 +00:00
Elliott Hughes
848808c660 Merge "Add preadv/pwritev." 2015-08-26 22:04:32 +00:00
Elliott Hughes
6f4594d5dc Add preadv/pwritev.
Bug: http://b/12612572
Change-Id: I38ff2684d69bd0fe3f21b1d371b88fa60d5421cb
2015-08-26 14:48:55 -07:00
Chih-Hung Hsieh
83380b5cf0 Add test cases for __emutls_get_address.
BUG: 22984770
Change-Id: I193c3612190260a08f3b3ad8b856c0ae8f94e03d
2015-08-26 13:10:14 -07:00
Christopher Ferris
6501864af4 am d518a6d3: Merge "Fix the 16 bit/32 bit instruction check for arm."
* commit 'd518a6d3bccc82cffb61fb7615b8ba09a564dec0':
  Fix the 16 bit/32 bit instruction check for arm.
2015-08-26 19:59:06 +00:00
Christopher Ferris
1154bcb3c0 am d518a6d3: Merge "Fix the 16 bit/32 bit instruction check for arm."
* commit 'd518a6d3bccc82cffb61fb7615b8ba09a564dec0':
  Fix the 16 bit/32 bit instruction check for arm.
2015-08-26 19:55:21 +00:00
Christopher Ferris
d518a6d3bc Merge "Fix the 16 bit/32 bit instruction check for arm." 2015-08-26 19:39:36 +00:00
Elliott Hughes
f2700df2ae am 629ed517: Merge "Add strchrnul."
* commit '629ed517126b3be32f2b2e8b710e63358691c296':
  Add strchrnul.
2015-08-26 18:43:58 +00:00
Elliott Hughes
7443dd5805 am 4d5c4f08: Merge "Add the missing aarch64 user structs."
* commit '4d5c4f085bc880af838d50f6bbd60d86e800b6e1':
  Add the missing aarch64 user structs.
2015-08-26 18:43:57 +00:00
Elliott Hughes
03deb8287b am 629ed517: Merge "Add strchrnul."
* commit '629ed517126b3be32f2b2e8b710e63358691c296':
  Add strchrnul.
2015-08-26 18:42:45 +00:00
Elliott Hughes
5f55f32e49 am 4d5c4f08: Merge "Add the missing aarch64 user structs."
* commit '4d5c4f085bc880af838d50f6bbd60d86e800b6e1':
  Add the missing aarch64 user structs.
2015-08-26 18:42:45 +00:00
Elliott Hughes
629ed51712 Merge "Add strchrnul." 2015-08-26 18:27:05 +00:00
Christopher Ferris
b72c9d80ab Fix the 16 bit/32 bit instruction check for arm.
The current code only looks for a branch, instead make this more
general.

Change-Id: Ib442d6f2f04074e274b320ca0cf04734cc78e5d2
2015-08-26 10:55:09 -07:00
Elliott Hughes
7ac3c128bb Add strchrnul.
Bug: http://b/18374026
Change-Id: Iea923309c090a51a2d41c5a83320ab3789f40f1c
2015-08-26 09:59:29 -07:00
Elliott Hughes
4d5c4f085b Merge "Add the missing aarch64 user structs." 2015-08-26 01:39:38 +00:00
Dan Albert
cc6461861e Don't re-export libunwind_llvm.
Change-Id: Ic16be4ada4cff374209d5eea89a7f81ed2fff398
2015-08-25 16:29:28 -07:00
Elliott Hughes
03f22465ae Add the missing aarch64 user structs.
Bug: http://b/23377194
Change-Id: I7d36717e129d2e044dc2cf24de4227c3bcdd60ce
2015-08-25 14:18:26 -07:00
Neil Fuller
cc4245a8de am 82911942: Update timezone data to 2015f
* commit '829119425bcc2b5fcec8fdf219026a5192c81234':
  Update timezone data to 2015f
2015-08-25 20:09:02 +00:00
Neil Fuller
1c751e5ec7 am 82911942: Update timezone data to 2015f
* commit '829119425bcc2b5fcec8fdf219026a5192c81234':
  Update timezone data to 2015f
2015-08-25 19:48:50 +00:00
Neil Fuller
58cf5d6b1d am 53f2abb5: Merge "Update timezone data to 2015f"
* commit '53f2abb5ffc103b9ea7fbe2fee13edead2553f3a':
  Update timezone data to 2015f
2015-08-25 18:55:00 +00:00
Neil Fuller
ff78def4fc am 53f2abb5: Merge "Update timezone data to 2015f"
* commit '53f2abb5ffc103b9ea7fbe2fee13edead2553f3a':
  Update timezone data to 2015f
2015-08-25 18:49:51 +00:00
Neil Fuller
53f2abb5ff Merge "Update timezone data to 2015f" 2015-08-25 18:31:26 +00:00
Neil Fuller
6e7bc700e2 Update timezone data to 2015f
Changes affecting future time stamps

    North Korea switches to +0830 on 2015-08-15.  (Thanks to Steffen Thorsen.)
    The abbreviation remains "KST".  (Thanks to Robert Elz.)

    Uruguay no longer observes DST.  (Thanks to Steffen Thorsen
    and Pablo Camargo.)

  Changes affecting past and future time stamps

    Moldova starts and ends DST at 00:00 UTC, not at 01:00 UTC.
    (Thanks to Roman Tudos.)

Bug: 23480367
Change-Id: I6a46b79be3a547d4af5f3f7ca1452640ed764e1c
2015-08-25 12:46:33 +01:00
Neil Fuller
650e66cd7e am f7286a26: Merge "Move tzdata scripts from bionic to external/icu"
* commit 'f7286a26deba0da370003eb97918176a69b6cfa6':
  Move tzdata scripts from bionic to external/icu
2015-08-25 10:04:12 +00:00
Neil Fuller
7336be0598 am f7286a26: Merge "Move tzdata scripts from bionic to external/icu"
* commit 'f7286a26deba0da370003eb97918176a69b6cfa6':
  Move tzdata scripts from bionic to external/icu
2015-08-25 10:04:11 +00:00
Neil Fuller
f7286a26de Merge "Move tzdata scripts from bionic to external/icu" 2015-08-25 09:22:36 +00:00
Elliott Hughes
1b22327893 am 5bf79420: Merge "Revert "Revert "Use compiler builtins for fabs."""
* commit '5bf7942008287381e6d2aa2216d9ded24f639142':
  Revert "Revert "Use compiler builtins for fabs.""
2015-08-24 23:23:14 +00:00
Elliott Hughes
0ed97d1b5f am 5bf79420: Merge "Revert "Revert "Use compiler builtins for fabs."""
* commit '5bf7942008287381e6d2aa2216d9ded24f639142':
  Revert "Revert "Use compiler builtins for fabs.""
2015-08-24 23:23:02 +00:00
Elliott Hughes
5bf7942008 Merge "Revert "Revert "Use compiler builtins for fabs.""" 2015-08-24 23:12:49 +00:00
Elliott Hughes
f9f4a432ee Revert "Revert "Use compiler builtins for fabs.""
Don't enable the inlines when building libm itself. Otherwise clang gets
upset by seeing both an inline and a non-inline definition.

This reverts commit c5deb0f883cbdca7e5ab75f92f82c31d21367f49.

Change-Id: If7abdb351f5a5549d6a331b33af408e8fcfa9868
2015-08-24 16:05:48 -07:00
Elliott Hughes
66a7be9961 am c868b4c3: Merge "Revert "Use compiler builtins for fabs.""
* commit 'c868b4c35184683fe74ff8c8d780d021c2b07464':
  Revert "Use compiler builtins for fabs."
2015-08-24 21:22:09 +00:00
Elliott Hughes
1a26555846 am c868b4c3: Merge "Revert "Use compiler builtins for fabs.""
* commit 'c868b4c35184683fe74ff8c8d780d021c2b07464':
  Revert "Use compiler builtins for fabs."
2015-08-24 21:22:06 +00:00
Elliott Hughes
c868b4c351 Merge "Revert "Use compiler builtins for fabs."" 2015-08-24 21:08:28 +00:00
Elliott Hughes
c5deb0f883 Revert "Use compiler builtins for fabs."
Use of "extern inline" breaks clang build.

This reverts commit d76f16973a9d06765fb1f482239b9559f893ffd0.

Change-Id: I995d0d38c3776f5c50b060f16770741c92a2acac
2015-08-24 21:08:13 +00:00
Josh Gao
5ad3ebf08d am 0f8f9300: Merge "Add exported __popcount_tab for libgcc compat under compiler-rt."
* commit '0f8f9300b84fff37088218c69cc13bdc489963eb':
  Add exported __popcount_tab for libgcc compat under compiler-rt.
2015-08-24 21:00:03 +00:00
Josh Gao
aad7f33e2a am fad8370c: Merge "Improve .clang-format."
* commit 'fad8370cfbf24c8913fc898950698c3675133e23':
  Improve .clang-format.
2015-08-24 21:00:02 +00:00
Josh Gao
ebcaf389cd am 0f8f9300: Merge "Add exported __popcount_tab for libgcc compat under compiler-rt."
* commit '0f8f9300b84fff37088218c69cc13bdc489963eb':
  Add exported __popcount_tab for libgcc compat under compiler-rt.
2015-08-24 20:59:46 +00:00
Josh Gao
df4492f339 am fad8370c: Merge "Improve .clang-format."
* commit 'fad8370cfbf24c8913fc898950698c3675133e23':
  Improve .clang-format.
2015-08-24 20:59:45 +00:00
Josh Gao
0f8f9300b8 Merge "Add exported __popcount_tab for libgcc compat under compiler-rt." 2015-08-24 20:49:05 +00:00
Josh Gao
fad8370cfb Merge "Improve .clang-format." 2015-08-24 20:47:46 +00:00
Elliott Hughes
b8c08f44ab am a19a9348: Merge "Use compiler builtins for fabs."
* commit 'a19a9348b7160ce967c70a9f4f38afede8dcafa9':
  Use compiler builtins for fabs.
2015-08-24 20:45:59 +00:00
Elliott Hughes
51b0bf03c0 am a19a9348: Merge "Use compiler builtins for fabs."
* commit 'a19a9348b7160ce967c70a9f4f38afede8dcafa9':
  Use compiler builtins for fabs.
2015-08-24 20:45:45 +00:00
Elliott Hughes
a19a9348b7 Merge "Use compiler builtins for fabs." 2015-08-24 20:33:15 +00:00
Elliott Hughes
d76f16973a Use compiler builtins for fabs.
Change-Id: Id3bf761d6dfc187f218b5215c53d76bddc83d50b
2015-08-24 13:32:40 -07:00
Josh Gao
06b3f70cfe Add exported __popcount_tab for libgcc compat under compiler-rt.
Change-Id: I8df09e8f199761edbba290d7f1ea530781054b03
2015-08-24 13:06:10 -07:00
Dan Albert
8c6b0d164e am a80ae8b8: Merge "Add a .clang-format file."
* commit 'a80ae8b84812d69ca63647262ab888b2f40d55a0':
  Add a .clang-format file.
2015-08-24 20:02:15 +00:00
Dan Albert
784ccf07bf am a80ae8b8: Merge "Add a .clang-format file."
* commit 'a80ae8b84812d69ca63647262ab888b2f40d55a0':
  Add a .clang-format file.
2015-08-24 20:00:37 +00:00
Josh Gao
8258cd7c1b Improve .clang-format.
Change-Id: Idfd7879cc3bf1a1cdbe33262c2506fac2f07b428
2015-08-24 13:00:13 -07:00
Dan Albert
a80ae8b848 Merge "Add a .clang-format file." 2015-08-24 19:47:16 +00:00
Dan Albert
6e68c07550 Add a .clang-format file.
Change-Id: I6c4c492d9b571dd654b4993d1de1827813963ce1
2015-08-24 11:27:58 -07:00
Neil Fuller
ac77536b79 Move tzdata scripts from bionic to external/icu
The scripts affect files in external/icu, bionic
and the generated files affect libcore. The files must
be updated together so there is no "obvious" home.

OEM developers seem to want to update ICU
themselves and have been asking how. Moving the
scripts to external/icu and splitting the ICU generation
code into a sub-script they can run makes some sense.

Bug: 23419215
Change-Id: Ia26fa526fd2b560a79f36d327a10e262a85db752
2015-08-24 18:25:05 +01:00
Nick Kralevich
f94b491c2b am 4d7d05bd: Merge "Revert "fix incompatibility with -fstack-protector-strong""
* commit '4d7d05bd60b1d0bc20c95dd764fc2d916a12bb74':
  Revert "fix incompatibility with -fstack-protector-strong"
2015-08-24 07:10:16 +00:00
Nick Kralevich
f17f8157b2 am 4d7d05bd: Merge "Revert "fix incompatibility with -fstack-protector-strong""
* commit '4d7d05bd60b1d0bc20c95dd764fc2d916a12bb74':
  Revert "fix incompatibility with -fstack-protector-strong"
2015-08-24 07:10:15 +00:00
Nick Kralevich
4d7d05bd60 Merge "Revert "fix incompatibility with -fstack-protector-strong"" 2015-08-24 06:59:43 +00:00
Nick Kralevich
3d01422272 Revert "fix incompatibility with -fstack-protector-strong"
Reports of devices not booting with a build range including
this patch. Reverting while I investigate.

This reverts commit 96dd2b6e85e03ca9ab2600c2031490c22d5626ad.

Bug: 23470962
Change-Id: I056f1d8668f52d31412868975f2143249fc7e8f0
2015-08-24 06:58:39 +00:00
Nick Kralevich
51d2579367 am 5f7a5125: Merge "fix incompatibility with -fstack-protector-strong"
* commit '5f7a5125a53951543e27276877fa6b71eb08a5d8':
  fix incompatibility with -fstack-protector-strong
2015-08-24 04:30:22 +00:00
Nick Kralevich
abd1975dcc am 5f7a5125: Merge "fix incompatibility with -fstack-protector-strong"
* commit '5f7a5125a53951543e27276877fa6b71eb08a5d8':
  fix incompatibility with -fstack-protector-strong
2015-08-24 04:29:15 +00:00
Nick Kralevich
5f7a5125a5 Merge "fix incompatibility with -fstack-protector-strong" 2015-08-23 16:21:18 +00:00
Yabin Cui
d54d116352 am 62c26ed9: Merge "add fortified implementations of write/pwrite{,64}"
* commit '62c26ed93e76ca9b3dd265f41eb3685ed2e72808':
  add fortified implementations of write/pwrite{,64}
2015-08-21 03:17:54 +00:00
Yabin Cui
6524806951 am 62c26ed9: Merge "add fortified implementations of write/pwrite{,64}"
* commit '62c26ed93e76ca9b3dd265f41eb3685ed2e72808':
  add fortified implementations of write/pwrite{,64}
2015-08-21 03:17:34 +00:00
Yabin Cui
62c26ed93e Merge "add fortified implementations of write/pwrite{,64}" 2015-08-21 03:03:22 +00:00
Elliott Hughes
21a285029b am 49715dcc: Merge "Fix a mistype in segment overrange checking"
* commit '49715dcc8a8be1b4545b91e453467e1c45343e51':
  Fix a mistype in segment overrange checking
2015-08-20 23:26:37 +00:00
Elliott Hughes
9835b61d63 am 49715dcc: Merge "Fix a mistype in segment overrange checking"
* commit '49715dcc8a8be1b4545b91e453467e1c45343e51':
  Fix a mistype in segment overrange checking
2015-08-20 23:26:19 +00:00
Elliott Hughes
49715dcc8a Merge "Fix a mistype in segment overrange checking" 2015-08-20 23:13:15 +00:00
Daniel Micay
afdd15456a add fortified implementations of write/pwrite{,64}
These are just based on the read/pread{,64} implementations with the
function calls and error messages adjusted as appropriate. The only
difference is that the buffer parameters are const.

Change-Id: Ida1597a903807f583f230d74bcedffdb7b24fcf6
2015-08-20 13:46:51 -04:00
Christopher Ferris
55cd7b0b76 am 079fc833: Merge "Modify ip to get the instr being executed."
* commit '079fc833137d5067c0cd3dc5211e72019314dd80':
  Modify ip to get the instr being executed.
2015-08-19 22:31:02 +00:00
Christopher Ferris
3c0d78d576 am 079fc833: Merge "Modify ip to get the instr being executed."
* commit '079fc833137d5067c0cd3dc5211e72019314dd80':
  Modify ip to get the instr being executed.
2015-08-19 22:20:21 +00:00
skvalex
93ce35434c Fix a mistype in segment overrange checking
Change-Id: Ibea93514aa7ba3b1ac2bc00420f5124fb34f5f66
Signed-off-by: skvalex <skvalex@gmail.com>
2015-08-20 01:06:42 +03:00
Christopher Ferris
079fc83313 Merge "Modify ip to get the instr being executed." 2015-08-19 18:25:38 +00:00
Dan Albert
af86eeecc9 am df0891ad: Merge "Add a TLS slot for TSAN."
* commit 'df0891adcfe97dd8e4c825ea6ea586cc5bd09ef6':
  Add a TLS slot for TSAN.
2015-08-18 22:57:57 +00:00
Dan Albert
4a8f4867fc am df0891ad: Merge "Add a TLS slot for TSAN."
* commit 'df0891adcfe97dd8e4c825ea6ea586cc5bd09ef6':
  Add a TLS slot for TSAN.
2015-08-18 22:55:41 +00:00
Dan Albert
df0891adcf Merge "Add a TLS slot for TSAN." 2015-08-18 22:43:47 +00:00
Christopher Ferris
224bef8ec4 Modify ip to get the instr being executed.
The ip values being reported are always pointing at the next
instruction to execute, not the currently executing instruction.
Change the ip address to point at the currently executing instruction.

This fixes a problem where the next instruction is not actually
part of the same function, so if an addr2line is used, it reports
the wrong value.

This does not modify the ip for mips.

Bug: 22565486
Change-Id: Ie0df4c9727f62ce06948b9a2b0e4b7956eb6e752
2015-08-18 15:41:31 -07:00
Dan Albert
aa23b2ee5e Add a TLS slot for TSAN.
This is so TSAN won't need to rely on pthread_getspecific for finding
the current thread state.

Change-Id: Id3befeabec0a9f7ca77b5549fbc427e22e6aaa34
2015-08-18 15:09:00 -07:00
Christopher Ferris
e6f16b2d7d am e4d51cf3: Merge "Add optimized cortex-a7/cortex-a53 memset/memcpy."
* commit 'e4d51cf37a861e258e423de14619982af51d2527':
  Add optimized cortex-a7/cortex-a53 memset/memcpy.
2015-08-18 17:33:46 +00:00
Christopher Ferris
888ad399ee am e4d51cf3: Merge "Add optimized cortex-a7/cortex-a53 memset/memcpy."
* commit 'e4d51cf37a861e258e423de14619982af51d2527':
  Add optimized cortex-a7/cortex-a53 memset/memcpy.
2015-08-18 17:33:22 +00:00
Christopher Ferris
e4d51cf37a Merge "Add optimized cortex-a7/cortex-a53 memset/memcpy." 2015-08-18 17:18:11 +00:00
Elliott Hughes
4400c1d448 am 4a8c4ce4: Merge "libc: remove bcopy from memmove on 64-bit architectures"
* commit '4a8c4ce403f702c0b8279873fae3d62497c4a123':
  libc: remove bcopy from memmove on 64-bit architectures
2015-08-18 00:39:54 +00:00
Elliott Hughes
37763e7a7a am 4a8c4ce4: Merge "libc: remove bcopy from memmove on 64-bit architectures"
* commit '4a8c4ce403f702c0b8279873fae3d62497c4a123':
  libc: remove bcopy from memmove on 64-bit architectures
2015-08-18 00:39:50 +00:00
Ying Wang
fa20d51e91 am 85197af9: Merge "Don\'t attach linker_asan to linker in module definition."
* commit '85197af92b52dd02caa7146ea5f47fad5cbc0101':
  Don't attach linker_asan to linker in module definition.
2015-08-18 00:24:04 +00:00
Elliott Hughes
4a8c4ce403 Merge "libc: remove bcopy from memmove on 64-bit architectures" 2015-08-18 00:23:49 +00:00
Ying Wang
e46c4212d6 am 85197af9: Merge "Don\'t attach linker_asan to linker in module definition."
* commit '85197af92b52dd02caa7146ea5f47fad5cbc0101':
  Don't attach linker_asan to linker in module definition.
2015-08-18 00:23:29 +00:00
Ying Wang
85197af92b Merge "Don't attach linker_asan to linker in module definition." 2015-08-18 00:07:03 +00:00
Ying Wang
d1afa661af Don't attach linker_asan to linker in module definition.
With this change, we only define the rules to create the symlinks in
this Android.mk but without attaching the symlinks to the module linker.
Instead the core build system will set up the dependency whenever a
module needs these symlinks.

Bug: 22850550
Change-Id: I36c58fd411f1c27f3f638b229699d7dc1d66abb2
2015-08-17 16:17:03 -07:00
Jake Weinstein
2926f9a31e libc: remove bcopy from memmove on 64-bit architectures
* bcopy is deprecated on LP64 by the following commit:

  ce9ce28e5d

Change-Id: I6849916f0ec4a2d0db9a360999ad1dc8edda952b
2015-08-17 22:06:12 +00:00
Christopher Ferris
5930772286 Add optimized cortex-a7/cortex-a53 memset/memcpy.
Add an optimized memset that is ~20% faster for cortex-a7 and
cortex-a53.

Add a 32 bit optimized cortex-a53 memcpy that is about ~20% faster
on cached data.

Fix the cortex-a15 __str{cat,cpy}_chk.S, memcpy_base.S to remove
the phony functions, since they aren't needed any more. Then add
a direct include of these for cortex-a53.

Verified the new functions by stepping through all of the major
paths and verifying the backtrace is still correct.

Bug: 22696180
Change-Id: Iec92a3f82d51243cca76c9aff9f35d920ff865ae
2015-08-17 13:02:03 -07:00
Elliott Hughes
3034028d7a am 6816d8cc: Merge "Use __builtin_* in <math.h>."
* commit '6816d8cc69dc1d142d722686d006f25df94afcd3':
  Use __builtin_* in <math.h>.
2015-08-14 23:47:49 +00:00
Elliott Hughes
6ac9e42958 am 6816d8cc: Merge "Use __builtin_* in <math.h>."
* commit '6816d8cc69dc1d142d722686d006f25df94afcd3':
  Use __builtin_* in <math.h>.
2015-08-14 23:47:34 +00:00
Elliott Hughes
6816d8cc69 Merge "Use __builtin_* in <math.h>." 2015-08-14 22:57:10 +00:00
Elliott Hughes
b662280aaf Use __builtin_* in <math.h>.
Also remove cruft meant to support long-obsolete compilers. More
benchmarks.

Bug: http://b/23195789
Change-Id: Ief538e41e77a77e8013b2f4f359584e8df2c47d8
2015-08-14 15:20:57 -07:00
Elliott Hughes
0ff5dda102 am dd8adc35: Merge "libm: ARM: reorganize a bit to match ARM64"
* commit 'dd8adc35346e671b3c3b2ecb26c13b84c742695c':
  libm: ARM: reorganize a bit to match ARM64
2015-08-14 21:24:04 +00:00
Elliott Hughes
12229387f4 am dd8adc35: Merge "libm: ARM: reorganize a bit to match ARM64"
* commit 'dd8adc35346e671b3c3b2ecb26c13b84c742695c':
  libm: ARM: reorganize a bit to match ARM64
2015-08-14 21:23:32 +00:00
Elliott Hughes
dd8adc3534 Merge "libm: ARM: reorganize a bit to match ARM64" 2015-08-14 21:09:26 +00:00
Jake Weinstein
8d959505bc libm: ARM: reorganize a bit to match ARM64
* Cleaner naming, especially if there are more ARM-specific routines in
  the future.

Change-Id: Id29db728800ccd612a906e86ccb95c1e7620514d
2015-08-13 23:02:10 +00:00
Elliott Hughes
ee6c6845c0 am b4f2112f: Merge "[MIPS] Invalidate cached pid in vfork."
* commit 'b4f2112fa99dab401cd65db4c524d95b1e97614e':
  [MIPS] Invalidate cached pid in vfork.
2015-08-12 03:02:38 +00:00
Elliott Hughes
1789ac90f7 am b4f2112f: Merge "[MIPS] Invalidate cached pid in vfork."
* commit 'b4f2112fa99dab401cd65db4c524d95b1e97614e':
  [MIPS] Invalidate cached pid in vfork.
2015-08-12 03:02:35 +00:00
Elliott Hughes
b4f2112fa9 Merge "[MIPS] Invalidate cached pid in vfork." 2015-08-12 02:28:25 +00:00
Duane Sand
61d9ae5ab1 [MIPS] Invalidate cached pid in vfork.
Bug: http://b/23008979
Change-Id: I43e0c7db42602441313af4607a992caa8c7d6221
2015-08-12 02:28:05 +00:00
Dan Albert
9423fb2375 am f2985ed8: Merge "Fix test steps for 64-bit bionic"
* commit 'f2985ed840af2d5572fafb03074f17afa516d967':
  Fix test steps for 64-bit bionic
2015-08-12 02:14:57 +00:00
Dan Albert
e7cf1de6b9 am f2985ed8: Merge "Fix test steps for 64-bit bionic"
* commit 'f2985ed840af2d5572fafb03074f17afa516d967':
  Fix test steps for 64-bit bionic
2015-08-12 02:11:05 +00:00
Dan Albert
f2985ed840 Merge "Fix test steps for 64-bit bionic" 2015-08-12 01:58:18 +00:00
Dan Albert
4c615501e5 am 2b934924: Merge "Add missing include."
* commit '2b93492478b497181edf51f5829b984c4e904e52':
  Add missing include.
2015-08-12 00:43:41 +00:00
Dan Albert
34afc42ae7 am 2b934924: Merge "Add missing include."
* commit '2b93492478b497181edf51f5829b984c4e904e52':
  Add missing include.
2015-08-12 00:43:03 +00:00
Dan Albert
2b93492478 Merge "Add missing include." 2015-08-12 00:28:07 +00:00
Duane Sand
a40a21110d Fix test steps for 64-bit bionic
Change-Id: Ibe76f22cdb5c0dbc69a24ffd0acffff89686ca35
2015-08-11 17:21:27 -07:00
Dan Albert
3fe1515e38 Add missing include.
libc++ cleaned up a leaky header.

Change-Id: I5ac0f43a075257a9138a82be379c9cffe96e0ab9
2015-08-11 16:46:26 -07:00
Yabin Cui
857336809e am 0660be89: am a6a12a78: am 0fdcdd00: Merge "Fix flaky test time.timer_settime_0." into lollipop-mr1-cts-dev
* commit '0660be899f2d907dedbcb643315b73e652ec9510':
  Fix flaky test time.timer_settime_0.
2015-08-11 19:32:20 +00:00
Yabin Cui
2bcb25c1c3 am 0660be89: am a6a12a78: am 0fdcdd00: Merge "Fix flaky test time.timer_settime_0." into lollipop-mr1-cts-dev
* commit '0660be899f2d907dedbcb643315b73e652ec9510':
  Fix flaky test time.timer_settime_0.
2015-08-11 19:10:33 +00:00
Dan Albert
ee8576d114 am a3c01467: Merge "Move up to C++14."
* commit 'a3c01467ecf31cab1410ce7b8554e2e77dae3309':
  Move up to C++14.
2015-08-11 00:00:14 +00:00
Dan Albert
4b99bef35b am a3c01467: Merge "Move up to C++14."
* commit 'a3c01467ecf31cab1410ce7b8554e2e77dae3309':
  Move up to C++14.
2015-08-10 23:59:12 +00:00
Dan Albert
a3c01467ec Merge "Move up to C++14." 2015-08-10 23:45:48 +00:00
Dan Albert
5341691955 Move up to C++14.
The default standard version is now ahead of us. Stop specifying C++11
so we get that too.

Change-Id: Ic96942cd7fd134118e29b744601b0119e49b6ac4
2015-08-10 16:40:06 -07:00
Yabin Cui
b23720dfc4 am ff4afc13: Merge "Omit comment when reading --gtest_list_tests option\'s output."
* commit 'ff4afc136ef5d00d33a611e7bc1950249db9fbcf':
  Omit comment when reading --gtest_list_tests option's output.
2015-08-10 22:22:47 +00:00
Yabin Cui
c23143a5fd am ff4afc13: Merge "Omit comment when reading --gtest_list_tests option\'s output."
* commit 'ff4afc136ef5d00d33a611e7bc1950249db9fbcf':
  Omit comment when reading --gtest_list_tests option's output.
2015-08-10 22:22:04 +00:00
Yabin Cui
ff4afc136e Merge "Omit comment when reading --gtest_list_tests option's output." 2015-08-10 22:01:07 +00:00
Elliott Hughes
23e0bdf7d4 am 182b91f6: Merge "Invalidate cached pid in vfork."
* commit '182b91f62809b03870f561a88135f5453966fe41':
  Invalidate cached pid in vfork.
2015-08-10 20:08:09 +00:00
Elliott Hughes
9a549011ad am 182b91f6: Merge "Invalidate cached pid in vfork."
* commit '182b91f62809b03870f561a88135f5453966fe41':
  Invalidate cached pid in vfork.
2015-08-10 20:08:08 +00:00
Elliott Hughes
182b91f628 Merge "Invalidate cached pid in vfork." 2015-08-10 19:47:11 +00:00
Yabin Cui
bf830ade7f Omit comment when reading --gtest_list_tests option's output.
Gtest add comments when listing typed tests. And we should omit them.

Bug: 23040880
Change-Id: If6034af301337fc06eeab294d2dbe5317a6b7f91
2015-08-10 12:12:39 -07:00
Elliott Hughes
5891abdc66 Invalidate cached pid in vfork.
Bug: http://b/23008979
Change-Id: I1dd900ac988cdbe10aad3abc53240c5d352891d5
2015-08-07 19:44:12 -07:00
Andreas Gampe
fd202300d8 am e80369ab: Merge "Bionic: Add a TLS slot for ART for Thread self"
* commit 'e80369ab0c484a99925a49a81ab0675538fab38a':
  Bionic: Add a TLS slot for ART for Thread self
2015-08-04 22:54:42 +00:00
Andreas Gampe
5e64d60690 am e80369ab: Merge "Bionic: Add a TLS slot for ART for Thread self"
* commit 'e80369ab0c484a99925a49a81ab0675538fab38a':
  Bionic: Add a TLS slot for ART for Thread self
2015-08-04 22:51:40 +00:00
Andreas Gampe
e80369ab0c Merge "Bionic: Add a TLS slot for ART for Thread self" 2015-08-04 22:35:34 +00:00
Elliott Hughes
711d7b9f90 am b3db7764: Merge "name the arc4random structure mappings"
* commit 'b3db7764d0757392c73c716423f49dc0809c5a23':
  name the arc4random structure mappings
2015-08-04 01:13:13 +00:00
Elliott Hughes
6a5a09be4e am b3db7764: Merge "name the arc4random structure mappings"
* commit 'b3db7764d0757392c73c716423f49dc0809c5a23':
  name the arc4random structure mappings
2015-08-04 01:12:55 +00:00
Elliott Hughes
b3db7764d0 Merge "name the arc4random structure mappings" 2015-08-04 00:58:57 +00:00
Elliott Hughes
d6edf15728 am f57f7945: Merge "Cherrypick upstream fnmatch.c fix."
* commit 'f57f7945159a0abbca248817d1d4af1e9d89e323':
  Cherrypick upstream fnmatch.c fix.
2015-08-03 21:46:53 +00:00
Elliott Hughes
3926593b36 am 2278d29a: Merge "[MIPS] Link .dex or .oat code lacking .MIPS.abiflags segment"
* commit '2278d29ada4cda53d81b87446254cea16e1b24fa':
  [MIPS] Link .dex or .oat code lacking .MIPS.abiflags segment
2015-08-03 19:32:35 +00:00
Elliott Hughes
65941221b5 am f57f7945: Merge "Cherrypick upstream fnmatch.c fix."
* commit 'f57f7945159a0abbca248817d1d4af1e9d89e323':
  Cherrypick upstream fnmatch.c fix.
2015-08-03 18:41:36 +00:00
Elliott Hughes
f57f794515 Merge "Cherrypick upstream fnmatch.c fix." 2015-08-03 18:22:42 +00:00
Elliott Hughes
17379d2b08 Cherrypick upstream fnmatch.c fix.
Bug: http://b/22855370
Change-Id: I3865cff1e2ffeb6709cea092be3770c1bebf1623
2015-08-03 11:11:22 -07:00
Yabin Cui
c028e4aaa3 am 7e919dae: Merge "add a fortified implementation of getcwd"
* commit '7e919daeaad62515ebbbf7b06badc77625a14d90':
  add a fortified implementation of getcwd
2015-08-03 18:02:03 +00:00
Elliott Hughes
dc181dd788 am 2278d29a: Merge "[MIPS] Link .dex or .oat code lacking .MIPS.abiflags segment"
* commit '2278d29ada4cda53d81b87446254cea16e1b24fa':
  [MIPS] Link .dex or .oat code lacking .MIPS.abiflags segment
2015-08-03 15:27:07 +00:00
Elliott Hughes
2278d29ada Merge "[MIPS] Link .dex or .oat code lacking .MIPS.abiflags segment" 2015-08-03 15:17:18 +00:00
Daniel Micay
516fcb28f2 name the arc4random structure mappings
Change-Id: I6e150e526f6ceee31aa9bd219fa45317d5a729cb
2015-08-02 19:22:26 -04:00
Elliott Hughes
90acccbd97 am 25907058: Merge "Sync current upstream fnmatch.c."
* commit '259070585820b4900622363dd7f968d6b644d75d':
  Sync current upstream fnmatch.c.
2015-08-01 15:48:05 +00:00
Elliott Hughes
52d8e318f9 am 61c21b63: Merge "Revert "add a fortified implementation of getcwd""
* commit '61c21b63bc1602bce8685757fb1c2a788cc9eb8d':
  Revert "add a fortified implementation of getcwd"
2015-08-01 15:47:56 +00:00
Yabin Cui
f11ff78db5 am 442a3fca: Merge "add a fortified implementation of getcwd"
* commit '442a3fcae68152a95ef481ef99932d1bc001dc08':
  add a fortified implementation of getcwd
2015-08-01 15:47:52 +00:00
Yabin Cui
993a2bee84 am 7e919dae: Merge "add a fortified implementation of getcwd"
* commit '7e919daeaad62515ebbbf7b06badc77625a14d90':
  add a fortified implementation of getcwd
2015-08-01 05:25:13 +00:00
Yabin Cui
7e919daeaa Merge "add a fortified implementation of getcwd" 2015-08-01 05:14:20 +00:00
Daniel Micay
9101b00400 add a fortified implementation of getcwd
Change-Id: Ice3e6d3e1ff07788305dc85f8ee4059baad5fac4
2015-08-01 00:42:30 -04:00
Duane Sand
0acb15ead6 [MIPS] Link .dex or .oat code lacking .MIPS.abiflags segment
This corrects an issue with mips32 Art on mips64r6 Android, where
Java ran slowly due to unintended use of kernel-trap emulation of
single-precision floating point registers. This also regressed all
Art tests due to an extra logcat line
    WARNING: linker: Using FRE=1 mode to run "..."

When targeting mips32r6, Art generates modeless or FR=1 floating point
code, same as Android's own native mips32r6 modules. So the trapping was
unneeded. Linker was confusing Art-generated modules with those from
old NDK compilers, which do need that trapping mode.

This linker filename check may become unnecessary, if Art learns how to
generate .MIPS.abiflags segments in its generated elf-like codefiles.

Change-Id: I18069d1234960c680c5df739514da09015a7fdb6
2015-07-31 13:55:42 -07:00
Elliott Hughes
5b916453f3 am 25907058: Merge "Sync current upstream fnmatch.c."
* commit '259070585820b4900622363dd7f968d6b644d75d':
  Sync current upstream fnmatch.c.
2015-07-31 18:16:55 +00:00
Elliott Hughes
2590705858 Merge "Sync current upstream fnmatch.c." 2015-07-31 18:04:38 +00:00
Elliott Hughes
c46c0e960d Sync current upstream fnmatch.c.
Bug: http://b/22855370
Change-Id: I589f849aaede3b69b6b3682989bab7d8649dcd97
2015-07-31 10:57:27 -07:00
Elliott Hughes
9d7c6a7e57 am 61c21b63: Merge "Revert "add a fortified implementation of getcwd""
* commit '61c21b63bc1602bce8685757fb1c2a788cc9eb8d':
  Revert "add a fortified implementation of getcwd"
2015-07-31 17:41:05 +00:00
Elliott Hughes
61c21b63bc Merge "Revert "add a fortified implementation of getcwd"" 2015-07-31 17:33:05 +00:00
Elliott Hughes
4c43aac9a5 Revert "add a fortified implementation of getcwd"
This reverts commit 89a121d43a274131cf9f84b0e685bebf1e70cc1b.

Change-Id: Ib6f6fd424acea68a063777e9f324405450e23316
2015-07-31 17:32:50 +00:00
Yabin Cui
4279bac26a am 442a3fca: Merge "add a fortified implementation of getcwd"
* commit '442a3fcae68152a95ef481ef99932d1bc001dc08':
  add a fortified implementation of getcwd
2015-07-31 17:11:27 +00:00
Yabin Cui
442a3fcae6 Merge "add a fortified implementation of getcwd" 2015-07-31 16:55:12 +00:00
Daniel Micay
89a121d43a add a fortified implementation of getcwd
Change-Id: I95001ae4fe8f206db83e5c44d129ba11310695ce
2015-07-30 17:16:40 -04:00
Elliott Hughes
19a8b3fc82 am 807f27f9: Merge "Stop sending SIGPIPE to debuggerd."
* commit '807f27f9548077f114dc009f60764fb0241a2620':
  Stop sending SIGPIPE to debuggerd.
2015-07-30 15:39:45 +00:00
Elliott Hughes
125481fe3c am 807f27f9: Merge "Stop sending SIGPIPE to debuggerd."
* commit '807f27f9548077f114dc009f60764fb0241a2620':
  Stop sending SIGPIPE to debuggerd.
2015-07-30 15:39:23 +00:00
Elliott Hughes
807f27f954 Merge "Stop sending SIGPIPE to debuggerd." 2015-07-30 15:10:59 +00:00
Elliott Hughes
9f03ed12a6 Stop sending SIGPIPE to debuggerd.
SIGPIPE is a pretty normal way for command-line apps to die, but because
we catch it and report it via debuggerd, we get a lot of bogus bugs. We
could catch SIGPIPE in our tools, but that's not really legit and slightly
misleading.

"But", you say, "catching SIGPIPE is useful for app bugs!". Except a trawl
through buganizer suggests it's misleading there too. Not least because
it's usually an innocent victim that dies --- the problem is usually on the
other end of the pipe (which you learn nothing about because that process
already died, which is what closed the pipe).

We also don't catch SIGALRM, which is another signal that will terminate
your process if you don't catch it, but that one actually represents a
logic error in the crashing process, so there's a stronger argument for
catching that. (Except it too is not a real source of bugs.)

Bug: http://b/20659371
Change-Id: I79820b36573ddaa9a7bad0561a52f23e7a8d15ac
2015-07-29 22:24:13 -07:00
Elliott Hughes
d473681fb1 am 44989174: Merge "Prevent buffer over-read in linker.cpp\'s parse_path."
* commit '4498917406ee543116ea7ed987d26a15b2c1496c':
  Prevent buffer over-read in linker.cpp's parse_path.
2015-07-30 00:51:02 +00:00
Elliott Hughes
73854d9f1a am 44989174: Merge "Prevent buffer over-read in linker.cpp\'s parse_path."
* commit '4498917406ee543116ea7ed987d26a15b2c1496c':
  Prevent buffer over-read in linker.cpp's parse_path.
2015-07-30 00:50:45 +00:00
Elliott Hughes
4498917406 Merge "Prevent buffer over-read in linker.cpp's parse_path." 2015-07-30 00:22:48 +00:00
tony.ys_liu
b447440a4b Prevent buffer over-read in linker.cpp's parse_path.
Also, the old behavior of skipping empty entries doesn't match glibc.

Change-Id: I497774377113ab6c5d962e0f20066e2192748f06
2015-07-29 17:21:30 -07:00
Elliott Hughes
45ea30c472 am 34c5f5ea: Merge "Remove PAGE_SIZE from <limits.h>."
* commit '34c5f5eacdedcea6b987854a4bca07c703495d62':
  Remove PAGE_SIZE from <limits.h>.
2015-07-29 15:58:32 +00:00
Elliott Hughes
89a64c0f2e am 34c5f5ea: Merge "Remove PAGE_SIZE from <limits.h>."
* commit '34c5f5eacdedcea6b987854a4bca07c703495d62':
  Remove PAGE_SIZE from <limits.h>.
2015-07-29 15:58:28 +00:00
Elliott Hughes
34c5f5eacd Merge "Remove PAGE_SIZE from <limits.h>." 2015-07-29 15:18:06 +00:00
Elliott Hughes
5c104603a0 am 374adfee: Merge "Don\'t transitively include <limits.h> from <sys/user.h>."
* commit '374adfee473725994ee2568ce5aba93a7500064e':
  Don't transitively include <limits.h> from <sys/user.h>.
2015-07-29 07:33:28 +00:00
Elliott Hughes
c5de153bc6 am 1ff4094a: Merge "Remove PAGESIZE."
* commit '1ff4094a7f106b3de390acb1e36c45bbb878a153':
  Remove PAGESIZE.
2015-07-29 07:33:25 +00:00
Elliott Hughes
73ca982c97 am 374adfee: Merge "Don\'t transitively include <limits.h> from <sys/user.h>."
* commit '374adfee473725994ee2568ce5aba93a7500064e':
  Don't transitively include <limits.h> from <sys/user.h>.
2015-07-29 07:17:51 +00:00
Elliott Hughes
475b542458 am 1ff4094a: Merge "Remove PAGESIZE."
* commit '1ff4094a7f106b3de390acb1e36c45bbb878a153':
  Remove PAGESIZE.
2015-07-29 07:17:48 +00:00
Elliott Hughes
36443fd542 Remove PAGE_SIZE from <limits.h>.
It turns out that everyone's still getting PAGE_SIZE from <sys/user.h> via
<sys/ucontext.h> via <signal.h> anyway.

glibc has PAGE_SIZE in <sys/user.h> rather than <limits.h> so this part is
good. The bad part is that we have such wide transitive inclusion of
<sys/user.h>!

Bug: http://b/22735893
Change-Id: I363adffe4a27b4ca1eedf695ea621f5dd2d5ca10
2015-07-28 19:54:53 -07:00
Andreas Gampe
9bbb5a7a09 Bionic: Add a TLS slot for ART for Thread self
To improve the performance of Thread::Current(), add a tls slot so
ART can avoid a pthreads call.

Change-Id: Icc86a2b7590734637366f9d5e41a5c6d18cc5772
2015-07-28 19:53:54 -07:00
Elliott Hughes
374adfee47 Merge "Don't transitively include <limits.h> from <sys/user.h>." 2015-07-29 01:02:37 +00:00
Elliott Hughes
5390173ad4 Don't transitively include <limits.h> from <sys/user.h>.
Bug: http://b/22735893
Change-Id: I27d0a1f7e2d477b8038e76bfc7fe05dd7e187344
2015-07-28 17:44:32 -07:00
Elliott Hughes
1ff4094a7f Merge "Remove PAGESIZE." 2015-07-29 00:09:20 +00:00
Elliott Hughes
a3c3a6b2df am c8ba22c8: Merge "Move PAGE_MASK into <sys/user.h>."
* commit 'c8ba22c847bd5bfc97d29a4c565fd32993200a01':
  Move PAGE_MASK into <sys/user.h>.
2015-07-29 00:05:13 +00:00
Elliott Hughes
cd6b01e214 am c8ba22c8: Merge "Move PAGE_MASK into <sys/user.h>."
* commit 'c8ba22c847bd5bfc97d29a4c565fd32993200a01':
  Move PAGE_MASK into <sys/user.h>.
2015-07-29 00:01:51 +00:00
Elliott Hughes
820a86f2df Remove PAGESIZE.
This was pretty much unused, and isn't in glibc.

Bug: http://b/22735893
Change-Id: If17f0dcd931c90ef1ccb134a3950c3b0011a03f4
2015-07-28 16:46:06 -07:00
Elliott Hughes
c8ba22c847 Merge "Move PAGE_MASK into <sys/user.h>." 2015-07-28 23:11:18 +00:00
Elliott Hughes
afab3ffcce Move PAGE_MASK into <sys/user.h>.
I'm removing the TODO on the assumption that being compatible with glibc
is more useful than BSD. The new internal "bionic_page.h" header factors
out some duplication between libc and the linker.

Bug: http://b/22735893
Change-Id: I4aec4dcba5886fb6f6b9290a8f85660643261321
2015-07-28 14:58:37 -07:00
Mark Salyzyn
6f0c9b4827 am 1923d4c0: Merge "deprecate TARGET_USES_LOGD"
* commit '1923d4c03a68c89f304b601545f5e8db026b9be0':
  deprecate TARGET_USES_LOGD
2015-07-28 19:51:17 +00:00
Mark Salyzyn
835a23cc9c am 1923d4c0: Merge "deprecate TARGET_USES_LOGD"
* commit '1923d4c03a68c89f304b601545f5e8db026b9be0':
  deprecate TARGET_USES_LOGD
2015-07-28 19:50:24 +00:00
Mark Salyzyn
1923d4c03a Merge "deprecate TARGET_USES_LOGD" 2015-07-28 17:48:08 +00:00
Mark Salyzyn
667dc75ee1 deprecate TARGET_USES_LOGD
This is not the kernel logger you are looking for

Bug: 22787659
Change-Id: I340d8bb5cdaa73be9565521681ee238b7033934b
2015-07-28 08:51:17 -07:00
Elliott Hughes
c9bee10805 am 4955cde2: Merge "Add a regression test for a fixed strnlen bug."
* commit '4955cde2c55d4860f12039a96d14fc756b1308a3':
  Add a regression test for a fixed strnlen bug.
2015-07-28 15:30:24 +00:00
Elliott Hughes
26ac060046 am 4955cde2: Merge "Add a regression test for a fixed strnlen bug."
* commit '4955cde2c55d4860f12039a96d14fc756b1308a3':
  Add a regression test for a fixed strnlen bug.
2015-07-28 15:27:25 +00:00
Elliott Hughes
4955cde2c5 Merge "Add a regression test for a fixed strnlen bug." 2015-07-28 14:55:50 +00:00
Elliott Hughes
d2a9fb3267 Add a regression test for a fixed strnlen bug.
Bug: https://code.google.com/p/android/issues/detail?id=74741
Change-Id: I78b0114bdbe8e680b0e938af608a634e73c86eda
2015-07-27 20:55:03 -07:00
Chih-hung Hsieh
d3d40b1531 am cebef1a7: Merge "Add one simple thread local storage test."
* commit 'cebef1a7812fe3552f12dd7e885a1f879a9946ed':
  Add one simple thread local storage test.
2015-07-28 02:02:20 +00:00
Chih-hung Hsieh
c11758f2c9 am cebef1a7: Merge "Add one simple thread local storage test."
* commit 'cebef1a7812fe3552f12dd7e885a1f879a9946ed':
  Add one simple thread local storage test.
2015-07-28 02:01:16 +00:00
Chih-hung Hsieh
cebef1a781 Merge "Add one simple thread local storage test." 2015-07-28 01:33:01 +00:00
Chih-Hung Hsieh
7656d0cec0 Add one simple thread local storage test.
This test should pass with gcc and fail with clang,
until clang/llvm supports emutls or Android linker supports
ELF TLS models.

BUG: 21082792
Change-Id: Id8c97da52c68ec230c7d26af703f6ed32d53a4fe
2015-07-27 17:20:19 -07:00
Christopher Ferris
e1f1a6353a am e8ceb95c: Merge "Remove pushes from memsets (krait/cortex-a9)."
* commit 'e8ceb95c680eacc3b5d16644a48a28b45f421e2f':
  Remove pushes from memsets (krait/cortex-a9).
2015-07-28 00:17:16 +00:00
Yabin Cui
0e63c39cca am 8af32633: Merge "add fortified implementations of fread/fwrite"
* commit '8af32633498184e58e6f8d5d75b9f9cdbef5b6be':
  add fortified implementations of fread/fwrite
2015-07-28 00:17:08 +00:00
Christopher Ferris
4f4dd3caae am e8ceb95c: Merge "Remove pushes from memsets (krait/cortex-a9)."
* commit 'e8ceb95c680eacc3b5d16644a48a28b45f421e2f':
  Remove pushes from memsets (krait/cortex-a9).
2015-07-27 23:33:21 +00:00
Yabin Cui
98fc81cf5e am 8af32633: Merge "add fortified implementations of fread/fwrite"
* commit '8af32633498184e58e6f8d5d75b9f9cdbef5b6be':
  add fortified implementations of fread/fwrite
2015-07-27 23:14:45 +00:00
Christopher Ferris
e8ceb95c68 Merge "Remove pushes from memsets (krait/cortex-a9)." 2015-07-27 23:09:32 +00:00
Yabin Cui
8af3263349 Merge "add fortified implementations of fread/fwrite" 2015-07-27 22:46:29 +00:00
Dmitriy Ivanov
e6464678b3 am de0fb393: Restore protection flags for ifunc during relocs.
* commit 'de0fb393ae8136a5958fe17eee0c6285e2f7f91a':
  Restore protection flags for ifunc during relocs.
2015-07-27 22:23:32 +00:00
Elliott Hughes
291c314005 am f16c6e17: Merge "Restore protection flags for ifunc during relocs."
* commit 'f16c6e17b22c278320d0e662d1f1e1213f8fbc71':
  Restore protection flags for ifunc during relocs.
2015-07-27 22:02:23 +00:00
Elliott Hughes
d79de83bfc am f16c6e17: Merge "Restore protection flags for ifunc during relocs."
* commit 'f16c6e17b22c278320d0e662d1f1e1213f8fbc71':
  Restore protection flags for ifunc during relocs.
2015-07-27 22:01:48 +00:00
Dmitriy Ivanov
ab6ca484bd am de0fb393: Restore protection flags for ifunc during relocs.
* commit 'de0fb393ae8136a5958fe17eee0c6285e2f7f91a':
  Restore protection flags for ifunc during relocs.
2015-07-27 21:39:11 +00:00
Elliott Hughes
f16c6e17b2 Merge "Restore protection flags for ifunc during relocs." 2015-07-27 21:34:53 +00:00
Christopher Ferris
8264cbba7e Remove pushes from memsets (krait/cortex-a9).
On the path that only uses r0 in both the krait and cortex-a9
memset, remove the push and use r3 instead.

In addition, for cortex-a9, remove the artificial function since
it's not needed since dwarf unwinding is now supported on arm.

Change-Id: Ia4ed1cc435b03627a7193215e76c8ea3335f949a
2015-07-27 14:07:37 -07:00
Elliott Hughes
9816016893 am bff19682: Merge "name the atexit handler pages"
* commit 'bff196822230b5a8b1f5bafeed88ded821d390a9':
  name the atexit handler pages
2015-07-27 18:50:47 +00:00
Elliott Hughes
fd3cd1cc2a am bff19682: Merge "name the atexit handler pages"
* commit 'bff196822230b5a8b1f5bafeed88ded821d390a9':
  name the atexit handler pages
2015-07-27 18:32:37 +00:00
Elliott Hughes
bff1968222 Merge "name the atexit handler pages" 2015-07-27 18:06:35 +00:00
Daniel Micay
f0a73476a1 name the atexit handler pages
Change-Id: I1718ddee7415a673b5818bc1455b8d90f1e8f9c6
2015-07-27 11:04:58 -07:00
Dmitriy Ivanov
ec83a61c8b Restore protection flags for ifunc during relocs.
IFUNC relocations require executable flag for the load
segment containing .text. When dso has text relocs linker
removes exec which causes crash during ifunc relocations.

This patch fixes this problem by restoring segments protection
for ifunc relocs.

Bug: http://b/22611399
Change-Id: Icbf3be0fec0e42bf805bcad7533e2032a2e11b9c
(cherry picked from commit de0fb393ae8136a5958fe17eee0c6285e2f7f91a)
2015-07-26 08:23:01 -07:00
Elliott Hughes
7835c65ca7 am adc5795f: Merge "Use AT_PAGESZ for sysconf(_SC_PAGE_SIZE)."
* commit 'adc5795fb7b674e6d40d1f190c675607c1379343':
  Use AT_PAGESZ for sysconf(_SC_PAGE_SIZE).
2015-07-25 18:58:57 +00:00
Elliott Hughes
e9f23862fe am adc5795f: Merge "Use AT_PAGESZ for sysconf(_SC_PAGE_SIZE)."
* commit 'adc5795fb7b674e6d40d1f190c675607c1379343':
  Use AT_PAGESZ for sysconf(_SC_PAGE_SIZE).
2015-07-25 18:56:53 +00:00
Elliott Hughes
adc5795fb7 Merge "Use AT_PAGESZ for sysconf(_SC_PAGE_SIZE)." 2015-07-25 18:32:46 +00:00
Elliott Hughes
189394b885 Use AT_PAGESZ for sysconf(_SC_PAGE_SIZE).
Bug: http://b/18342333
Change-Id: Id12ed4e85a0f35d7d27202f7792df42a65a74b4e
2015-07-24 23:22:07 -07:00
Yabin Cui
22091a09ae am b8320b80: Don\'t abort when failed to write tracing message.
* commit 'b8320b8021856ae61b3012b82c2ae96df97e3ec4':
  Don't abort when failed to write tracing message.
2015-07-24 04:16:39 +00:00
Christopher Ferris
dd3eb0862e am a3a61983: Merge "Make all labels local."
* commit 'a3a619835d302f5414883e2307ca48406b15a4a5':
  Make all labels local.
2015-07-24 01:17:28 +00:00
Christopher Ferris
beebbff0a0 am a3a61983: Merge "Make all labels local."
* commit 'a3a619835d302f5414883e2307ca48406b15a4a5':
  Make all labels local.
2015-07-24 01:17:09 +00:00
Christopher Ferris
a3a619835d Merge "Make all labels local." 2015-07-24 00:47:06 +00:00
Daniel Micay
fed2659869 add fortified implementations of fread/fwrite
A __size_mul_overflow utility is used to take advantage of the checked
overflow intrinsics in Clang and GCC (>= 5). The fallback for older
compilers is the optimized but less than ideal overflow checking pattern
used in OpenBSD.

Change-Id: Ibb0d4fd9b5acb67983e6a9f46844c2fd444f7e69
2015-07-23 18:55:46 -04:00
Yabin Cui
0bfe75bc31 am b8320b80: Don\'t abort when failed to write tracing message.
* commit 'b8320b8021856ae61b3012b82c2ae96df97e3ec4':
  Don't abort when failed to write tracing message.
2015-07-23 22:42:23 +00:00
Dan Albert
c9d373e2d9 am 7e52dbe4: Merge "Revert "Stop libc from cross-referencing unwind symbols"" into mnc-dev
* commit '7e52dbe4d24daf61a8bd4bbbd0761c55468c3c7e':
  Revert "Stop libc from cross-referencing unwind symbols"
2015-07-23 21:50:48 +00:00
Christopher Ferris
795a8e3d69 Make all labels local.
Change the non-local labels to .L labels.

Change-Id: I720e894f2e311af8f4a0970303d8b86575fb69a5
2015-07-23 12:12:55 -07:00
Yabin Cui
bb65e61f6b am 9e1c862c: Merge "Don\'t abort when failed to write tracing message."
* commit '9e1c862cb649f054aaa1c2141409387bf3d5f3eb':
  Don't abort when failed to write tracing message.
2015-07-23 19:10:22 +00:00
Yabin Cui
b9da7c151d am 9e1c862c: Merge "Don\'t abort when failed to write tracing message."
* commit '9e1c862cb649f054aaa1c2141409387bf3d5f3eb':
  Don't abort when failed to write tracing message.
2015-07-23 18:53:37 +00:00
Yabin Cui
9e1c862cb6 Merge "Don't abort when failed to write tracing message." 2015-07-23 17:20:30 +00:00
Yabin Cui
c0c9704e11 am 2565492d: Merge "Add getgrgid_r/getgrnam_r."
* commit '2565492db0d67b95348cd1c3026ed338ca59aa37':
  Add getgrgid_r/getgrnam_r.
2015-07-23 02:06:56 +00:00
Elliott Hughes
da24f8af38 am 3b49d61a: Merge "libc: arch-x86: implement kernel vdso time functions"
* commit '3b49d61ac2f7a02d5e7f25a24836b060f922f079':
  libc: arch-x86: implement kernel vdso time functions
2015-07-23 02:06:55 +00:00
Ying Wang
9c4f35229d am 86ac443c: Merge "We don\'t have CXX_BARE any more"
* commit '86ac443cd1df83bbef4a18046714e067a9d13247':
  We don't have CXX_BARE any more
2015-07-23 02:06:19 +00:00
Elliott Hughes
2329b7218e am bc0b8ff2: Merge "Use a less misleading name for the code that sets up the main thread."
* commit 'bc0b8ff2fbfb38f73114aef7df8e302025245441':
  Use a less misleading name for the code that sets up the main thread.
2015-07-23 02:06:17 +00:00
Yabin Cui
1661125315 Don't abort when failed to write tracing message.
Also make the code thread-safe with lock.

Bug: 20666100
Change-Id: I0f331a617b75280f36179c187418450230d713ef
2015-07-22 18:24:53 -07:00
Dan Albert
8cc83e5c66 am 7e52dbe4: Merge "Revert "Stop libc from cross-referencing unwind symbols"" into mnc-dev
* commit '7e52dbe4d24daf61a8bd4bbbd0761c55468c3c7e':
  Revert "Stop libc from cross-referencing unwind symbols"
2015-07-22 20:17:30 +00:00
Yabin Cui
758bc0a806 am 2565492d: Merge "Add getgrgid_r/getgrnam_r."
* commit '2565492db0d67b95348cd1c3026ed338ca59aa37':
  Add getgrgid_r/getgrnam_r.
2015-07-22 03:44:16 +00:00
Yabin Cui
2565492db0 Merge "Add getgrgid_r/getgrnam_r." 2015-07-22 03:22:26 +00:00
Yabin Cui
c4786d366b Add getgrgid_r/getgrnam_r.
Bug: 22568551
Change-Id: I3c0772d119d6041063c6be53f5bcc5ea1768f0d5
2015-07-21 19:33:34 -07:00
Elliott Hughes
cf3d602b28 am 3b49d61a: Merge "libc: arch-x86: implement kernel vdso time functions"
* commit '3b49d61ac2f7a02d5e7f25a24836b060f922f079':
  libc: arch-x86: implement kernel vdso time functions
2015-07-22 02:12:02 +00:00
Elliott Hughes
3b49d61ac2 Merge "libc: arch-x86: implement kernel vdso time functions" 2015-07-22 01:51:00 +00:00
Robert Jarzmik
10726d52ac libc: arch-x86: implement kernel vdso time functions
This patch give the possibility of time vdso support on 32bit kernel.
If the 32bit x86 kernel provides gettimeofday() and clock_gettime()
primitives in vdso. In this case make bionic use them. If the kernel
doesn't provide them, fallback to the legacy system call versions.

Change-Id: I87b772a9486fa356903e1f98f486ab9eb0b6f6f7
Signed-off-by: Robert Jarzmik <robert.jarzmik@intel.com>
Signed-off-by: Mingwei Shi <mingwei.shi@intel.com>
2015-07-22 01:31:38 +00:00
Ying Wang
788e7c9937 am e39b279b: Merge "We don\'t have CXX_BARE any more" into mnc-dev
* commit 'e39b279bb4971d0c3322214ea977275f1bc58c0b':
  We don't have CXX_BARE any more
2015-07-21 21:50:27 +00:00
Ying Wang
e16cf1d531 am 86ac443c: Merge "We don\'t have CXX_BARE any more"
* commit '86ac443cd1df83bbef4a18046714e067a9d13247':
  We don't have CXX_BARE any more
2015-07-21 21:40:44 +00:00
Ying Wang
86ac443cd1 Merge "We don't have CXX_BARE any more" 2015-07-21 21:10:23 +00:00
Ying Wang
361d4b4c87 We don't have CXX_BARE any more
Now we have split CXX_WRAPPER from TARGET_CXX and CXX_BARE isn't needed
any more.

Bug: 22612634
Change-Id: I52c78b0d1b325910e875a786d17f780731778b4b
(cherry-pick from commit 9d11a7087c860195bf23f2825a7fe70d43ff7b78)
2015-07-21 14:08:42 -07:00
Ying Wang
40e2b72fb3 am e39b279b: Merge "We don\'t have CXX_BARE any more" into mnc-dev
* commit 'e39b279bb4971d0c3322214ea977275f1bc58c0b':
  We don't have CXX_BARE any more
2015-07-21 21:01:46 +00:00
Elliott Hughes
41298d1aae am bc0b8ff2: Merge "Use a less misleading name for the code that sets up the main thread."
* commit 'bc0b8ff2fbfb38f73114aef7df8e302025245441':
  Use a less misleading name for the code that sets up the main thread.
2015-07-21 20:53:23 +00:00
Elliott Hughes
bc0b8ff2fb Merge "Use a less misleading name for the code that sets up the main thread." 2015-07-21 20:28:17 +00:00
Christopher Ferris
bbfdd50518 am aa55e7ad: Add support for non-zero vaddr in maps.
* commit 'aa55e7ad249e49025d0507f513a6c45f8491a4e5':
  Add support for non-zero vaddr in maps.
2015-07-21 19:46:36 +00:00
Christopher Ferris
953611bae0 am aa55e7ad: Add support for non-zero vaddr in maps.
* commit 'aa55e7ad249e49025d0507f513a6c45f8491a4e5':
  Add support for non-zero vaddr in maps.
2015-07-21 19:05:24 +00:00
Elliott Hughes
d29486343a Use a less misleading name for the code that sets up the main thread.
Change-Id: I50c1b0a3b633cf8bc40a6bd86f12adb6b91e2888
2015-07-21 11:57:09 -07:00
Christopher Ferris
e47102098b am c99fabb7: Merge "Add support for non-zero vaddr in maps."
* commit 'c99fabb7a097e9aeed49ce03584cce113d086905':
  Add support for non-zero vaddr in maps.
2015-07-21 18:28:52 +00:00
Elliott Hughes
c2b097252a am 3bcfd47c: Merge "Revert "Revert "make vdso function pointers read-only at runtime"""
* commit '3bcfd47c6836a952b2093c64feb9f1e382891256':
  Revert "Revert "make vdso function pointers read-only at runtime""
2015-07-21 18:28:13 +00:00
Christopher Ferris
a41556d398 am c99fabb7: Merge "Add support for non-zero vaddr in maps."
* commit 'c99fabb7a097e9aeed49ce03584cce113d086905':
  Add support for non-zero vaddr in maps.
2015-07-21 18:26:13 +00:00
Elliott Hughes
ded555256d am 3bcfd47c: Merge "Revert "Revert "make vdso function pointers read-only at runtime"""
* commit '3bcfd47c6836a952b2093c64feb9f1e382891256':
  Revert "Revert "make vdso function pointers read-only at runtime""
2015-07-21 18:25:35 +00:00
Christopher Ferris
c99fabb7a0 Merge "Add support for non-zero vaddr in maps." 2015-07-21 17:29:10 +00:00
Dan Albert
5905cee174 am f37c237b: Merge "Revert "Stop libc from cross-referencing unwind symbols""
* commit 'f37c237b8b15c00ac748fe2657a50df54fa55d5a':
  Revert "Stop libc from cross-referencing unwind symbols"
2015-07-21 02:35:27 +00:00
Dan Albert
a645ebed9c am f37c237b: Merge "Revert "Stop libc from cross-referencing unwind symbols""
* commit 'f37c237b8b15c00ac748fe2657a50df54fa55d5a':
  Revert "Stop libc from cross-referencing unwind symbols"
2015-07-21 02:34:52 +00:00
Elliott Hughes
3bcfd47c68 Merge "Revert "Revert "make vdso function pointers read-only at runtime""" 2015-07-21 02:15:21 +00:00
Dan Albert
f37c237b8b Merge "Revert "Stop libc from cross-referencing unwind symbols"" 2015-07-21 00:22:21 +00:00
Dan Albert
95fd031c4d Revert "Stop libc from cross-referencing unwind symbols"
This reverts commit cd13b14e98d4921af126667fae0cf6613a5615c5.

Bug: http://b/19958712
Change-Id: I7cc7f69728c42c37e129aee30d761c4cd7e30e94
2015-07-20 16:57:11 -07:00
Elliott Hughes
613f814508 Revert "Revert "make vdso function pointers read-only at runtime""
This reverts commit 1946856b1f18a27c51ba30bb9e304f25b722ee05.

This goes back to the original scheme of PROT_NONEing a page within
libc. Allocating a new page didn't fail safe for cases where these
functions are called from the dynamic linker.

Bug: http://b/22568628
Change-Id: I3e7241c8b54c27ea4a898bc952375c1e9ae38c80
2015-07-20 15:59:33 -07:00
Dmitriy Ivanov
d2aeefed8e am e70d7a78: Merge "Fix dt_runpath test."
* commit 'e70d7a78f0bfba8b09d37c145769cb8d1d7c5fb6':
  Fix dt_runpath test.
2015-07-20 19:17:27 +00:00
Dmitriy Ivanov
8bdf8ab97c am e70d7a78: Merge "Fix dt_runpath test."
* commit 'e70d7a78f0bfba8b09d37c145769cb8d1d7c5fb6':
  Fix dt_runpath test.
2015-07-20 19:17:02 +00:00
Elliott Hughes
2733ec035d am e5544ae1: Merge "<sys/time.h> should include [most of] <sys/select.h>."
* commit 'e5544ae1f8a23ae77908e822e83a73ebd4b656ec':
  <sys/time.h> should include [most of] <sys/select.h>.
2015-07-20 18:44:56 +00:00
Elliott Hughes
039b290b9d am 6c9ad82b: Merge "Revert "make vdso function pointers read-only at runtime""
* commit '6c9ad82b1c0f26f5edb5d5ca246b88451c5ea238':
  Revert "make vdso function pointers read-only at runtime"
2015-07-20 18:44:55 +00:00
Elliott Hughes
f8457c2d95 am e5544ae1: Merge "<sys/time.h> should include [most of] <sys/select.h>."
* commit 'e5544ae1f8a23ae77908e822e83a73ebd4b656ec':
  <sys/time.h> should include [most of] <sys/select.h>.
2015-07-20 18:44:00 +00:00
Elliott Hughes
6071a7b9ef am 6c9ad82b: Merge "Revert "make vdso function pointers read-only at runtime""
* commit '6c9ad82b1c0f26f5edb5d5ca246b88451c5ea238':
  Revert "make vdso function pointers read-only at runtime"
2015-07-20 18:43:59 +00:00
Dmitriy Ivanov
e70d7a78f0 Merge "Fix dt_runpath test." 2015-07-20 18:31:09 +00:00
Dmitriy Ivanov
3fef96f827 Fix dt_runpath test.
Bfd linker produces DT_RPATH instead of DT_RUNPATH
unless --enable-new-dtags option is specified.

Bug: http://b/22560945
Change-Id: I71bdc5137b899ab736e55c5a9574cfbba8e1983b
2015-07-20 10:47:49 -07:00
Elliott Hughes
e5544ae1f8 Merge "<sys/time.h> should include [most of] <sys/select.h>." 2015-07-20 17:36:53 +00:00
Elliott Hughes
6c9ad82b1c Merge "Revert "make vdso function pointers read-only at runtime"" 2015-07-20 17:30:50 +00:00
Elliott Hughes
1946856b1f Revert "make vdso function pointers read-only at runtime"
This reverts commit df1a3c6d21702e3e96cfcddadee4a50bfac82110.

This change prevented N9 from booting (http://b/22568628).

Change-Id: I071d6d6a0ae7881d65641839e665acdcf58462b4
2015-07-20 17:30:33 +00:00
Elliott Hughes
a7a87dda4a <sys/time.h> should include [most of] <sys/select.h>.
Found by trying to build c-ares with bionic.

Change-Id: I38684abcb806ef1e8806c68b4a6dd9200f48849e
2015-07-17 19:10:24 -07:00
Elliott Hughes
af584b5e7b am 4f2e1d3b: Merge "Add all the glibc one-line "synonym" header files."
* commit '4f2e1d3b1e3b3729b551c22c5a0be8d07795adfd':
  Add all the glibc one-line "synonym" header files.
2015-07-17 22:04:59 +00:00
Elliott Hughes
ba1c89e9b3 am 4f2e1d3b: Merge "Add all the glibc one-line "synonym" header files."
* commit '4f2e1d3b1e3b3729b551c22c5a0be8d07795adfd':
  Add all the glibc one-line "synonym" header files.
2015-07-17 22:04:41 +00:00
Elliott Hughes
4f2e1d3b1e Merge "Add all the glibc one-line "synonym" header files." 2015-07-17 21:42:03 +00:00
Elliott Hughes
2cc41d3e00 Add all the glibc one-line "synonym" header files.
Ported code keeps needing these one by one, so let's just add the whole
set...

Change-Id: I9662b256aeaa1b0ffb22354130e503f0c4aa472b
2015-07-17 13:59:36 -07:00
Elliott Hughes
87b64fb447 am ca7bc509: Merge "make vdso function pointers read-only at runtime"
* commit 'ca7bc509cf3b321b4721137df1e5407415fc7dd7':
  make vdso function pointers read-only at runtime
2015-07-17 18:39:31 +00:00
Elliott Hughes
4ec3dcf8ec am ca7bc509: Merge "make vdso function pointers read-only at runtime"
* commit 'ca7bc509cf3b321b4721137df1e5407415fc7dd7':
  make vdso function pointers read-only at runtime
2015-07-17 18:39:05 +00:00
Dmitriy Ivanov
436ff890df am a58d2498: Merge "Fix potential race condition on dlopen"
* commit 'a58d24984045b474883ad14500a465ab331db47d':
  Fix potential race condition on dlopen
2015-07-17 18:18:14 +00:00
Dmitriy Ivanov
c6a87cc8cb am a58d2498: Merge "Fix potential race condition on dlopen"
* commit 'a58d24984045b474883ad14500a465ab331db47d':
  Fix potential race condition on dlopen
2015-07-17 18:17:06 +00:00
Elliott Hughes
ca7bc509cf Merge "make vdso function pointers read-only at runtime" 2015-07-17 18:13:31 +00:00
Daniel Micay
df1a3c6d21 make vdso function pointers read-only at runtime
Global, writable function pointers are low-hanging fruit for hijacking
control flow with an overflow from a global buffer or an arbitrary write
vulnerability. This moves the function pointer table into a dedicated
page and makes it read-only at runtime, similar to RELRO.

This increases the memory usage of the library by just under one page.
This could be avoided by having the linker load the vdso by replacing
weak symbols. It's not significant within the Zygote spawning model
though because it's read-only after early init.

Change-Id: Id7a49c96c1b15c2e1926528304b3c54a81e78caf
2015-07-17 11:11:42 -07:00
Dmitriy Ivanov
a58d249840 Merge "Fix potential race condition on dlopen" 2015-07-17 17:49:21 +00:00
Dmitriy Ivanov
e5cfafe344 Fix potential race condition on dlopen
Call to find_containing_library should be guarded.

Change-Id: I985a903da48b83bcd35e957a979158eb9b80e70b
2015-07-17 10:36:10 -07:00
Bertrand SIMONNET
cca803af0c am 60bc9090: Merge "Add timespec/timeval conversion helpers."
* commit '60bc90909a49121789bf86f5d14f63967e8000e0':
  Add timespec/timeval conversion helpers.
2015-07-16 22:27:51 +00:00
Christopher Ferris
70b6e1daff Add support for non-zero vaddr in maps.
If a map has a non-zero vaddr then it needs to be added to the
computed relative offset.

Bug: 22532054
Change-Id: If55015165d25ecc4b530f674b481c8c7ef760a23
2015-07-16 15:25:39 -07:00
Bertrand SIMONNET
df6eee9f85 am 60bc9090: Merge "Add timespec/timeval conversion helpers."
* commit '60bc90909a49121789bf86f5d14f63967e8000e0':
  Add timespec/timeval conversion helpers.
2015-07-16 22:25:25 +00:00
Bertrand SIMONNET
60bc90909a Merge "Add timespec/timeval conversion helpers." 2015-07-16 21:53:26 +00:00
Daniel Micay
96dd2b6e85 fix incompatibility with -fstack-protector-strong
The __libc_init_tls function in libc_init_common.cpp takes a reference
to a local variable so it ends up being protected. Since this happens
before TLS and the stack guard value are initialized, it breaks.

The libc_init_common code needs to be compiled with -fno-stack-protector
and can then be merged into libc_bionic.

Change-Id: Ie95ea2ff533d4af1cfad1c9bc59e49f20a8e119d
2015-07-16 17:07:43 -04:00
Bertrand SIMONNET
0875ba3095 Add timespec/timeval conversion helpers.
TIMESPEC_TO_TIMEVAL and TIMEVAL_TO_TIMESPEC are usually provided by
sys/time.h.

BUG: 22532790

Change-Id: I8b9d7298e3250323faa20b1adf9a7514954c6096
2015-07-16 13:10:50 -07:00
Dmitriy Ivanov
9bd373c4fc am cd588f84: Merge "Add constant for zip separator"
* commit 'cd588f847f3f23a9c60e32ab1e37c170e9f5be57':
  Add constant for zip separator
2015-07-16 16:26:33 +00:00
Dmitriy Ivanov
0ee0dd8b3d am cd588f84: Merge "Add constant for zip separator"
* commit 'cd588f847f3f23a9c60e32ab1e37c170e9f5be57':
  Add constant for zip separator
2015-07-16 16:26:06 +00:00
Dmitriy Ivanov
cd588f847f Merge "Add constant for zip separator" 2015-07-16 15:59:16 +00:00
Dmitriy Ivanov
730ed9dfec Add constant for zip separator
Change-Id: I1dcbb15ac612fc28e922eb3de8148fcaebbc0820
2015-07-16 04:52:06 -07:00
Evgenii Stepanov
fb186d55e8 am b3140904: Merge "Replace spaces with tabs in a Makefile."
* commit 'b31409040f1766d92e76e72bbdc1b346f4bb9d8e':
  Replace spaces with tabs in a Makefile.
2015-07-15 23:58:44 +00:00
Evgenii Stepanov
beaf565cd4 am b3140904: Merge "Replace spaces with tabs in a Makefile."
* commit 'b31409040f1766d92e76e72bbdc1b346f4bb9d8e':
  Replace spaces with tabs in a Makefile.
2015-07-15 23:57:15 +00:00
Evgenii Stepanov
b31409040f Merge "Replace spaces with tabs in a Makefile." 2015-07-15 23:22:39 +00:00
Evgenii Stepanov
d11c3e5c3a Replace spaces with tabs in a Makefile.
Sorry, I undertested my previous change and these guys somehow sneaked in.
This only affects SANITIZE_TARGET builds.

Change-Id: Id6986d89fa3d4965339f7b6fe973e9db73b380da
2015-07-15 16:19:59 -07:00
Evgenii Stepanov
760345a959 am e9774a52: Merge "A special linker for ASan executables."
* commit 'e9774a5227749035dc55357ae3a34edaf545c3b3':
  A special linker for ASan executables.
2015-07-15 17:51:04 +00:00
Evgenii Stepanov
43a783714f am e9774a52: Merge "A special linker for ASan executables."
* commit 'e9774a5227749035dc55357ae3a34edaf545c3b3':
  A special linker for ASan executables.
2015-07-15 17:50:49 +00:00
Evgenii Stepanov
e9774a5227 Merge "A special linker for ASan executables." 2015-07-15 17:24:20 +00:00
Evgenii Stepanov
d640b225ec A special linker for ASan executables.
Setup a /system/bin/linker_asan as a symlink to "linker".
Read the linker name from PT_INTERP, and if it is linker_asan,
switch default library lookup paths to the ASan set, which
starts with the path to the instrumented libraries
(/data/lib), followed by /system/lib as a fallback.

This ensures that ASan binaries prefer ASan libraries, when
available. This approach is way better then RPATH/RUNPATH and even
better than LD_LIBRARY_PATH:
- RUNPATH is per-DSO, while default paths are global.
- LD_LIBRARY_PATH is overwritten by android_update_LD_LIBRARY_PATH.
- neither RUNPATH nor LD_LIBRARY_PATH appear in
  android_get_LD_LIBRARY_PATH which is used to build java.lang.path.
  Having ASan libraries in java.lang.path is a good thing.

Bug: 22355945
Change-Id: I1d2791fbf5740618f18f71a3ae3d873714669d3f
2015-07-14 16:12:27 -07:00
Yabin Cui
a89821abe3 am 60a11dcb: Merge "Add test for an Android kernel bug about prctl."
* commit '60a11dcb44992f610e696fc246c70731012080dd':
  Add test for an Android kernel bug about prctl.
2015-07-14 22:52:49 +00:00
Christopher Ferris
bf8809782e am a8d82f12: Merge "Update to v3.18.18 kernel headers."
* commit 'a8d82f126d1830ebee99e2622d08489a844e3e62':
  Update to v3.18.18 kernel headers.
2015-07-14 22:52:40 +00:00
Christopher Ferris
7236112561 am 5e3dc45a: Merge "Do not hold hash table lock while backtracing."
* commit '5e3dc45a16c63b716bc4b7bed2f5752b41a5d5d5':
  Do not hold hash table lock while backtracing.
2015-07-14 21:30:11 +00:00
Yabin Cui
2f54a44110 am 60a11dcb: Merge "Add test for an Android kernel bug about prctl."
* commit '60a11dcb44992f610e696fc246c70731012080dd':
  Add test for an Android kernel bug about prctl.
2015-07-14 20:27:23 +00:00
Christopher Ferris
3b9900d346 am a8d82f12: Merge "Update to v3.18.18 kernel headers."
* commit 'a8d82f126d1830ebee99e2622d08489a844e3e62':
  Update to v3.18.18 kernel headers.
2015-07-14 20:27:06 +00:00
Christopher Ferris
653f4b1504 am 43d35c35: Merge "Do not hold hash table lock while backtracing." into mnc-dev
* commit '43d35c356e2fbe0b022cef52445e93053c4ddbfd':
  Do not hold hash table lock while backtracing.
2015-07-14 17:15:51 +00:00
Yabin Cui
60a11dcb44 Merge "Add test for an Android kernel bug about prctl." 2015-07-14 02:48:45 +00:00
Yabin Cui
91ce715af1 Add test for an Android kernel bug about prctl.
Bug: 20017123

Change-Id: I8c109a06999a8bffcc8e8298b04ee637bb67d878
2015-07-13 19:15:38 -07:00
Christopher Ferris
a8d82f126d Merge "Update to v3.18.18 kernel headers." 2015-07-14 01:29:46 +00:00
Christopher Ferris
dda4fd4644 Update to v3.18.18 kernel headers.
Change-Id: I0a0f423bda89500ad8e13a80582f05ec8bc756ea
2015-07-13 17:21:18 -07:00
Christopher Ferris
287cf2664f am 5e3dc45a: Merge "Do not hold hash table lock while backtracing."
* commit '5e3dc45a16c63b716bc4b7bed2f5752b41a5d5d5':
  Do not hold hash table lock while backtracing.
2015-07-13 20:53:02 +00:00
Christopher Ferris
5e3dc45a16 Merge "Do not hold hash table lock while backtracing." 2015-07-13 20:27:38 +00:00
Christopher Ferris
6db9c199a8 am 43d35c35: Merge "Do not hold hash table lock while backtracing." into mnc-dev
* commit '43d35c356e2fbe0b022cef52445e93053c4ddbfd':
  Do not hold hash table lock while backtracing.
2015-07-13 20:25:57 +00:00
Christopher Ferris
3a40a0000a Do not hold hash table lock while backtracing.
There is a deadlock if holding the hash table lock while trying to do
a backtrace. Change the code so that the hash table lock is only held
while actually modifying either g_hash_table, or while modifying an
entry from g_hash_table.

Bug: 22423683
(cherry picked from commit 9fee99b06013787054a312449b94115038e2ad7c)

Change-Id: I72173bfe6f824ceaceea625c24e7851b87467135
2015-07-13 13:18:31 -07:00
Elliott Hughes
45baf0f384 am 147a50d0: Merge "Prevent user-defined basename_r from breaking basename(3)."
* commit '147a50d06e1183e3f39f4f6d0fa28748b33d4aa9':
  Prevent user-defined basename_r from breaking basename(3).
2015-07-11 07:25:20 +00:00
Elliott Hughes
acf2b7bea6 am 147a50d0: Merge "Prevent user-defined basename_r from breaking basename(3)."
* commit '147a50d06e1183e3f39f4f6d0fa28748b33d4aa9':
  Prevent user-defined basename_r from breaking basename(3).
2015-07-11 07:23:37 +00:00
Elliott Hughes
147a50d06e Merge "Prevent user-defined basename_r from breaking basename(3)." 2015-07-11 07:03:54 +00:00
Elliott Hughes
a20a35fdda Prevent user-defined basename_r from breaking basename(3).
LP64 is immune because basename_r is hidden there, but on LP32 a basename_r
defined in the executable breaks basename because its call to basename_r
will resolve to that one rather than the one in libc.

Bug: http://b/22415484
Change-Id: Ied3ca7ad3fb0e744eb705fc924743f893b4ad490
2015-07-10 23:58:59 -07:00
Neil Fuller
c64ed22e9b am 64c82544: Merge "Update timezone data to 2015e" into mnc-dev
* commit '64c825441637b379be56a04622089e8e9b4b0da4':
  Update timezone data to 2015e
2015-07-10 17:00:49 +00:00
Neil Fuller
533efc20b7 am 64c82544: Merge "Update timezone data to 2015e" into mnc-dev
* commit '64c825441637b379be56a04622089e8e9b4b0da4':
  Update timezone data to 2015e
2015-07-10 10:35:23 +00:00
Dmitriy Ivanov
db996ae74c am a5bb841d: Fix memory-leak on soinfo_free()
* commit 'a5bb841df799e10e7d0ae3202b097da8a1c23507':
  Fix memory-leak on soinfo_free()
2015-07-10 01:44:15 +00:00
Dmitriy Ivanov
538a4d7029 am a5bb841d: Fix memory-leak on soinfo_free()
* commit 'a5bb841df799e10e7d0ae3202b097da8a1c23507':
  Fix memory-leak on soinfo_free()
2015-07-10 00:59:25 +00:00
Dmitriy Ivanov
9d4402a95c am 880a2933: Merge "Fix memory-leak on soinfo_free()"
* commit '880a293390b64da806a072f4ace2c2784b340876':
  Fix memory-leak on soinfo_free()
2015-07-09 23:54:12 +00:00
Dmitriy Ivanov
7974b83443 am 880a2933: Merge "Fix memory-leak on soinfo_free()"
* commit '880a293390b64da806a072f4ace2c2784b340876':
  Fix memory-leak on soinfo_free()
2015-07-09 23:53:33 +00:00
Dmitriy Ivanov
880a293390 Merge "Fix memory-leak on soinfo_free()" 2015-07-09 23:32:19 +00:00
Pirama Arumuga Nainar
a13ece0d6c am d1e10d7d: Merge "Use delete[] to de-allocate pointers from new[]"
* commit 'd1e10d7d168a8461d9eb47e48802ea11d8bd0640':
  Use delete[] to de-allocate pointers from new[]
2015-07-09 23:06:07 +00:00
Pirama Arumuga Nainar
fcd017148b am d1e10d7d: Merge "Use delete[] to de-allocate pointers from new[]"
* commit 'd1e10d7d168a8461d9eb47e48802ea11d8bd0640':
  Use delete[] to de-allocate pointers from new[]
2015-07-09 23:04:30 +00:00
Pirama Arumuga Nainar
d1e10d7d16 Merge "Use delete[] to de-allocate pointers from new[]" 2015-07-09 22:40:51 +00:00
Pirama Arumuga Nainar
4d44675283 Use delete[] to de-allocate pointers from new[]
Upstream clang has a new diagnostic, '-Wmismatched-new-delete' to
generate a warning (that becomes an error with -Werror) when delete is
used to deallocate pointers created with 'new[]'.  This patch fixes
'delete's that trigger this warning/error.

Change-Id: Id7b6f6c2df3e860e576de55e2f61f3d2be3a3986
2015-07-09 10:15:15 -07:00
Dmitriy Ivanov
609f11b31e Fix memory-leak on soinfo_free()
Bug: http://b/22290728
Change-Id: I00747056db2cd3ff8b33936278464daed7236536
2015-07-08 15:26:46 -07:00
Daniel Erat
818295c3f7 am c6f25641: Merge "libc: Add sys/fcntl.h for compatibility."
* commit 'c6f25641eb874cd15f92759beff1ad67cfd8228b':
  libc: Add sys/fcntl.h for compatibility.
2015-07-08 21:45:39 +00:00
Daniel Erat
16d78688b4 am c6f25641: Merge "libc: Add sys/fcntl.h for compatibility."
* commit 'c6f25641eb874cd15f92759beff1ad67cfd8228b':
  libc: Add sys/fcntl.h for compatibility.
2015-07-08 21:44:59 +00:00
Daniel Erat
c6f25641eb Merge "libc: Add sys/fcntl.h for compatibility." 2015-07-08 21:15:23 +00:00
Daniel Erat
e55151472b libc: Add sys/fcntl.h for compatibility.
Add a /usr/include/sys/fcntl.h file that includes <fcntl.h>.

Change-Id: Ie34bf7519607c5aae1fbea7c7dca249c9b7801cc
2015-07-08 15:07:17 -06:00
Evgenii Stepanov
c9bd26e96b am 33ef6c20: Merge "Respect caller DT_RUNPATH in dlopen()."
* commit '33ef6c20f2ddf19b29ed3a4e50139fa391b1a3d4':
  Respect caller DT_RUNPATH in dlopen().
2015-07-08 20:16:59 +00:00
Evgenii Stepanov
b4f5d6d894 am 33ef6c20: Merge "Respect caller DT_RUNPATH in dlopen()."
* commit '33ef6c20f2ddf19b29ed3a4e50139fa391b1a3d4':
  Respect caller DT_RUNPATH in dlopen().
2015-07-08 20:16:35 +00:00
Evgenii Stepanov
33ef6c20f2 Merge "Respect caller DT_RUNPATH in dlopen()." 2015-07-08 19:50:03 +00:00
Christopher Ferris
ce302bff6a am 90de6820: Merge "Replace bx lr with update of pc from the stack."
* commit '90de6820f736de1239b218ea2b63d15c38505e93':
  Replace bx lr with update of pc from the stack.
2015-07-08 19:41:10 +00:00
Christopher Ferris
a2e2c3d2ae am 90de6820: Merge "Replace bx lr with update of pc from the stack."
* commit '90de6820f736de1239b218ea2b63d15c38505e93':
  Replace bx lr with update of pc from the stack.
2015-07-08 19:40:38 +00:00
Christopher Ferris
90de6820f7 Merge "Replace bx lr with update of pc from the stack." 2015-07-08 19:15:38 +00:00
Christopher Ferris
e1e434af12 Replace bx lr with update of pc from the stack.
When there is arm assembler of this format:

ldmxx sp!, {..., lr} or pop {..., lr}
bx lr

It can be replaced with:

ldmxx sp!, {..., pc} or pop {..., pc}

Change-Id: Ic27048c52f90ac4360ad525daf0361a830dc22a3
2015-07-08 11:20:27 -07:00
Evgenii Stepanov
0cdef7e7f3 Respect caller DT_RUNPATH in dlopen().
When dlopen-ing a library, add the caller's DT_RUNPATH to the directory search
list. This fixes dlfcn.dt_runpath in bionic-unit-tests-glibc(32|64).

Bug: 21899363
Change-Id: Ife6a7e192939292cf4dc291b7e6b95945761cde3
2015-07-07 10:56:06 -07:00
Elliott Hughes
b82a5a96f8 am 7a9732d6: Merge "Add some glibc-like #defines for libchrome."
* commit '7a9732d663906bedd8734c9952e35728c2662767':
  Add some glibc-like #defines for libchrome.
2015-07-07 17:26:41 +00:00
Elliott Hughes
049a5ae002 am 7a9732d6: Merge "Add some glibc-like #defines for libchrome."
* commit '7a9732d663906bedd8734c9952e35728c2662767':
  Add some glibc-like #defines for libchrome.
2015-07-07 17:24:48 +00:00
Elliott Hughes
7a9732d663 Merge "Add some glibc-like #defines for libchrome." 2015-07-07 16:56:53 +00:00
Elliott Hughes
7ea817d39e Add some glibc-like #defines for libchrome.
libchrome uses __USE_XOPEN2K8 to decide whether futimens is
available. That's perhaps not the best idea, but there are other
cases where we defined the same feature macros as glibc to aid
portability.

Change-Id: Ie6e04cb181d88698d618e7dbd26cd347a6bf076c
2015-07-07 09:22:32 -07:00
Elliott Hughes
805844ff0c am 65dd8582: Fix alignment after variable-length data.
* commit '65dd858239c4e32a5a1afbc14ac30dbcdd2a50a3':
  Fix alignment after variable-length data.
2015-07-06 23:29:41 +00:00
Elliott Hughes
95997b691f am 89bbb846: Merge "Fix alignment after variable-length data."
* commit '89bbb846b9831f232b87d54a6eeb759ac603cc43':
  Fix alignment after variable-length data.
2015-07-06 22:55:21 +00:00
Elliott Hughes
b6c2d3f30b am 89bbb846: Merge "Fix alignment after variable-length data."
* commit '89bbb846b9831f232b87d54a6eeb759ac603cc43':
  Fix alignment after variable-length data.
2015-07-06 22:54:52 +00:00
Elliott Hughes
a6441ac5bf am 65dd8582: Fix alignment after variable-length data.
* commit '65dd858239c4e32a5a1afbc14ac30dbcdd2a50a3':
  Fix alignment after variable-length data.
2015-07-06 22:32:06 +00:00
Elliott Hughes
89bbb846b9 Merge "Fix alignment after variable-length data." 2015-07-06 21:44:31 +00:00
Elliott Hughes
dbb17b2831 Fix alignment after variable-length data.
In the serialized output from netd, the strings come first. Some code
assumes -- reasonably enough -- that it can do unaligned reads of pointers,
so we need to ensure alignment after all the strings.

(cherrypick of 65dd858239c4e32a5a1afbc14ac30dbcdd2a50a3.)

Bug: http://b/21192318
Change-Id: I456639127db9a2583f7f738e6b8103375d9387fd
2015-07-06 14:43:28 -07:00
Elliott Hughes
6a31a37cc1 am f542b309: Merge "Name the thread stack and signal stack guard pages."
* commit 'f542b30970ae863caceea1f635115f1195461e31':
  Name the thread stack and signal stack guard pages.
2015-07-06 20:22:48 +00:00
Elliott Hughes
4059fcd29b am f542b309: Merge "Name the thread stack and signal stack guard pages."
* commit 'f542b30970ae863caceea1f635115f1195461e31':
  Name the thread stack and signal stack guard pages.
2015-07-06 20:22:43 +00:00
Elliott Hughes
f542b30970 Merge "Name the thread stack and signal stack guard pages." 2015-07-06 19:59:43 +00:00
Elliott Hughes
eeb6b57e75 Name the thread stack and signal stack guard pages.
Bug: http://b/22228722
Change-Id: I1dae672e386e404fb304a34496a29fe21134c784
2015-07-01 23:48:39 -07:00
Dmitriy Ivanov
4bb5ea22bc am f643eb38: Improve personality initialization
* commit 'f643eb38c36eb63f612e20dea09fd43ac6a6b360':
  Improve personality initialization
2015-07-01 17:12:54 +00:00
Elliott Hughes
8d04081196 am 77455f85: Merge "Fixed uchar.h for clang3.6"
* commit '77455f85ab46bed6dc5f7246b474ede44ae9ede2':
  Fixed uchar.h for clang3.6
2015-07-01 15:58:17 +00:00
Elliott Hughes
77455f85ab Merge "Fixed uchar.h for clang3.6" 2015-07-01 15:32:58 +00:00
Neil Fuller
66379bb11d am 86061f39: Merge "Update timezone data to 2015e"
* commit '86061f39c2c5f5a5ee91b349d1c8cb7bf04003a3':
  Update timezone data to 2015e
2015-07-01 10:06:29 +00:00
Neil Fuller
86061f39c2 Merge "Update timezone data to 2015e" 2015-07-01 09:42:22 +00:00
Dmitriy Ivanov
7830dcf1b5 am 416695a7: Merge "Improve personality initialization"
* commit '416695a75c3892dd709a80ea8a640da07082594e':
  Improve personality initialization
2015-07-01 02:36:04 +00:00
Dmitriy Ivanov
416695a75c Merge "Improve personality initialization" 2015-07-01 02:12:53 +00:00
Dmitriy Ivanov
c2247478d5 Improve personality initialization
1. Personality parameter should be unsigned int (not long)
2. Do not reset bits outside of PER_MASK when setting
   personality value.
3. Set personality for static executables.

Bug: http://b/21900686
Change-Id: I4c7e34079cbd59b818ce221eed325c05b9bb2303
(cherry picked from commit f643eb38c36eb63f612e20dea09fd43ac6a6b360)
2015-06-30 19:01:24 -07:00
Neil Fuller
b9f76dc829 Update timezone data to 2015e
Changes affecting future time stamps

    Morocco will suspend DST from 2015-06-14 03:00 through 2015-07-19 02:00,
    not 06-13 and 07-18 as we had guessed.  (Thanks to Milamber.)

    Assume Cayman Islands will observe DST starting next year, using US rules.
    Although it isn't guaranteed, it is the most likely.

Bug: 21836574
Change-Id: I6eda60c220d5c55d2aa0934544866ec0f1ce62ab
2015-06-30 14:48:06 +01:00
Erik Kline
063670156f am 754f6690: Pass around struct android_net_context for better behaviour
* commit '754f669076ec1edfc0d597aaf89600d4c93f9a7c':
  Pass around struct android_net_context for better behaviour
2015-06-30 06:22:24 +00:00
Erik Kline
2ce0969b83 am 7f46cf9a: Merge "Pass around struct android_net_context for better behaviour"
* commit '7f46cf9a5f0b3e54d97fc94a83b955ae4c335a31':
  Pass around struct android_net_context for better behaviour
2015-06-30 02:42:17 +00:00
Erik Kline
7f46cf9a5f Merge "Pass around struct android_net_context for better behaviour" 2015-06-30 02:21:03 +00:00
Dmitriy Ivanov
10b0b96ff6 am f7d5bf33: Lock on dl_interate_phdr
* commit 'f7d5bf334dc4bc5b7399d4c8268e1b0bf676548f':
  Lock on dl_interate_phdr
2015-06-29 22:41:55 +00:00
Dmitriy Ivanov
c66bcd2a3f am 83474cd3: Merge "Lock on dl_interate_phdr"
* commit '83474cd38712c0f955174609a880deabebb27518':
  Lock on dl_interate_phdr
2015-06-29 22:38:20 +00:00
Dmitriy Ivanov
83474cd387 Merge "Lock on dl_interate_phdr" 2015-06-29 22:17:36 +00:00
Dmitriy Ivanov
7271caf93d Lock on dl_interate_phdr
There is possibility of someone dlclosing a library
while dl_iterate_phdr in progress which can lead to
dl_iterate_phdr calling callback with invalid address
if it was unmapped by dlclose.

Bug: http://b/22047255
Change-Id: I3fc0d9fd2c51fb36fd34cb035f37271fa893a7be
(cherry picked from commit f7d5bf334dc4bc5b7399d4c8268e1b0bf676548f)
2015-06-29 15:14:28 -07:00
Dmitriy Ivanov
168ebad960 am 46d24d12: Merge "Replace NULL with nullptr"
* commit '46d24d12e167a0b5afa4ded218aa4db0a477141a':
  Replace NULL with nullptr
2015-06-29 21:34:07 +00:00
Elliott Hughes
6bae84af9b am 25da2d7c: Merge "Add <sysexits.h>."
* commit '25da2d7ca2795156552ed96e1f3c3245330682b0':
  Add <sysexits.h>.
2015-06-29 21:23:22 +00:00
Dmitriy Ivanov
46d24d12e1 Merge "Replace NULL with nullptr" 2015-06-29 21:08:49 +00:00
Elliott Hughes
25da2d7ca2 Merge "Add <sysexits.h>." 2015-06-29 21:01:05 +00:00
Elliott Hughes
59d5854d14 Add <sysexits.h>.
Taken from current upstream OpenBSD.

Bug: http://b/22172963
Change-Id: Ic899e08541335777296fa8ec99e518f35a100144
2015-06-29 13:44:34 -07:00
Yusuke Sato
f7d88aefb8 am 71107cdd: Merge "Rename ZipEntryName to ZipString"
* commit '71107cdd028461c433a39a10eb192edbdf03dede':
  Rename ZipEntryName to ZipString
2015-06-29 18:14:58 +00:00
Yusuke Sato
71107cdd02 Merge "Rename ZipEntryName to ZipString" 2015-06-29 17:49:41 +00:00
egor.kochetov
a05bee544a Fixed uchar.h for clang3.6
The NDK self-test issue64679-prctl failed to build because by default
clang3.6 builds in C11 mode, but the ifdef in the file 'uchar.h' hid the
required char16_t and char32_t declarations based on the GCC version,
which is declared as 4 by clang.

The ifdef is changed so that it is based on C version rather than a
compiler version. This way it is compatible with gcc 4, gcc 5 and clang
which are actually the only used toolchains.

See also: b.android.com/177609

Change-Id: I78c4bdc681c6f8a31b92dbe8ffe35e84ef2eda36
Signed-off-by: Egor Kochetov <egor.kochetov@intel.com>
2015-06-29 13:27:28 +03:00
Erik Kline
01e37c9665 Pass around struct android_net_context for better behaviour
Group network context elements in to a single struct and
add a version of android_getaddrinfofornet() that accepts it.

The introduction of UID-based routing means that the UID is an
integral part of the network context when evaluating connectivity,
sorting addresses, etc.

Also, introduce a distinction between DNS netids/marks and those
expected to be used by the application.  This can be important
when the network an application is using is not the same as the
network on which DNS queries will be issued.

Additionally, de-duplicate the UDP connect logic (collapse both
_test_connect() and _find_src_addr() into just the latter).

Bug: 19470192
Bug: 20733156
Bug: 21832279
Change-Id: If16c2f4744695f507993afdac078ca105eb5d3e4
2015-06-29 18:39:54 +09:00
Dmitriy Ivanov
4b42cb93c9 am 06700b2b: Fix crash when trying to load invalid ELF file.
* commit '06700b2b5e92a365505b15d0d05e2d5b0706c511':
  Fix crash when trying to load invalid ELF file.
2015-06-26 15:09:23 +00:00
Dmitriy Ivanov
61ad0cf24c am eeb9f5e4: Merge "Fix crash when trying to load invalid ELF file."
* commit 'eeb9f5e41662828989f3913d81ec23229a668434':
  Fix crash when trying to load invalid ELF file.
2015-06-26 04:12:23 +00:00
Dmitriy Ivanov
eeb9f5e416 Merge "Fix crash when trying to load invalid ELF file." 2015-06-26 03:51:27 +00:00
Dmitriy Ivanov
3f987f5b3e Fix crash when trying to load invalid ELF file.
Bug: http://b/22047255
Bug: http://b/22091640
Change-Id: I6c51cff43287a6ac4b25fa9ce6a6fc3d232fd047
(cherry picked from commit 06700b2b5e92a365505b15d0d05e2d5b0706c511)
2015-06-25 20:05:50 -07:00
Yusuke Sato
56f40fbb82 Rename ZipEntryName to ZipString
This is for https://android-review.googlesource.com/#/c/156771/.

Bug: 21957428
Change-Id: Ida30c28c0fff0b2dadddbdb1aa1999ae3250610b
2015-06-25 14:56:07 -07:00
Elliott Hughes
6845f45ef9 am d19c2715: Merge "Fix x86 gdbserver build."
* commit 'd19c271599a4b8881213c7bfbb81f87d8e56a101':
  Fix x86 gdbserver build.
2015-06-25 14:44:51 +00:00
Elliott Hughes
d19c271599 Merge "Fix x86 gdbserver build." 2015-06-25 14:30:22 +00:00
Dimitry Ivanov
a56ecc3405 am 6589febe: Merge "[MIPS] Support FR=0 emulation on FR=1 64-bit FP registers"
* commit '6589febec212bb1d72b7e3d593a1b7fe77692f7f':
  [MIPS] Support FR=0 emulation on FR=1 64-bit FP registers
2015-06-25 01:24:07 +00:00
Dimitry Ivanov
6589febec2 Merge "[MIPS] Support FR=0 emulation on FR=1 64-bit FP registers" 2015-06-25 01:02:20 +00:00
Elliott Hughes
fef58353f4 Fix x86 gdbserver build.
Add the x86-only elf_fpxregset_t to <sys/procfs.h>, and rename
user_fxsr_struct (the kernel's name) to user_fpxregs_struct (the
userspace name).

Bug: http://b/22068064
Change-Id: Id466096bf02baf6bd49b193f49d9036848d33548
2015-06-24 17:31:24 -07:00
Duane Sand
bc425c73e0 [MIPS] Support FR=0 emulation on FR=1 64-bit FP registers
Enables running of older MIPS NDK-built apps on mips64r6.

Works with kernel supporting FRE emulation, and old kernels.

Change-Id: If5e392ed89e9910cd1ccd30e0fd5c4a5acea2c7d
2015-06-24 16:43:19 -07:00
Dimitry Ivanov
ee01bb6374 am c666838a: Merge "Revert "[MIPS] Support FR=0 emulation on FR=1 64-bit FP registers""
* commit 'c666838ad6e578f429783a82f9b9a5bbddd3a9a8':
  Revert "[MIPS] Support FR=0 emulation on FR=1 64-bit FP registers"
2015-06-24 21:47:39 +00:00
Dimitry Ivanov
beb609bba8 am fb3357e2: Revert "[MIPS] Support FR=0 emulation on FR=1 64-bit FP registers"
* commit 'fb3357e2eb9366d87a8da96e1a0744c9b1f22af9':
  Revert "[MIPS] Support FR=0 emulation on FR=1 64-bit FP registers"
2015-06-24 21:09:43 +00:00
Dimitry Ivanov
c666838ad6 Merge "Revert "[MIPS] Support FR=0 emulation on FR=1 64-bit FP registers"" 2015-06-24 20:44:36 +00:00
Dimitry Ivanov
cc83890464 Revert "[MIPS] Support FR=0 emulation on FR=1 64-bit FP registers"
This reverts commit d02ec08427b006e80191ce60690ce48a788fb832.

Bug: http://b/22045439
Change-Id: Iaf10ff1e2948083cce0098f29d5b87b32bfae1b7
2015-06-24 20:43:33 +00:00
Chih-Hung Hsieh
4ab0edac1a am d807b9a1: Merge "Use gcc to build and test x86_64 long double code."
* commit 'd807b9a12d3e49132b095df3d883618452033b51':
  Use gcc to build and test x86_64 long double code.
2015-06-24 00:40:16 +00:00
Chih-Hung Hsieh
d807b9a12d Merge "Use gcc to build and test x86_64 long double code." 2015-06-24 00:15:51 +00:00
Chih-Hung Hsieh
e79d06b0e8 Use gcc to build and test x86_64 long double code.
Clang/llvm x86_64 configuration of long double is still
incompatible with gcc.
https://llvm.org/bugs/show_bug.cgi?id=23897

BUG: 21899249
Change-Id: I47fd6d0ce2daa84ae0035e7885a4d90e4c3056f7
2015-06-23 23:13:39 +00:00
Dmitriy Ivanov
0a9df9a13e am af6ee5b5: Merge "Work around compiler optimization"
* commit 'af6ee5b5bc446ef5a6f2bf41bc4f2e13657978be':
  Work around compiler optimization
2015-06-23 22:17:08 +00:00
Dmitriy Ivanov
af6ee5b5bc Merge "Work around compiler optimization" 2015-06-23 21:51:35 +00:00
Dmitriy Ivanov
aff18fd608 Replace NULL with nullptr
Change-Id: If66d0c5ae1ea1ed371b44e067d4ae59ac54a8842
2015-06-23 13:58:22 -07:00
Dmitriy Ivanov
7d09a8cd11 Work around compiler optimization
This makes bionic-unit-test-glibc64 behave consistently
when testing dlopen from a library with dt_runpath.

Bug: http://b/21899363
Change-Id: I9d446eb6852876975874d6b7761f6f81cc4e9916
2015-06-23 13:47:23 -07:00
Duane Sand
bbac1d19d7 am 40d9e7bf: [MIPS] Support FR=0 emulation on FR=1 64-bit FP registers
* commit '40d9e7bf842423e328cda58e21ff5fc0cbab5c8a':
  [MIPS] Support FR=0 emulation on FR=1 64-bit FP registers
2015-06-23 20:45:57 +00:00
Elliott Hughes
9209b0a169 am 2b028f5c: Fix bad merge of 64e9e71cdb7d88397e510e1986d494b797ed3b45.
* commit '2b028f5ce47b8d27ca6d3b86e135f7d9b0359547':
  Fix bad merge of 64e9e71cdb7d88397e510e1986d494b797ed3b45.
2015-06-23 18:08:10 +00:00
Dmitriy Ivanov
3226cad538 am d6d6c0c4: Merge "Remove libdl* tests from bionic-unit-tests-static" into mnc-dev
* commit 'd6d6c0c4f10c047b25b45289f5c30338cd1da239':
  Remove libdl* tests from bionic-unit-tests-static
2015-06-22 19:51:19 +00:00
Dmitriy Ivanov
02102d95f8 am 5fa858c5: Merge "Remove text-relocs support for apps targeting M+" into mnc-dev
* commit '5fa858c5655ed721696719ce07d81a983d4b0f5e':
  Remove text-relocs support for apps targeting M+
2015-06-22 19:51:18 +00:00
Dmitriy Ivanov
6f2bce5b8a am a8993c99: Merge "Remove text-relocs support for apps targeting M+"
* commit 'a8993c994e45ec2dc00dcef15910560e22d67be9':
  Remove text-relocs support for apps targeting M+
2015-06-22 19:50:50 +00:00
Dmitriy Ivanov
c29626c12a am 13cee57d: Merge "Remove libdl* tests from bionic-unit-tests-static"
* commit '13cee57dee4ebd14b57e7b5acd372228eb9c4a37':
  Remove libdl* tests from bionic-unit-tests-static
2015-06-22 19:50:49 +00:00
Dmitriy Ivanov
a8993c994e Merge "Remove text-relocs support for apps targeting M+" 2015-06-22 19:27:34 +00:00
Dmitriy Ivanov
e4ad91f86a Remove text-relocs support for apps targeting M+
Remove support of text-relocations for apps targeting sdk version > 22

Bug: http://b/20013628
Change-Id: I2127739544480c747315e32df15dfbd1b79de4f5
(cherry picked from commit 3e6f7807541bab8157f9c26e55829fd193683349)
2015-06-22 12:26:53 -07:00
Dmitriy Ivanov
13cee57dee Merge "Remove libdl* tests from bionic-unit-tests-static" 2015-06-22 19:24:15 +00:00
Dmitriy Ivanov
de4e27e231 Remove libdl* tests from bionic-unit-tests-static
Bug: http://b/21900592
Change-Id: I907cc15684b121ec2fbdeca49fc584bb6d2eaacc
2015-06-22 11:54:58 -07:00
Dimitry Ivanov
3ebe2c78e4 am 6a5ead69: Merge "[MIPS] Support FR=0 emulation on FR=1 64-bit FP registers"
* commit '6a5ead6990ef16e858309928c4b14e3a5e2d89af':
  [MIPS] Support FR=0 emulation on FR=1 64-bit FP registers
2015-06-21 21:46:39 +00:00
Dimitry Ivanov
6a5ead6990 Merge "[MIPS] Support FR=0 emulation on FR=1 64-bit FP registers" 2015-06-21 21:25:54 +00:00
Duane Sand
d02ec08427 [MIPS] Support FR=0 emulation on FR=1 64-bit FP registers
Enables running of older MIPS NDK-built apps on mips64r6.

Works with kernel supporting FRE emulation, and old kernels.

Change-Id: I13923fe62cd83ad1d337f13a50f2eda2dfdd906f
2015-06-21 11:36:57 -07:00
Yabin Cui
1df44bd0a4 am cb060759: am 8beb0c34: am b245bc75: am 0f455612: Merge "Fix flaky test of timer_create_multiple in L." into lollipop-mr1-cts-dev
* commit 'cb0607590341ed2512a55015e66e19e7f7db3723':
  Fix flaky test of timer_create_multiple in L.
2015-06-19 20:29:49 +00:00
David Srbecky
324bd8d0bb am c08c88b5: Merge "Add flag that makes linker honor min(p_vaddr)" into mnc-dev
* commit 'c08c88b5fcec05551858c32bc57f4ae614c0ce5c':
  Add flag that makes linker honor min(p_vaddr)
2015-06-19 20:29:33 +00:00
Yabin Cui
a4c422026a am 6cc98af7: Merge "Don\'t use TIMER_ABSTIME in time_test."
* commit '6cc98af72b0c48c58b2ab5fdb5f7abb842175299':
  Don't use TIMER_ABSTIME in time_test.
2015-06-19 18:25:21 +00:00
Yabin Cui
6cc98af72b Merge "Don't use TIMER_ABSTIME in time_test." 2015-06-19 17:56:52 +00:00
Yabin Cui
d1ade7ce02 Don't use TIMER_ABSTIME in time_test.
If TIMER_ABSTIME is used in timer_settime(), the timer is always fired
immediately, which is not the intent of the tests.

Change-Id: I76047dbeb2bdded272ee6d028630b53bfd7d8514
2015-06-19 00:54:34 +00:00
Christopher Ferris
e0e1e91322 resolved conflicts for merge of 7d6410e9 to mnc-dev-plus-aosp
Change-Id: I0f050e4eba3d68907dd6bfa24563f7ddfae1d73e
2015-06-17 18:25:22 -07:00
Dmitriy Ivanov
aac38762a2 am 547fa54e: Merge "Improve library lookup logic"
* commit '547fa54e6d5342f4ce68c7d78bd270595caf4b97':
  Improve library lookup logic
2015-06-18 00:55:37 +00:00
Dmitriy Ivanov
850424716c resolved conflicts for merge of 28154f5c to mnc-dev-plus-aosp
Change-Id: I26d4a341d19b6ef1e430f5365626f3c274ba7320
2015-06-17 17:43:12 -07:00
Dmitriy Ivanov
547fa54e6d Merge "Improve library lookup logic" 2015-06-18 00:30:48 +00:00
Dmitriy Ivanov
a9703332f6 Improve library lookup logic
Linker tries to open a library even if it can
be found by soname. This only happens if the
library was previously opened under different
target sdk version.

Bug: http://b/21876587
Bug: http://b/21153477
Bug: http://b/21171302
Bug: https://code.google.com/p/android/issues/detail?id=160921
Change-Id: I7dbbcc3b49933bffd89ca0af55371e1a1f2bf4c2
(cherry picked from commit 28154f5c56dc4a64270cae2374b47a168d1bd7fa)
2015-06-17 17:16:44 -07:00
Christopher Ferris
496a128076 am bfa601a9: Merge "[MIPS] Add optimized string functions"
* commit 'bfa601a9992547147fa66a95273bd5b891723bcc':
  [MIPS] Add optimized string functions
2015-06-18 00:15:29 +00:00
Christopher Ferris
bfa601a999 Merge "[MIPS] Add optimized string functions" 2015-06-17 23:50:56 +00:00
Dimitry Ivanov
b5bab69239 am 9ae6f794: Merge "Revert "Improve library lookup logic""
* commit '9ae6f794cae7280385dfa172b12b7bd110f24693':
  Revert "Improve library lookup logic"
2015-06-17 21:57:17 +00:00
Dimitry Ivanov
9ae6f794ca Merge "Revert "Improve library lookup logic"" 2015-06-17 21:35:28 +00:00
Dimitry Ivanov
d2c81ed000 Revert "Improve library lookup logic"
This reverts commit 455c145e3c451b2b6dc00663e4040d79acefd496.

Bug: http://b/21876587
Bug: http://b/21153477
Bug: http://b/21171302
Bug: https://code.google.com/p/android/issues/detail?id=160921
Change-Id: Iad21ddfc1ac749d12bcb52384a8d937b307dd03b
2015-06-17 21:34:25 +00:00
Dmitriy Ivanov
0d9057b153 am f448ef49: Merge "Add versions to libm.so symbols"
* commit 'f448ef491c3d733ca0b5935304b41c9df3ff93d5':
  Add versions to libm.so symbols
2015-06-17 21:12:49 +00:00
Dmitriy Ivanov
a8a1e8112f am 4d0d3147: Add versions to libm.so symbols
* commit '4d0d31475f1584ed7bf4a52ce784c62c30ad522c':
  Add versions to libm.so symbols
2015-06-17 21:07:27 +00:00
Dimitry Ivanov
e4faf3af9f am 6b37515c: Merge "Revert "Improve library lookup logic"" into mnc-dev
* commit '6b37515c38ce1d5701915ffcd3bc6b6840d90fa7':
  Revert "Improve library lookup logic"
2015-06-17 21:07:26 +00:00
Dmitriy Ivanov
f448ef491c Merge "Add versions to libm.so symbols" 2015-06-17 20:49:44 +00:00
Dmitriy Ivanov
8d8477fd17 am 61cbd02f: Merge "Improve library lookup logic"
* commit '61cbd02f1030132a4a4f0bfc2bbde3311dd620da':
  Improve library lookup logic
2015-06-17 17:45:39 +00:00
Dmitriy Ivanov
df0ebf4e92 am 462df829: Merge "Improve library lookup logic" into mnc-dev
* commit '462df82902e6982f5b5c2ea443e84f39980259e1':
  Improve library lookup logic
2015-06-17 17:38:32 +00:00
Dmitriy Ivanov
61cbd02f10 Merge "Improve library lookup logic" 2015-06-17 17:28:50 +00:00
Elliott Hughes
d1289f8bdb am 3b5a4b0c: Merge "Revert "[MIPS] Do not use compact branches until GDB supports them""
* commit '3b5a4b0c3394e45b766188e0bede4d5acdc0c678':
  Revert "[MIPS] Do not use compact branches until GDB supports them"
2015-06-17 17:19:50 +00:00
Dmitriy Ivanov
455c145e3c Improve library lookup logic
Linker tries to open a library even if it can
be found by soname. This only happens if the
library was previously opened under different
target sdk version.

Bug: http://b/21876587
Bug: http://b/21153477
Bug: http://b/21171302
Bug: https://code.google.com/p/android/issues/detail?id=160921
Change-Id: I769a04b6b1368a107d43f399297be14050338bbc
(cherry picked from commit ea4ef52fa46602a5853df0e5b1ddd71b194d54ce)
2015-06-17 10:18:28 -07:00
Elliott Hughes
3b5a4b0c33 Merge "Revert "[MIPS] Do not use compact branches until GDB supports them"" 2015-06-17 17:05:14 +00:00
Nikola Veljkovic
dee130f598 Revert "[MIPS] Do not use compact branches until GDB supports them"
This reverts commit 3cec6eca929de5d627a8cc1fbe72c564ba5175cc.
2015-06-17 17:17:54 +02:00
Nikola Veljkovic
38f2eaa07b [MIPS] Add optimized string functions
Use same string functions for all MIPS architectures.

Change-Id: I5575b16f3f66fa3609d7dafd151b6091bfe3517f
2015-06-17 17:02:10 +02:00
Elliott Hughes
2efe8b1fde am d49850d6: Fixes for building gdbserver (and gdb) out of the box.
* commit 'd49850d6abb1b70c34be99a46e383a6a878ae19e':
  Fixes for building gdbserver (and gdb) out of the box.
2015-06-17 00:45:38 +00:00
Elliott Hughes
9f01ac812d am 81b2382d: Merge "Fixes for building gdbserver (and gdb) out of the box."
* commit '81b2382df6985d5e2495797bb4e03fa597340a37':
  Fixes for building gdbserver (and gdb) out of the box.
2015-06-17 00:20:43 +00:00
Elliott Hughes
81b2382df6 Merge "Fixes for building gdbserver (and gdb) out of the box." 2015-06-16 23:58:34 +00:00
Elliott Hughes
895241efbb Fixes for building gdbserver (and gdb) out of the box.
Bug: http://b/21695943
Change-Id: Iadb600b2ae619515d7038a4db9bf464ba31adb36
2015-06-16 16:04:35 -07:00
Dan Albert
47af493008 am b628b7db: Merge "Use new sanitizer option."
* commit 'b628b7db3952594d06c8063dc863a4dd6eaa8b89':
  Use new sanitizer option.
2015-06-16 21:45:35 +00:00
Tim Murray
16bbd8cbaf am 84827605: Merge "Add support for cortex-a53 in bionic." into mnc-dev
* commit '848276051a24266e1eacf2e508692c62d5a6176d':
  Add support for cortex-a53 in bionic.
2015-06-16 21:26:04 +00:00
Dan Albert
b628b7db39 Merge "Use new sanitizer option." 2015-06-16 21:23:50 +00:00
Dmitriy Ivanov
11fbf03fd3 am 42057469: Add version to libc.so symbols
* commit '420574690cc7096c3f894d5d88a65e8fd13de25c':
  Add version to libc.so symbols
2015-06-16 21:23:47 +00:00
Elliott Hughes
352eb5f628 am 929be688: Hide accidentally-exposed __clock_nanosleep.
* commit '929be68849b7e94caaa7ffe62b8a7b506d2cc042':
  Hide accidentally-exposed __clock_nanosleep.
2015-06-16 21:23:46 +00:00
Dan Albert
11ea08c5cb Use new sanitizer option.
Change-Id: I21b04a1f3be3b10ee557bf9e0caa5db638686364
2015-06-16 13:57:54 -07:00
Tim Murray
e6d80afb58 am 9876aa27: Merge "Add support for cortex-a53 in bionic."
* commit '9876aa273da6795aa6d257de5b779a68a0c2eccf':
  Add support for cortex-a53 in bionic.
2015-06-16 19:27:36 +00:00
Tim Murray
9876aa273d Merge "Add support for cortex-a53 in bionic." 2015-06-16 19:04:14 +00:00
Dmitriy Ivanov
2e1f6107fe am 48fa28ba: Merge "Add version to libc.so symbols"
* commit '48fa28bacd7e84651d381e2428944916e45b5508':
  Add version to libc.so symbols
2015-06-16 18:27:09 +00:00
Dmitriy Ivanov
48fa28bacd Merge "Add version to libc.so symbols" 2015-06-16 18:04:33 +00:00
Elliott Hughes
7e0946a623 am cd1be3b6: Merge "Hide accidentally-exposed __clock_nanosleep."
* commit 'cd1be3b69e1b47ac27ffc5d74e5276aeee688abc':
  Hide accidentally-exposed __clock_nanosleep.
2015-06-16 18:01:27 +00:00
Elliott Hughes
cd1be3b69e Merge "Hide accidentally-exposed __clock_nanosleep." 2015-06-16 17:43:36 +00:00
Dmitriy Ivanov
665607a6b7 Add version to libc.so symbols
Bug: http://b/21617095
Bug: http://b/20139821
Change-Id: If3d42d2a0b4a0c49721fd9b9ecbb4f7bee5a1eff
2015-06-16 10:32:07 -07:00
Tim Murray
a73b2c961f Add support for cortex-a53 in bionic.
allows -mcpu=cortex-a53 to be passed as part of a command line.

Change-Id: Id4203a9fd197f4c3b661bad21ac58c32819fd687
2015-06-15 21:43:30 -07:00
Elliott Hughes
b1304935b6 Hide accidentally-exposed __clock_nanosleep.
Bug: http://b/21858067
Change-Id: Iaa83a5e17cfff796aed4f641d0d14427614d9399
2015-06-15 19:39:04 -07:00
Elliott Hughes
26501a0ae9 am f1c85411: Avoid name collision with user_fpsimd_state in <asm/ptrace.h>.
* commit 'f1c85411a8edd71366d723bc297d49a52112cb74':
  Avoid name collision with user_fpsimd_state in <asm/ptrace.h>.
2015-06-16 02:21:08 +00:00
Elliott Hughes
41bc5aeb93 am df11f340: Merge "Avoid name collision with user_fpsimd_state in <asm/ptrace.h>."
* commit 'df11f340cac2e7aa5ef69c3180d0f4089f46c96b':
  Avoid name collision with user_fpsimd_state in <asm/ptrace.h>.
2015-06-16 02:14:40 +00:00
Dan Albert
cfbe6014b4 am cce405a1: Add a sys/procfs.h.
* commit 'cce405a134c338ff6b76c56aafe02ef73c93a38c':
  Add a sys/procfs.h.
2015-06-16 02:02:46 +00:00
Elliott Hughes
55a70cd113 am 7051c0f2: Fix two accidentally leaked mips64 symbols.
* commit '7051c0f2a50cb2bafee23182c3cbc9a86d361a13':
  Fix two accidentally leaked mips64 symbols.
2015-06-16 02:02:45 +00:00
Dmitriy Ivanov
636f5ddddc Add versions to libm.so symbols
Bug: http://b/20139821
Change-Id: Ifdfcac62d59eb8f0985990aa8512046ecb87449e
2015-06-15 18:52:20 -07:00
Elliott Hughes
df11f340ca Merge "Avoid name collision with user_fpsimd_state in <asm/ptrace.h>." 2015-06-16 01:50:25 +00:00
Elliott Hughes
2309b36b8f am 27f5c37b: Merge "Fix two accidentally leaked mips64 symbols."
* commit '27f5c37b12042dea3d9521b7b0287820c1e669f0':
  Fix two accidentally leaked mips64 symbols.
2015-06-16 01:50:12 +00:00
Elliott Hughes
a7ba695ad0 am 333bdad3: Merge "Add a sys/procfs.h."
* commit '333bdad361b566df2d9d2d5968fb23e8d3983019':
  Add a sys/procfs.h.
2015-06-16 01:50:11 +00:00
Elliott Hughes
0577733c2e Avoid name collision with user_fpsimd_state in <asm/ptrace.h>.
We don't want to use <asm/ptrace.h> because (a) it'll drag in a bunch of
namespace pollution and (b) the registers should be "long double" for
userspace, not the kernel's uint128s. So just use a slightly different
name for our struct (which matches the traditional names for these structs
anyway).

Bug: http://b/21695943
Bug: https://code.google.com/p/android/issues/detail?id=86712
Change-Id: I8812ca98cfe6b649dbd31f7d6aea41928ba2acbd
2015-06-15 18:47:39 -07:00
Elliott Hughes
27f5c37b12 Merge "Fix two accidentally leaked mips64 symbols." 2015-06-16 01:36:29 +00:00
Elliott Hughes
333bdad361 Merge "Add a sys/procfs.h." 2015-06-16 01:28:48 +00:00
Elliott Hughes
469b418784 Fix two accidentally leaked mips64 symbols.
Bug: http://b/21857154
Change-Id: Ie1fb63f54c6c527b8c1172e8f6ce48f23fca9b41
2015-06-15 17:49:54 -07:00
Dan Albert
bf18c61798 Add a sys/procfs.h.
Needed for building gdbserver out of the box.

Bug: http://b/21695943
Bug: https://code.google.com/p/android/issues/detail?id=86712
Change-Id: Ieadda2b595f08bfddfa61fcd68006b8e7c1a438d
2015-06-15 14:33:54 -07:00
Sharvil Nanavati
f5aba62718 am fdcaeac1: am 00cef820: am 64e9e71c: Define nonportable pthread mutex macros with the _NP suffix.
* commit 'fdcaeac1a91c3e0a1a13498b7d1d8b223e700a86':
  Define nonportable pthread mutex macros with the _NP suffix.
2015-06-15 16:13:36 +00:00
Dmitriy Ivanov
ec7f603cc2 am 713ae464: Merge "Make path to apk compliant with jar url format"
* commit '713ae464abb942dafcafd738d9e00fcc8c3bb601':
  Make path to apk compliant with jar url format
2015-06-13 02:25:50 +00:00
Dmitriy Ivanov
713ae464ab Merge "Make path to apk compliant with jar url format" 2015-06-13 00:44:07 +00:00
Dmitriy Ivanov
65126c93a2 am ae1e7545: Merge "Make path to apk compliant with jar url format" into mnc-dev
* commit 'ae1e75458ad281f121116c8c5dfe9d8086e43a2b':
  Make path to apk compliant with jar url format
2015-06-11 22:43:14 +00:00
Dmitriy Ivanov
402a75060d Make path to apk compliant with jar url format
Bug: http://b/21726698
Bug: http://b/8076853
Change-Id: I8c1942a98fe3119746b4dc9f60a7ff215ea7009c
(cherry picked from commit 524f1f1efe0cb32714c61e26f21701ac952b9e42)
2015-06-11 11:01:23 -07:00
Elliott Hughes
05923bacbc am 9ef26a3c: Merge "Always build libm with clang."
* commit '9ef26a3c4cd2e6d469f771815a07cb820800beb6':
  Always build libm with clang.
2015-06-11 17:20:22 +00:00
Elliott Hughes
9ef26a3c4c Merge "Always build libm with clang." 2015-06-11 16:58:23 +00:00
Dmitriy Ivanov
9edb1a2b31 am 38263dd9: Fix l_addr for the linker
* commit '38263dd91a4b68e2ad0afe458c9a20cb360dafeb':
  Fix l_addr for the linker
2015-06-11 12:52:30 +00:00
Elliott Hughes
173ad0a53e Always build libm with clang.
Change-Id: I00df3b83dfa76a7e12f097fb622ceaec3e2bb5a4
2015-06-10 22:55:09 -07:00
Dmitriy Ivanov
571b01186a am b90e9b71: Merge "Fix l_addr for the linker"
* commit 'b90e9b71835957a5f816b9a6da1c23c3b6db4802':
  Fix l_addr for the linker
2015-06-11 03:24:41 +00:00
Dmitriy Ivanov
b90e9b7183 Merge "Fix l_addr for the linker" 2015-06-11 03:05:10 +00:00
Elliott Hughes
351a876407 am 25ac753f: Add process_vm_readv and process_vm_writev.
* commit '25ac753f474492ffa3625ca6b5aae254bb205c33':
  Add process_vm_readv and process_vm_writev.
2015-06-11 02:54:21 +00:00
Elliott Hughes
9165c8579f resolved conflicts for merge of eeb1d33a to mnc-dev-plus-aosp
Change-Id: I5ef79ff7851172189b959bad7d5f8b1431c38b39
2015-06-10 19:49:40 -07:00
Dmitriy Ivanov
175dae92d7 Fix l_addr for the linker
Bug: http://b/21765603
Change-Id: I97710ef2436eac2160e29ba3e4521f6e63a1907c
2015-06-10 19:47:26 -07:00
Elliott Hughes
1a587162a8 am c910de9d: Merge "Add process_vm_readv and process_vm_writev."
* commit 'c910de9d5e6ff5c00356883fb567227ab04e0389':
  Add process_vm_readv and process_vm_writev.
2015-06-11 02:31:54 +00:00
Dmitriy Ivanov
248bb62680 am db68b460: Merge "Fix application_sdk_versions_smoke test"
* commit 'db68b4600d84a213b4714525332f359f3f01c686':
  Fix application_sdk_versions_smoke test
2015-06-11 02:31:43 +00:00
Evgenii Stepanov
98c99d111b am 72af1235: Merge "Support DT_RUNPATH in the linker."
* commit '72af1235e49fa797987dd719e398f53995a50ec4':
  Support DT_RUNPATH in the linker.
2015-06-11 02:31:42 +00:00
Dmitriy Ivanov
e1f3c8b63a am 79b3877a: Fix application_sdk_versions_smoke test
* commit '79b3877a137510946ddd39ab71c0badf1a769c11':
  Fix application_sdk_versions_smoke test
2015-06-11 02:08:30 +00:00
Dmitriy Ivanov
fdf9f04906 am 07f4f5f9: Check if strtab exists before using it
* commit '07f4f5f9edc33d22c41f51224f8be0c0a51e5b6b':
  Check if strtab exists before using it
2015-06-11 02:08:29 +00:00
Elliott Hughes
c910de9d5e Merge "Add process_vm_readv and process_vm_writev." 2015-06-11 01:31:17 +00:00
Elliott Hughes
be57a40d29 Add process_vm_readv and process_vm_writev.
Bug: http://b/21761353
Change-Id: Ic8ef3f241d62d2a4271fbc783c8af50257bac498
2015-06-10 17:24:20 -07:00
Dmitriy Ivanov
db68b4600d Merge "Fix application_sdk_versions_smoke test" 2015-06-11 00:03:46 +00:00
Dmitriy Ivanov
bd3b961186 Fix application_sdk_versions_smoke test
Bug: http://b/21364029
Change-Id: I9716d6b0ea7fae6483629a290dbe695b68526588
(cherry picked from commit 79b3877a137510946ddd39ab71c0badf1a769c11)
2015-06-10 17:03:12 -07:00
Evgenii Stepanov
72af1235e4 Merge "Support DT_RUNPATH in the linker." 2015-06-10 23:56:03 +00:00
Evgenii Stepanov
6865082ca6 Support DT_RUNPATH in the linker.
Only $ORIGIN substitution is supported, but not linux-specific $LIB
or $PLATFORM.

Change-Id: I5814a016c7c91afba080230a547a863686e7c2b9
2015-06-10 16:44:22 -07:00
Elliott Hughes
46019789bb am ba1d40a3: Merge "Statically linked executables should honor AT_SECURE."
* commit 'ba1d40a3f16525e70e4b68c5a82e7cc9f8a4b76a':
  Statically linked executables should honor AT_SECURE.
2015-06-10 23:12:08 +00:00
Dmitriy Ivanov
be98337273 am f3463db7: Merge "Check if strtab exists before using it"
* commit 'f3463db7eb37cb7d9dd5e32dfb5b2bd24f808fb3':
  Check if strtab exists before using it
2015-06-10 22:53:07 +00:00
Elliott Hughes
ba1d40a3f1 Merge "Statically linked executables should honor AT_SECURE." 2015-06-10 22:49:57 +00:00
Dmitriy Ivanov
f3463db7eb Merge "Check if strtab exists before using it" 2015-06-10 22:26:07 +00:00
Christopher Ferris
8cba773269 am 6a494915: Merge "Allow NULL in pthread_mutex_lock/unlock."
* commit '6a494915d795d4f1c4d27aab3da0b65e7e4c0b18':
  Allow NULL in pthread_mutex_lock/unlock.
2015-06-10 20:36:49 +00:00
Christopher Ferris
3c716b1b80 am 511cfd9d: Allow NULL in pthread_mutex_lock/unlock.
* commit '511cfd9dc8cb41bca4920687c7d816ee916ee8e5':
  Allow NULL in pthread_mutex_lock/unlock.
2015-06-10 18:15:04 +00:00
Christopher Ferris
6a494915d7 Merge "Allow NULL in pthread_mutex_lock/unlock." 2015-06-10 17:53:46 +00:00
Christopher Ferris
60907c7f4e Allow NULL in pthread_mutex_lock/unlock.
The pthread_mutex_lock and pthread_mutex_unlock were allowed to
fail silently on L 32 bit devices when passed a NULL. We changed
this to a crash on 32 bit devices, but there are still games that make
these calls and are not likely to be updated. Therefore, once again
allow NULL to be passed in on 32 bit devices.

Bug: 19995172
(cherry picked from commit 511cfd9dc8cb41bca4920687c7d816ee916ee8e5)

Change-Id: I159a99a941cff94297ef3fffda7075f8ef1ae252
2015-06-10 10:50:43 -07:00
Elliott Hughes
1801db3d3f Statically linked executables should honor AT_SECURE.
Bug: http://b/19647373
Change-Id: I10e7682d9cec26a523f1a3597ca5326c3ca42ebe
2015-06-09 20:10:25 -07:00
Dmitriy Ivanov
787d4388e3 am 1cfbd94a: Merge "Add flag that makes linker honor min(p_vaddr)"
* commit '1cfbd94a2f40743757cdecd51cfa3e3ab545a5c5':
  Add flag that makes linker honor min(p_vaddr)
2015-06-09 21:26:04 +00:00
Dmitriy Ivanov
1cfbd94a2f Merge "Add flag that makes linker honor min(p_vaddr)" 2015-06-09 21:02:28 +00:00
Dmitriy Ivanov
8a11628355 Add flag that makes linker honor min(p_vaddr)
Bug: http://b/21523078
Change-Id: Ice72766fb6ad3bd333c32b496e7870121e17a763
2015-06-09 13:44:31 -07:00
Ying Wang
a950c9ef00 am 866d6fb0: Merge "Fix Mac checkbuild."
* commit '866d6fb09085d5b74670b5c6137fcfe130b6c2ca':
  Fix Mac checkbuild.
2015-06-08 20:08:11 +00:00
Ying Wang
98af7902ee am 26e663d4: (-s ours) Fix Mac checkbuild.
* commit '26e663d4796e74fc40a62b3d2a438b726bbb056e':
  Fix Mac checkbuild.
2015-06-08 19:53:02 +00:00
Ying Wang
866d6fb090 Merge "Fix Mac checkbuild." 2015-06-08 19:26:55 +00:00
Ying Wang
4900f1c4cd Fix Mac checkbuild.
Bug: 21669400
Change-Id: I54691661605a2e2c1871781964aed343840b8560

(cherry-pick from commit 33c2d441b8f816722bed984c6e12b82b888c3ca2)
2015-06-08 12:23:48 -07:00
Nick Kralevich
59e553c7e0 am 12fb28bb: Merge "Add O_PATH support for flistxattr()"
* commit '12fb28bbd85cea72bd951d8263b05e54415780e7':
  Add O_PATH support for flistxattr()
2015-06-08 18:02:31 +00:00
Dmitriy Ivanov
624b8f17a1 Check if strtab exists before using it
Bug: http://b/21696087
Change-Id: I1e22d5fd6fe2faead332249493123c9a085081e9
2015-06-08 10:41:33 -07:00
Nick Kralevich
12fb28bbd8 Merge "Add O_PATH support for flistxattr()" 2015-06-08 17:39:01 +00:00
Christopher Ferris
7a9cfcce43 am e49af9bc: Export two dlmalloc functions everywhere.
* commit 'e49af9bca5706ecbc9c4f3cf15be990294106952':
  Export two dlmalloc functions everywhere.
2015-06-06 21:47:45 +00:00
Christopher Ferris
c9ef605751 am 7a799f2b: Fix a few libc makefile mishaps.
* commit '7a799f2b02ee453a46ee368cd8c41477e0567852':
  Fix a few libc makefile mishaps.
2015-06-06 21:47:44 +00:00
Christopher Ferris
84128f2523 am d9dc13d4: Merge "Export two dlmalloc functions everywhere."
* commit 'd9dc13d4172516342ceebf1b16624ed9fdf3fca2':
  Export two dlmalloc functions everywhere.
2015-06-06 21:05:55 +00:00
Christopher Ferris
d9dc13d417 Merge "Export two dlmalloc functions everywhere." 2015-06-06 20:17:27 +00:00
Nick Kralevich
e1d0810cd7 Add O_PATH support for flistxattr()
A continuation of commit 2825f10b7f61558c264231a536cf3affc0d84204.

Add O_PATH compatibility support for flistxattr(). This allows
a process to list out all the extended attributes associated with
O_PATH file descriptors.

Change-Id: Ie2285ac7ad2e4eac427ddba6c2d182d41b130f75
2015-06-06 11:25:41 -07:00
Christopher Ferris
a3ae51aa89 am 966f84b1: Merge "Fix a few libc makefile mishaps."
* commit '966f84b11dca7caf53c67664d811b99567cab7ee':
  Fix a few libc makefile mishaps.
2015-06-06 00:35:17 +00:00
Christopher Ferris
f9554a1776 Export two dlmalloc functions everywhere.
The functions dlmalloc_inspect_all and dlmalloc_trim get
exported on devices that use dlmalloc, so be consistent and
export them everywhere.

Bug: 21640784
Change-Id: I5b8796cd03c8f401d37d9c22823144f766f9c4c7
2015-06-05 17:12:17 -07:00
Christopher Ferris
966f84b11d Merge "Fix a few libc makefile mishaps." 2015-06-06 00:07:58 +00:00
Yabin Cui
eb641b0d4a am e997e915: am 61b040a5: resolved conflicts for merge of ea248d9c to lmp-mr1-ub-dev
* commit 'e997e9155e72f1b0b40d832ac91fd39951acc1b9':
  Make sys_resource test more robust.
2015-06-05 02:43:18 +00:00
Christopher Ferris
19fee2ca8b Fix a few libc makefile mishaps.
These are the problems fixed in this CL:

- The ndk_cruft.cpp file was not compiled for 64 bit.
- Some files where not compiled for libc_bionic.a due to a missing
  patch-up-arch-specific-flags call.
- The libc_bionic_ndk.a patch up call was using bionic src, not
  the bionic_ndk_src_files.
- Move mmap.cpp to the ndk src list where it was before because of
  the above errors.

Bug: 21640784
Change-Id: I31e97bc8bf347c8e584cc17aa4b984a7d122b298
2015-06-04 19:40:50 -07:00
Dmitriy Ivanov
1385421573 am c534603f: Hide __atexit
* commit 'c534603f8d2a03e0ace678adc83d6194a7afdbe9':
  Hide __atexit
2015-06-04 23:07:59 +00:00
Dmitriy Ivanov
ffcd909534 am 12ca831b: Merge "Hide __atexit"
* commit '12ca831b0e03e85a2f5588bdf834dc6046d1ac6c':
  Hide __atexit
2015-06-04 22:14:01 +00:00
Dmitriy Ivanov
12ca831b0e Merge "Hide __atexit" 2015-06-04 21:50:05 +00:00
Dmitriy Ivanov
9cf6fc304b Hide __atexit
Bug: http://b/21640806
Change-Id: I778b35c8c7538859179e97fcf5a82db2fcd9e50f
2015-06-04 14:33:18 -07:00
Christopher Ferris
16c64d4aa1 am b68b8b4b: Merge "Reorder DIR structure due to bad apps."
* commit 'b68b8b4b95d3e373a8975c0b650cde4d348ff118':
  Reorder DIR structure due to bad apps.
2015-06-04 21:30:25 +00:00
Christopher Ferris
699df5ca48 am f2e86cd9: Merge "Reorder DIR structure due to bad apps." into mnc-dev
* commit 'f2e86cd98038d6239265d936c32774b7289bfdc7':
  Reorder DIR structure due to bad apps.
2015-06-04 21:22:41 +00:00
Christopher Ferris
b68b8b4b95 Merge "Reorder DIR structure due to bad apps." 2015-06-04 21:06:23 +00:00
Christopher Ferris
c062218a9b Reorder DIR structure due to bad apps.
It turns out that apportable apps expect that the DIR structure is
the same as in L and below. Modify the structure to have the same
order, and move the new variable to the end of the structure.

Bug: 21037208
(cherry picked from commit 5edb0f40f654c804d38f1bff43f91719e189c892)

Change-Id: I0c1ab5e295ec8bef638daa4cfea5830aeea602e6
2015-06-04 14:04:16 -07:00
Dmitriy Ivanov
c677d69258 am 34de7f84: Strip version info when extracting symbols
* commit '34de7f849799ea47534d617595ab566690a16f2f':
  Strip version info when extracting symbols
2015-06-04 19:22:21 +00:00
Dmitriy Ivanov
2706592b24 am 5cce2e72: Merge "Strip version info when extracting symbols"
* commit '5cce2e7205c92e6c4199dc5f4155e003f0a5b832':
  Strip version info when extracting symbols
2015-06-04 19:00:32 +00:00
Dmitriy Ivanov
5cce2e7205 Merge "Strip version info when extracting symbols" 2015-06-04 18:06:03 +00:00
Dmitriy Ivanov
6cda074289 Strip version info when extracting symbols
Bug: http://b/20139821
Change-Id: I1c1ed1b97a75936407e996698b98b94a7175ac30
2015-06-04 17:56:02 +00:00
Dmitriy Ivanov
9fbb73352d am 0c29aaba: Merge "Backward compatibility for dlsym(RTLD_DEFAULT, ...)" into mnc-dev
* commit '0c29aabad25832ec249288c8da3cf080c898ba74':
  Backward compatibility for dlsym(RTLD_DEFAULT, ...)
2015-06-03 02:22:59 +00:00
Dmitriy Ivanov
61e327fdf5 am 3931b6d9: Merge "Backward compatibility for dlsym(RTLD_DEFAULT, ...)"
* commit '3931b6d9b37a47e0921e329ff5846b7fd21cdd7b':
  Backward compatibility for dlsym(RTLD_DEFAULT, ...)
2015-06-03 01:31:48 +00:00
Dmitriy Ivanov
3931b6d9b3 Merge "Backward compatibility for dlsym(RTLD_DEFAULT, ...)" 2015-06-03 01:11:12 +00:00
Dmitriy Ivanov
1913352c6b Backward compatibility for dlsym(RTLD_DEFAULT, ...)
Do not skip RTLD_LOCAL libraries in dlsym(RTLD_DEFAULT, ...)
 if the library is opened by application with target api level <= 22

Bug: http://b/21565766
Bug: http://b/17512583
Change-Id: Ic45ed1e4f53e84cba9d74cab6b0049c0c7aa8423
(cherry picked from commit 04f7e3e955ba7de5f449c995e667659319dc1cce)
2015-06-02 18:09:23 -07:00
Nick Kralevich
e587e0c92a am f56bad97: Merge "libc: Add O_PATH support for fgetxattr / fsetxattr" into mnc-dev
* commit 'f56bad974bced86671030b13d99f8ec2f497521e':
  libc: Add O_PATH support for fgetxattr / fsetxattr
2015-06-02 22:21:20 +00:00
Dmitriy Ivanov
27b002baef am 11b15b23: Merge "Work around for libraries without dt_soname"
* commit '11b15b23aa6044b1fa2ce89744643a0cc072b348':
  Work around for libraries without dt_soname
2015-06-02 21:30:54 +00:00
Dmitriy Ivanov
719278b5e4 am 38c37d67: Work around for libraries without dt_soname
* commit '38c37d6705f420ecac4146c11d79bee6e0ca8a03':
  Work around for libraries without dt_soname
2015-06-02 21:30:11 +00:00
Dmitriy Ivanov
11b15b23aa Merge "Work around for libraries without dt_soname" 2015-06-02 21:09:41 +00:00
Dmitriy Ivanov
75108f4f83 Work around for libraries without dt_soname
Applies only for apps targeting sdk version <= 22

Bug: http://b/21565766
Change-Id: If0bf2229dc1341e9ca09f9a05d0890515273d5a2
(cherry picked from commit 38c37d6705f420ecac4146c11d79bee6e0ca8a03)
2015-06-02 14:02:22 -07:00
Dmitriy Ivanov
8d67a598c5 am c4ebe60e: Fix dlsym(handle_of_main_executable, ...)
* commit 'c4ebe60e1a2fc165ff11442765325628e27f2a05':
  Fix dlsym(handle_of_main_executable, ...)
2015-06-02 14:22:58 +00:00
Dmitriy Ivanov
4af36c8d99 am ef55f967: Merge "Fix dlsym(handle_of_main_executable, ...)"
* commit 'ef55f967234f160a4e00a51ca53377fadd17715d':
  Fix dlsym(handle_of_main_executable, ...)
2015-06-02 00:11:05 +00:00
Dmitriy Ivanov
ef55f96723 Merge "Fix dlsym(handle_of_main_executable, ...)" 2015-06-01 23:51:24 +00:00
Nick Kralevich
1c9347866f am e7deb145: Merge "libc: Add O_PATH support for fgetxattr / fsetxattr"
* commit 'e7deb145c66cc3434bf0f499de20b2c9d66cb2db':
  libc: Add O_PATH support for fgetxattr / fsetxattr
2015-06-01 23:42:37 +00:00
Dan Albert
0c4314b658 am c5e02eeb: Cleanup ftruncate negative test.
* commit 'c5e02eeb353c3cdd357413f563701d5018fc76a5':
  Cleanup ftruncate negative test.
2015-06-01 23:21:38 +00:00
Dan Albert
654c28e0a3 am 5f3e19db: (-s ours) Fix error handling for negative size in ftruncate.
* commit '5f3e19dbbeb851fff5cf7f9869d344feca479413':
  Fix error handling for negative size in ftruncate.
2015-06-01 23:21:37 +00:00
Nick Kralevich
e7deb145c6 Merge "libc: Add O_PATH support for fgetxattr / fsetxattr" 2015-06-01 23:16:14 +00:00
Nick Kralevich
2825f10b7f libc: Add O_PATH support for fgetxattr / fsetxattr
Support O_PATH file descriptors when handling fgetxattr and fsetxattr.
This avoids requiring file read access to pull extended attributes.

This is needed to support O_PATH file descriptors when calling
SELinux's fgetfilecon() call. In particular, this allows the querying
and setting of SELinux file context by using something like the following
code:

  int dirfd = open("/path/to/dir", O_DIRECTORY);
  int fd = openat(dirfd, "file", O_PATH | O_NOFOLLOW);
  char *context;
  fgetfilecon(fd, &context);

This change was motivated by a comment in
https://android-review.googlesource.com/#/c/152680/1/toys/posix/ls.c

Change-Id: Ic0cdf9f9dd0e35a63b44a4c4a08400020041eddf
2015-06-01 15:51:56 -07:00
Dmitriy Ivanov
f439b5a318 Fix dlsym(handle_of_main_executable, ...)
According to man dlopen(3) and posix docs in the case when si is handle
  of the main executable we need to search not only in the executable and its
  dependencies but also in all libraries loaded with RTLD_GLOBAL.

  see also: http://pubs.opengroup.org/onlinepubs/9699919799/functions/dlopen.html

Bug: http://b/21528224
Bug: http://b/17512583
Bug: https://code.google.com/p/android/issues/detail?id=173822
Change-Id: Ib2801367ba48b6f3704da89a6d9f5e6911430013
2015-06-01 14:33:43 -07:00
Dan Albert
944d901cfd am ef607cda: Merge "Cleanup ftruncate negative test."
* commit 'ef607cdae24363c5e6b6fc72607a4cff78623851':
  Cleanup ftruncate negative test.
2015-06-01 20:45:10 +00:00
Dan Albert
ef607cdae2 Merge "Cleanup ftruncate negative test." 2015-06-01 20:24:15 +00:00
Dan Albert
9d476a02e9 Cleanup ftruncate negative test.
Addresses post-submit comments from
I54692ab8105dd09db6af7a2c0894a17bdd118aa0.

Bug: http://b/21309901
Change-Id: Ie19ee8cdcc4055a65fe7dfc103156e54eafe8977
2015-06-01 13:22:57 -07:00
Elliott Hughes
a673ad06c8 am d7089168: Merge "[MIPS] Do not use compact branches until GDB supports them"
* commit 'd70891687d742414d457e41a998726e5eb0a09bd':
  [MIPS] Do not use compact branches until GDB supports them
2015-05-29 05:01:57 +00:00
Elliott Hughes
d70891687d Merge "[MIPS] Do not use compact branches until GDB supports them" 2015-05-29 04:39:24 +00:00
Dmitriy Ivanov
e5744bb553 am 55115510: Merge "Improve some of error/warning messages"
* commit '5511551009c5b8b7495af8278ffe914d4a8147b1':
  Improve some of error/warning messages
2015-05-29 00:04:53 +00:00
Dmitriy Ivanov
d5dd23ad09 am 6c2dba86: Merge "Work around incorrect dt_needed entries"
* commit '6c2dba8651f8cf9e406a5c7879fbaee1b0f29980':
  Work around incorrect dt_needed entries
2015-05-29 00:04:52 +00:00
Dmitriy Ivanov
9843fdd82b am ca10ac6d: Improve some of error/warning messages
* commit 'ca10ac6dd45f73752e8822fee606d83116a5721a':
  Improve some of error/warning messages
2015-05-28 23:29:27 +00:00
Dmitriy Ivanov
87298989ea am 4a7c3af0: Work around incorrect dt_needed entries
* commit '4a7c3af054fdb525c8e458434f57f20696f43e31':
  Work around incorrect dt_needed entries
2015-05-28 23:29:26 +00:00
Dmitriy Ivanov
5511551009 Merge "Improve some of error/warning messages" 2015-05-28 22:28:13 +00:00
Dmitriy Ivanov
6c2dba8651 Merge "Work around incorrect dt_needed entries" 2015-05-28 22:25:15 +00:00
Dmitriy Ivanov
d974e88046 Work around incorrect dt_needed entries
This applies for apps targeting sdk<=22 and
  only for lp32 platforms.

Bug: http://b/21364029
Change-Id: I903e81c9ccda2a8beaba1d132d68c77d30a4cdb2
2015-05-28 14:56:42 -07:00
Dmitriy Ivanov
087005f37e Improve some of error/warning messages
Bug: http://b/20464031
Change-Id: I948141c46f9e054fc45f5934153dee56ce3cd558
2015-05-28 11:44:31 -07:00
Dmitriy Ivanov
656d176157 am d8ead181: Add functions to provide target sdk version
* commit 'd8ead18145cba98fdc7256f9a0e69b8c1c90cd1c':
  Add functions to provide target sdk version
2015-05-27 23:50:05 +00:00
Dmitriy Ivanov
80eded99d3 am d717b1a3: Merge "Add functions to provide target sdk version"
* commit 'd717b1a3e55db9b7625a46bec950e856cc107951':
  Add functions to provide target sdk version
2015-05-27 23:14:48 +00:00
Dmitriy Ivanov
d717b1a3e5 Merge "Add functions to provide target sdk version" 2015-05-27 22:44:28 +00:00
Dmitriy Ivanov
79fd668bb4 Add functions to provide target sdk version
Bug: http://b/21364029
Change-Id: I8648d1bff6c8fd6e7cd12da7f128e048b9f2829a
2015-05-27 14:31:36 -07:00
Simon Baldwin
6fbb7cf4a9 am 560aacee: Merge "Fix unit tests, and extend for other architectures"
* commit '560aacee84ecfd1aa8983d0ab58b81fbbe34911d':
  Fix unit tests, and extend for other architectures
2015-05-27 17:09:45 +00:00
Simon Baldwin
560aacee84 Merge "Fix unit tests, and extend for other architectures" 2015-05-27 16:42:38 +00:00
Simon Baldwin
1011e1a402 Fix unit tests, and extend for other architectures
On unpacking, reinstate any p_align values that packing reduced to
page size.  Ensures a round-trip pack and unpack is bit-equivalent
to the original input.
https://android-review.googlesource.com/#/c/148492/

Extend unit tests to include ia32, x64, and mips32.

Recreate test data for arm32 and arm64.  Generate new test data for
ia32, x64, and mips32.

Bug: http://b/20687795
Bug: http://b/18051137
Change-Id: Ifbca8e206ef447297ba4f19272b813702be27a35
2015-05-27 13:20:00 +01:00
Dmitriy Ivanov
68da29608b am fad15145: Merge "Remove LOCAL_CONLY_FLAGS it is no-op."
* commit 'fad15145f8ee28be45cf2c870d3b87f22a2f07c3':
  Remove LOCAL_CONLY_FLAGS it is no-op.
2015-05-26 21:21:30 +00:00
Dmitriy Ivanov
fad15145f8 Merge "Remove LOCAL_CONLY_FLAGS it is no-op." 2015-05-26 20:56:37 +00:00
Dmitriy Ivanov
41c99cdbb9 Remove LOCAL_CONLY_FLAGS it is no-op.
Change-Id: Ib52b85d176dc9d46d7550f01537b2635e873d6ad
2015-05-26 11:38:59 -07:00
Nikola Veljkovic
3cec6eca92 [MIPS] Do not use compact branches until GDB supports them
GDB does not yet have support for compact branches, and is not able
to set a breakpoint on rtld_db_dlactivity(), which is compiled into
one JIC instruction. Unfortunately, We cannot turn off generation of
JIC compact branch. Instead, add unoptimized FP handling code, so GDB
will have something to land on.

Change-Id: Iddcf40ec018972398179018d049b8323fcd258b7
2015-05-25 16:28:14 +02:00
Dmitriy Ivanov
bd1d447821 am 15309fde: Fix RTLD_NEXT lookup for the local_group
* commit '15309fde91b3989a1af139db422acf68e16a9258':
  Fix RTLD_NEXT lookup for the local_group
2015-05-22 22:45:39 +00:00
Dmitriy Ivanov
e0e07a9f96 am aaafbe12: Merge "Fix RTLD_NEXT lookup for the local_group"
* commit 'aaafbe128f51dff92da3cf4f5fc9b47f04f05261':
  Fix RTLD_NEXT lookup for the local_group
2015-05-22 22:36:32 +00:00
Dmitriy Ivanov
aaafbe128f Merge "Fix RTLD_NEXT lookup for the local_group" 2015-05-22 22:22:22 +00:00
Dmitriy Ivanov
b96ac41b32 Fix RTLD_NEXT lookup for the local_group
Linker used to skip RTLD_NEXT within local_group when
  caller->next is nullptr (which represents load order
  but not the order within local_group dependency tree)

Bug: http://b/21380474
Change-Id: I178fc4657b19bceb871635b177c1df67855b1708
2015-05-22 19:46:11 +00:00
Dan Albert
4ee60d1c4f am ffe01a3d: Merge "Fix error handling for negative size in ftruncate."
* commit 'ffe01a3de62d17cbe1cdf3b40a91d1ac9a9d36b5':
  Fix error handling for negative size in ftruncate.
2015-05-21 21:03:17 +00:00
Dan Albert
ffe01a3de6 Merge "Fix error handling for negative size in ftruncate." 2015-05-21 20:41:25 +00:00
Yabin Cui
2737227842 am 4fc106d3: Merge "Fix pthread_attr_getstack__main_thread failure on glibc."
* commit '4fc106d34b70da868d194e8a0f0a3cddd1f4c22d':
  Fix pthread_attr_getstack__main_thread failure on glibc.
2015-05-20 23:16:02 +00:00
Yabin Cui
4fc106d34b Merge "Fix pthread_attr_getstack__main_thread failure on glibc." 2015-05-20 22:52:38 +00:00
Yabin Cui
b042c78e36 am c15a9352: am fd20a8c2: resolved conflicts for merge of 473d96c0 to lmp-mr1-ub-dev
* commit 'c15a935202319a41ee0be94afcdbde1d07568ec8':
  Fix timer flaky test in lollipop-mr1-cts-dev.
2015-05-20 22:12:31 +00:00
Yabin Cui
b0c6f2dba2 Fix pthread_attr_getstack__main_thread failure on glibc.
Move test of bionic specific implementation into bionic ifdef.

Bug: 19805726
Change-Id: Idf369b16e7f41f060c75b0aaf34e05cf3c161aa9
2015-05-20 14:41:15 -07:00
Dan Albert
c05554ec5c Fix error handling for negative size in ftruncate.
Bug: 21309901
Change-Id: I54692ab8105dd09db6af7a2c0894a17bdd118aa0
2015-05-20 14:20:33 -07:00
Yabin Cui
369208d597 am 7490c5c5: Hide rt_sigqueueinfo.
* commit '7490c5c5944391e99bc6c3564bce03d3cd4a39e0':
  Hide rt_sigqueueinfo.
2015-05-18 21:10:25 +00:00
Yabin Cui
1e63d31e77 am c02bdc76: Merge "Hide rt_sigqueueinfo."
* commit 'c02bdc76a21f6149c7867982e66ab16982e01c1b':
  Hide rt_sigqueueinfo.
2015-05-18 20:46:23 +00:00
Yabin Cui
c02bdc76a2 Merge "Hide rt_sigqueueinfo." 2015-05-18 20:29:44 +00:00
Yabin Cui
40a8f214a5 Hide rt_sigqueueinfo.
Bug: 19358804
Change-Id: I38a53ad64c81d0eefdd1d24599e769fd8a477a56
2015-05-18 11:29:20 -07:00
Yabin Cui
f18a9f9662 am 2b5c2285: Remove pthread_detach_no_leak test.
* commit '2b5c2285c0679190b90b954d5e71f7ee8698adba':
  Remove pthread_detach_no_leak test.
2015-05-18 17:56:14 +00:00
Dmitriy Ivanov
75b7b39e9f am 8557eeb0: Merge "Apply work around b/19059885 to x86" into mnc-dev
* commit '8557eeb0add011ff37edc86f50f423ce681eeb2b':
  Apply work around b/19059885 to x86
2015-05-16 17:19:01 +00:00
Dmitriy Ivanov
dae8ad3da0 am a42b5bcd: Merge "Apply work around b/19059885 to x86"
* commit 'a42b5bcd896daa83b479e7964c0fa8cf1abf5a1d':
  Apply work around b/19059885 to x86
2015-05-16 17:12:03 +00:00
Dmitriy Ivanov
a42b5bcd89 Merge "Apply work around b/19059885 to x86" 2015-05-16 16:56:49 +00:00
Dmitriy Ivanov
9185e04f72 Apply work around b/19059885 to x86
Bug: http://b/19059885
Bug: http://b/21203348
Change-Id: Ic375e9f877d68de8f866d17362879a7dde638465
(cherry picked from commit 69a5fb951d69689dedd83cb033ae3dcd0ef05b65)
2015-05-15 18:42:14 -07:00
Chih-Hung Hsieh
dea8937f90 am 43850d19: Use unified syntax to compile with both llvm and gcc.
* commit '43850d19f422d4850bebf765607e4f4d4b99df2e':
  Use unified syntax to compile with both llvm and gcc.
2015-05-16 00:21:18 +00:00
Chih-Hung Hsieh
11ebac5e01 resolved conflicts for merge of 22c21c6b to mnc-dev-plus-aosp
Change-Id: I8a3c79c441ec8d1002f20c9d55bffaa5efa01d14
2015-05-15 17:18:22 -07:00
Elliott Hughes
5f13fa2239 am fa7ba622: Don\'t use TEMP_FAILURE_RETRY on close in bionic.
* commit 'fa7ba6227f918dadca787a78ed3269bf86fd234d':
  Don't use TEMP_FAILURE_RETRY on close in bionic.
2015-05-15 23:40:08 +00:00
Elliott Hughes
1d8336d037 am 882283e9: Merge "Don\'t use TEMP_FAILURE_RETRY on close in bionic."
* commit '882283e9e2e64e596f1a244fa25d3586b2dea4da':
  Don't use TEMP_FAILURE_RETRY on close in bionic.
2015-05-15 23:39:38 +00:00
Elliott Hughes
882283e9e2 Merge "Don't use TEMP_FAILURE_RETRY on close in bionic." 2015-05-15 23:24:12 +00:00
Elliott Hughes
4e8ef698d0 Don't use TEMP_FAILURE_RETRY on close in bionic.
Bug: http://b/20501816
Change-Id: Id64b5109cc2b165fa0351b6edbb865a5e5058008
2015-05-15 16:20:07 -07:00
Dmitriy Ivanov
ad41d7f76b am ff407803: Remove -z global workaround for target x86
* commit 'ff407803dbbee26ab19c02aaece0e75c019534c4':
  Remove -z global workaround for target x86
2015-05-15 20:10:33 +00:00
Dmitriy Ivanov
408023a498 am 1d52b8b0: Merge "Remove -z global workaround for target x86"
* commit '1d52b8b07c327a6ef4936a7b9b08ddd4ee85002e':
  Remove -z global workaround for target x86
2015-05-15 18:05:43 +00:00
Dmitriy Ivanov
1d52b8b07c Merge "Remove -z global workaround for target x86" 2015-05-15 17:30:02 +00:00
John Reck
1a7a109409 am b00c23a8: Merge "Fix regression in crash reporting"
* commit 'b00c23a8dbc285673a4124797f8224f42082fd5a':
  Fix regression in crash reporting
2015-05-15 16:57:03 +00:00
John Reck
9f2ae81510 am d7ad443c: Fix regression in crash reporting
* commit 'd7ad443cfd4e1315cdf45210bc94bb68e0564b8f':
  Fix regression in crash reporting
2015-05-15 16:37:57 +00:00
John Reck
b00c23a8db Merge "Fix regression in crash reporting" 2015-05-15 16:29:42 +00:00
John Reck
e77e335b54 Fix regression in crash reporting
Bug: 19532651

Partial revert of be0e43b77676338fd5e6a82c9cc2b6302d579de2

Change-Id: I99e220328aff985facb920ebcd84ac1a016759b5
(cherry picked from commit d7ad443cfd4e1315cdf45210bc94bb68e0564b8f)
2015-05-15 09:28:10 -07:00
Dmitriy Ivanov
933332462d Remove -z global workaround for target x86
Change-Id: I08e75a1c7437c97e4af59316d2c14c7fa3f65e03
2015-05-14 21:28:21 -07:00
Spencer Low
8c5509ee5a am 2a44cfbd: ScopedFd: Don\'t use TEMP_FAILURE_RETRY() with close()
* commit '2a44cfbd7d64596795836e9ae6f6c642869d6d78':
  ScopedFd: Don't use TEMP_FAILURE_RETRY() with close()
2015-05-14 01:45:59 +00:00
Elliott Hughes
f12a2d6708 am 0378d8f6: Merge "ScopedFd: Don\'t use TEMP_FAILURE_RETRY() with close()"
* commit '0378d8f65126b2d94c731f2719a68773e370f615':
  ScopedFd: Don't use TEMP_FAILURE_RETRY() with close()
2015-05-14 00:48:29 +00:00
Elliott Hughes
0378d8f651 Merge "ScopedFd: Don't use TEMP_FAILURE_RETRY() with close()" 2015-05-14 00:27:46 +00:00
Elliott Hughes
8ba08b634c am 706eafc9: Merge "Fix unused result errors in bionic."
* commit '706eafc9b05b2662e1bf139e678cbc784440cb58':
  Fix unused result errors in bionic.
2015-05-13 21:26:55 +00:00
Elliott Hughes
706eafc9b0 Merge "Fix unused result errors in bionic." 2015-05-13 21:09:42 +00:00
Spencer Low
0346ad7a4f ScopedFd: Don't use TEMP_FAILURE_RETRY() with close()
According to the comments in Posix_close(), TEMP_FAILURE_RETRY() should
not be used with close():

462bdac45c%5E%21/#F12

Kill ScopedFd by simplifying the single caller.

Change-Id: I248c40b8c2fc95f1938a6edfc245c81847fc44af
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
2015-05-13 13:27:11 -07:00
Elliott Hughes
c217373bd6 Fix unused result errors in bionic.
This lets us use _FORTIFY_SOURCE=2 on the host.

Change-Id: I69f5ff9834bfd595aae6584104bee10c4d8a5eeb
2015-05-13 13:18:04 -07:00
Dmitriy Ivanov
25f9d52810 am fe77d2d0: Merge "Improved dlsym tests and fixes to linker"
* commit 'fe77d2d0036306eec978eccf7b4db81fa424a2f3':
  Improved dlsym tests and fixes to linker
2015-05-13 15:52:28 +00:00
Elliott Hughes
1d6e8f4345 am d0763ba0: Merge "Update NOTICE files (the second time today)."
* commit 'd0763ba07693ec1d56f94e53e615eb4d7019eefa':
  Update NOTICE files (the second time today).
2015-05-13 15:42:00 +00:00
Elliott Hughes
ebd4fc9328 resolved conflicts for merge of 3ff027e5 to mnc-dev-plus-aosp
Change-Id: I2ed217729d8f0d60f9e8e21735bb0a070b6a813f
2015-05-13 08:39:55 -07:00
Elliott Hughes
5a9ab18d94 am 8a330cad: Merge "Simplify three copyright headers."
* commit '8a330cad8db512f5119251f55ac7bf606c552ed0':
  Simplify three copyright headers.
2015-05-13 15:22:09 +00:00
Dmitriy Ivanov
e598be94de am 4bac6ea4: Improved dlsym tests and fixes to linker
* commit '4bac6ea463a8f20793f5c1425965729ded1419fe':
  Improved dlsym tests and fixes to linker
2015-05-12 21:09:22 +00:00
Dmitriy Ivanov
fe77d2d003 Merge "Improved dlsym tests and fixes to linker" 2015-05-12 20:48:17 +00:00
Dmitriy Ivanov
697bd9fd38 Improved dlsym tests and fixes to linker
Answers the question: what if dependent library
 was preloaded with RTLD_LOCAL flag.

 Also add test for RTLD_NEXT within local_group.

Bug: http://b/17512583
Change-Id: I79e081e68b3a8c0ed8980d4275a06515fea94ec9
2015-05-12 13:46:40 -07:00
Elliott Hughes
898685ffd2 am 9cde1dc0: Update NOTICE files (the second time today).
* commit '9cde1dc007c0965c7fd2a63d759e80627ee88f0f':
  Update NOTICE files (the second time today).
2015-05-12 18:10:50 +00:00
Elliott Hughes
fe20ea1547 am dd57029e: Simplify three copyright headers.
* commit 'dd57029ed1dfc9cd3116d3797c40d92d5310594e':
  Simplify three copyright headers.
2015-05-12 17:54:48 +00:00
Elliott Hughes
e38f97ade7 am 97139e6a: Merge "Update NOTICE files." into mnc-dev
* commit '97139e6adc255460a1b12e3ccc7b425d11e05eb1':
  Update NOTICE files.
2015-05-12 17:54:47 +00:00
Elliott Hughes
d0763ba076 Merge "Update NOTICE files (the second time today)." 2015-05-12 17:47:05 +00:00
Elliott Hughes
f58ac87182 Update NOTICE files (the second time today).
Change-Id: Ifb031d29ee697ee0682bd651e0081493e8016e67
2015-05-12 10:44:37 -07:00
Elliott Hughes
3ff027e550 Merge "Update NOTICE files." 2015-05-12 17:43:46 +00:00
Elliott Hughes
7e54c762fc Update NOTICE files.
(cherry-pick of f0bd92db8966b04062fda0986dacf80891e1a378.)
Change-Id: I4e170118abf452dd87ffe79d343ba1e2b53955de
2015-05-12 10:33:20 -07:00
Elliott Hughes
8a330cad8d Merge "Simplify three copyright headers." 2015-05-12 17:27:04 +00:00
Elliott Hughes
c69ace87ec Simplify three copyright headers.
There's no reason to have multiple years in our own copyright headers,
and given the stupidity of our NOTICE file generation, it just creates
more junk.

Change-Id: I065a3811c2e2584e3b649a18ad9460286bc72b92
2015-05-12 10:10:01 -07:00
Chih-Hung Hsieh
2e956c1a26 am 972d7fe6: Merge "Use unified syntax to compile with both llvm and gcc."
* commit '972d7fe63a2e0636b070bec266479c27e0bb8c5f':
  Use unified syntax to compile with both llvm and gcc.
2015-05-12 04:50:28 +00:00
Chih-Hung Hsieh
972d7fe63a Merge "Use unified syntax to compile with both llvm and gcc." 2015-05-12 04:31:10 +00:00
Chih-Hung Hsieh
33f33515b5 Use unified syntax to compile with both llvm and gcc.
All arch-arm and arch-arm64 .S files were compiled
by gcc with and without this patch. The output object files
were identical. When compiled with llvm and this patch,
the output files were also identical to gcc's output.

BUG: 18061004
Change-Id: I458914d512ddf5496e4eb3d288bf032cd526d32b
2015-05-11 17:15:03 -07:00
Elliott Hughes
06d3a9c7dd am c9310266: Merge "Fix various bugs in the check-symbols script."
* commit 'c9310266dcdd65e4c5a55ab85d2f9e67a52750bf':
  Fix various bugs in the check-symbols script.
2015-05-11 20:47:29 +00:00
Elliott Hughes
c9310266dc Merge "Fix various bugs in the check-symbols script." 2015-05-11 20:28:57 +00:00
Elliott Hughes
ec738d9494 Fix various bugs in the check-symbols script.
It had bitrotted away during the last release cycle.

Change-Id: I20f0a3b409af4530b81f26299bef9de01530c9fd
2015-05-11 12:10:40 -07:00
Andres Morales
e5c9a8e4cf am 75f2dfca: Merge "remove rootdir build.prop"
* commit '75f2dfca653dd57b6f65bf898ec4f45d87d18926':
  remove rootdir build.prop
2015-05-08 22:30:17 +00:00
Andres Morales
75f2dfca65 Merge "remove rootdir build.prop" 2015-05-08 22:13:44 +00:00
Andres Morales
4e8cda641a remove rootdir build.prop
merge with default.prop

Change-Id: I6cff4527dec2b31bdde42ec26c42ef2782f8deb4
2015-05-08 22:13:15 +00:00
Dmitriy Ivanov
7eb944edee am f7009f45: Switch libc/libcstdc++/libm to hash-style=both
* commit 'f7009f450e596dc76352da7ceefc8caeeb74ff14':
  Switch libc/libcstdc++/libm to hash-style=both
2015-05-08 21:36:45 +00:00
Dmitriy Ivanov
1a31d128b9 am 267f39bf: Merge "Switch libc/libcstdc++/libm to hash-style=both"
* commit '267f39bf63044efe734c82c66f25f9b275a63c0b':
  Switch libc/libcstdc++/libm to hash-style=both
2015-05-08 21:33:57 +00:00
Dmitriy Ivanov
267f39bf63 Merge "Switch libc/libcstdc++/libm to hash-style=both" 2015-05-08 21:07:09 +00:00
Dmitriy Ivanov
88e777d6f4 Switch libc/libcstdc++/libm to hash-style=both
Bug: http://b/19059885
Change-Id: Ie42703d91f291fd689a1cf9c35bcab5c487b9a84
2015-05-08 12:06:20 -07:00
Dan Albert
e16e0e75e2 am 11fc3f47: Merge "Apply same URL workaround to clean build."
* commit '11fc3f47afa6c9566875df02f880dc317cb94437':
  Apply same URL workaround to clean build.
2015-05-08 17:36:58 +00:00
Dan Albert
d9d0207d56 am 5040aa4c: Merge changes from topic \'blobs\' into mnc-dev
* commit '5040aa4c393b12ea12fde0fc757995559c0c8e5d':
  Revert "Fix volantis boot."
  Revert "Fix clang build."
  Revert "Try again to fix clang build."
2015-05-08 17:24:10 +00:00
Dan Albert
11fc3f47af Merge "Apply same URL workaround to clean build." 2015-05-08 17:15:31 +00:00
Dan Albert
8ffddd1725 am a924d4ba: Merge changes from topic \'volantis-blobs\'
* commit 'a924d4ba2673246087b3b16e343e92ad67aefc71':
  Revert "Fix volantis boot."
  Revert "Fix clang build."
  Revert "Try again to fix clang build."
2015-05-08 16:54:37 +00:00
Andres Morales
bc79ee1d45 am 271f0514: Merge "remove rootdir build.prop" into mnc-dev
* commit '271f05148258bfb539099d02856d884aade86ae4':
  remove rootdir build.prop
2015-05-08 16:40:43 +00:00
Dmitriy Ivanov
d950830406 am f41ed6e5: Add definitions of Elf32_Sxword and ELFXX_R_INFO
* commit 'f41ed6e5490864e625c6c3d05d86e3c490602cad':
  Add definitions of Elf32_Sxword and ELFXX_R_INFO
2015-05-08 16:40:12 +00:00
Dan Albert
a924d4ba26 Merge changes from topic 'volantis-blobs'
* changes:
  Revert "Fix volantis boot."
  Revert "Fix clang build."
  Revert "Try again to fix clang build."
2015-05-08 16:35:13 +00:00
Dmitriy Ivanov
d7a6c3d2ae am 7d6b8db2: Merge "Add definitions of Elf32_Sxword and ELFXX_R_INFO"
* commit '7d6b8db28ea4607dbefc25a4f799c4fd1bcc7869':
  Add definitions of Elf32_Sxword and ELFXX_R_INFO
2015-05-08 07:08:27 +00:00
Dmitriy Ivanov
7d6b8db28e Merge "Add definitions of Elf32_Sxword and ELFXX_R_INFO" 2015-05-08 06:49:05 +00:00
Dmitriy Ivanov
ce16a53d39 Add definitions of Elf32_Sxword and ELFXX_R_INFO
Bug: http://b/17056684
Change-Id: If35302245ac3ab40d1c80fb2b04620778c114f87
2015-05-07 23:10:16 -07:00
Yabin Cui
86af743d96 am f9eeea6d: Merge "Remove pthread_detach_no_leak test."
* commit 'f9eeea6d6531b0dea837027c7e1f47bec837f311':
  Remove pthread_detach_no_leak test.
2015-05-08 01:59:26 +00:00
Yabin Cui
f9eeea6d65 Merge "Remove pthread_detach_no_leak test." 2015-05-08 01:36:30 +00:00
Yabin Cui
2957cc5f10 Remove pthread_detach_no_leak test.
This test has lost its purpose as we are using mmap/munmap for pthread_internal_t. And it is a flaky test.

Bug: 20860440
Change-Id: I7cbb6bc3fd8a2ca430415beab5ee27a856ce4ea7
2015-05-07 16:53:25 -07:00
Dan Albert
ded34ce94f Apply same URL workaround to clean build.
Change-Id: I63e63f6ffb879f49e36ee2d09821fc6fc47952c8
2015-05-07 16:33:42 -07:00
Dan Albert
7c2c01d681 Revert "Fix volantis boot."
Bug: http://b/20065774
This reverts commit 76e1cbca75e9fdaf7a7943f2c58e65433b283f4a.
2015-05-07 15:12:24 -07:00
Dan Albert
6f0d7005f9 Revert "Fix clang build."
Bug: http://b/20065774
This reverts commit 0975a5d9d29019e764dc0ab2ddc75759bebffb9b.
2015-05-07 15:12:16 -07:00
Dan Albert
f920f821e2 Revert "Try again to fix clang build."
Bug: http://b/20065774
This reverts commit dffd3c58389103d6ee712fac6544217c00c1f315.

Change-Id: I5dd095ff4ab133baa2afcbd4c79fbee55d05c459
2015-05-07 15:11:48 -07:00
Dmitriy Ivanov
d48c8ace18 am dc10b077: Merge "Properly align init/fini_arrays for crtend.o"
* commit 'dc10b077ea52baaa1b7be42eb5d2ba05a8a8c860':
  Properly align init/fini_arrays for crtend.o
2015-05-07 20:21:53 +00:00
Dmitriy Ivanov
174bbdbf9e am af7e806c: Properly align init/fini_arrays for crtend.o
* commit 'af7e806cec7088d5d8e9898c13aaa1bbdc07a082':
  Properly align init/fini_arrays for crtend.o
2015-05-07 20:21:48 +00:00
Dmitriy Ivanov
dc10b077ea Merge "Properly align init/fini_arrays for crtend.o" 2015-05-07 19:55:25 +00:00
Dmitriy Ivanov
cf8231e7a8 am b3c01d05: Use realpath for log and error messages
* commit 'b3c01d05387e8576edcb0df1ad80a326d1d3a418':
  Use realpath for log and error messages
2015-05-07 19:11:31 +00:00
Dmitriy Ivanov
e543c7612e Properly align init/fini_arrays for crtend.o
Also remove them from crtend_so.o

Bug: http://b/20532404
Change-Id: I56a0f80c4b3a83cf11d28bbf17791ff4ce10c5d2
2015-05-07 11:57:53 -07:00
Dmitriy Ivanov
3ab5146c03 am 9c189418: Merge "Use realpath for log and error messages"
* commit '9c1894186cb33391732a6c33bd08e14d7b43cc89':
  Use realpath for log and error messages
2015-05-07 18:27:19 +00:00
Dmitriy Ivanov
9c1894186c Merge "Use realpath for log and error messages" 2015-05-07 17:55:39 +00:00
Dmitriy Ivanov
3edb9182ff Use realpath for log and error messages
Bug: http://b/20885931
Change-Id: Ida8ab7982ca75fa73da13c4cb10a6b2e53bc2c8e
2015-05-07 10:48:00 -07:00
Dmitriy Ivanov
15eabcc295 am fff06e62: Merge "Move pthread_atfork_dlclose test out of static lib"
* commit 'fff06e624db96f1d876627fa0a122cdf65f41698':
  Move pthread_atfork_dlclose test out of static lib
2015-05-07 16:15:44 +00:00
Dmitriy Ivanov
597fd464de am c95a9e9d: Merge "VersionTracker: Ignore libraries without soname"
* commit 'c95a9e9dad126108a0106844f4d572d4cd4ae103':
  VersionTracker: Ignore libraries without soname
2015-05-07 09:00:10 +00:00
Dmitriy Ivanov
4c95c08bca am a60fd09e: Move pthread_atfork_dlclose test out of static lib
* commit 'a60fd09e2692e17c8bfa210d3cb64b490aea4c9d':
  Move pthread_atfork_dlclose test out of static lib
2015-05-07 05:27:54 +00:00
Dmitriy Ivanov
fff06e624d Merge "Move pthread_atfork_dlclose test out of static lib" 2015-05-06 23:47:22 +00:00
Dmitriy Ivanov
ecc4086032 am f3392791: Merge "Fix protected symbol lookups for mips"
* commit 'f3392791bc0f8f3638a04e15cea893c7c102f3c3':
  Fix protected symbol lookups for mips
2015-05-06 22:55:50 +00:00
Dmitriy Ivanov
a8c31a3f5f am 2c3d8d8b: Merge "Do not adjust PT_GNU_STACK segment"
* commit '2c3d8d8b2c77a2439e324f8ef2369589024f33ed':
  Do not adjust PT_GNU_STACK segment
2015-05-06 22:43:57 +00:00
Dmitriy Ivanov
5624a6a1e5 Move pthread_atfork_dlclose test out of static lib
Bug: http://b/20858755
Change-Id: I0d84e8b43dc33902d75af18db6b7c8e0b619d718
2015-05-06 14:15:28 -07:00
Dmitriy Ivanov
84b973ad42 am 8264afb3: VersionTracker: Ignore libraries without soname
* commit '8264afb37778bea2a3c6e9aa7144f4877401c3f8':
  VersionTracker: Ignore libraries without soname
2015-05-06 19:29:32 +00:00
Dmitriy Ivanov
c95a9e9dad Merge "VersionTracker: Ignore libraries without soname" 2015-05-06 19:06:20 +00:00
Dmitriy Ivanov
406d99665c VersionTracker: Ignore libraries without soname
Bug: http://b/20872443
Change-Id: I7bd076885c1feae39af6ea64c9442bcc5ae5a1dc
(cherry picked from commit 8264afb37778bea2a3c6e9aa7144f4877401c3f8)
2015-05-06 12:04:57 -07:00
Dmitriy Ivanov
e08840c591 am 456afe24: Fix protected symbol lookups for mips
* commit '456afe24b6460f75b3abc296f8f5885f4d8d907a':
  Fix protected symbol lookups for mips
2015-05-05 23:02:59 +00:00
Dmitriy Ivanov
f3392791bc Merge "Fix protected symbol lookups for mips" 2015-05-05 22:39:20 +00:00
Dmitriy Ivanov
dbe26fdcc7 Fix protected symbol lookups for mips
Bug: http://b/20694161
Change-Id: I5cc58034f9776e1db9cddc34abe48ef85f6048f4
2015-05-04 19:30:49 -07:00
Dmitriy Ivanov
2531bd8576 am 064a9800: Do not adjust PT_GNU_STACK segment
* commit '064a9800f372b8efd6d7b08150ab5204e5304c84':
  Do not adjust PT_GNU_STACK segment
2015-05-05 01:24:25 +00:00
Dmitriy Ivanov
2c3d8d8b2c Merge "Do not adjust PT_GNU_STACK segment" 2015-05-04 19:35:51 +00:00
Dmitriy Ivanov
4637f3d66d Do not adjust PT_GNU_STACK segment
Bug: http://b/20687795
Bug: http://b/18051137
Change-Id: Ie8af3892cfbebcc0249e7981284c4ad97ff40317
(cherry picked from commit 064a9800f372b8efd6d7b08150ab5204e5304c84)
2015-05-04 12:34:42 -07:00
Christopher Ferris
ede9292ca2 am 64a86988: Modify test to avoid race condition. automerge: 3da136a
* commit '64a869880921b7e12d092b3fe7adc68fc74f98c6':
2015-05-04 17:08:06 +00:00
Christopher Ferris
64a8698809 Modify test to avoid race condition.
automerge: 3da136a

* commit '3da136aa47e2d1608b98abb2580f024b36f92831':
  Modify test to avoid race condition.
2015-05-04 16:45:13 +00:00
Dmitriy Ivanov
088d6d6756 am dc145b51: Lookup version info when relocating mips got
* commit 'dc145b510640202a60b0dfaef9d56cd8fc1c05a9':
  Lookup version info when relocating mips got
2015-05-01 23:08:49 +00:00
Dmitriy Ivanov
f5724b6001 am f92a417d: Refactoring: move VersionTracker to link_image
* commit 'f92a417d07d70730fda15d7d98d36968a6a7362e':
  Refactoring: move VersionTracker to link_image
2015-05-01 23:08:48 +00:00
Dmitriy Ivanov
2f77ec14e9 am 7fbd6355: Merge changes I28bd3bc4,I6860013d
* commit '7fbd6355ae809089ae9a62d0c738aea200ac20fe':
  Lookup version info when relocating mips got
  Refactoring: move VersionTracker to link_image
2015-05-01 23:05:20 +00:00
Dmitriy Ivanov
7fbd6355ae Merge changes I28bd3bc4,I6860013d
* changes:
  Lookup version info when relocating mips got
  Refactoring: move VersionTracker to link_image
2015-05-01 22:43:36 +00:00
Neil Fuller
49196ee324 am f6fdb79b: Merge "Update to tzdata 2015d" into mnc-dev
* commit 'f6fdb79b4fe2ff6362e82a0380304ac61654396f':
  Update to tzdata 2015d
2015-05-01 09:19:32 +00:00
Dmitriy Ivanov
f39cb63603 Lookup version info when relocating mips got
Bug: http://b/20693971
Bug: http://b/20139821
Change-Id: I28bd3bc44dafe048761b2c598facfe20320128c4
2015-04-30 20:17:03 -07:00
Dmitriy Ivanov
7e4bbbae4a Refactoring: move VersionTracker to link_image
Use one instance of VersionTracker per link (instead of 2).

Change-Id: I6860013df65f5969975c82ebdae8bd90a82e0a82
2015-04-30 19:49:19 -07:00
Dmitriy Ivanov
60b30b4090 Merge commit '114bd835' into manualmerge 2015-04-30 18:25:41 -07:00
Dmitriy Ivanov
4026b5d369 am 788ea593: Merge "Refactoring: extract lookup_version_info(..)"
* commit '788ea593ec27f4bb8600c88d5717a914fe79ed8b':
  Refactoring: extract lookup_version_info(..)
2015-05-01 01:03:05 +00:00
Dmitriy Ivanov
788ea593ec Merge "Refactoring: extract lookup_version_info(..)" 2015-05-01 00:40:59 +00:00
Dmitriy Ivanov
31b408d2c2 Refactoring: extract lookup_version_info(..)
Change-Id: I47f9c21a1738dc520fd83281c8227dc3a7e79650
2015-04-30 16:12:32 -07:00
Alan Viverette
7ddbffe6fd Merge branch 'mnc-dev-plus-aosp' of https://googleplex-android.googlesource.com/_direct/platform/bionic into mnc-dev-plus-aosp 2015-04-30 21:21:02 +00:00
Mark Salyzyn
7960fb5600 am 62075bcc: bionic: fortify comments in _system_properties.h
* commit '62075bcc91d60f5269ed6f5b5303662b556a86c4':
  bionic: fortify comments in _system_properties.h
2015-04-30 21:20:41 +00:00
Mark Salyzyn
3d6bdcf285 am 033a68f1: Merge "bionic: fortify comments in _system_properties.h"
* commit '033a68f1acd059dc3c5f656ce16999863d077d8a':
  bionic: fortify comments in _system_properties.h
2015-04-30 21:20:40 +00:00
Mark Salyzyn
033a68f1ac Merge "bionic: fortify comments in _system_properties.h" 2015-04-30 20:57:49 +00:00
Dan Albert
b04c68164d am 6a4c9d9b: Merge "Define char16_t and char32_t to make gcc 5.1 happy"
* commit '6a4c9d9bf9e3d2679394850ab49a42f368e12c2d':
  Define char16_t and char32_t to make gcc 5.1 happy
2015-04-30 19:55:45 +00:00
Dan Albert
6a4c9d9bf9 Merge "Define char16_t and char32_t to make gcc 5.1 happy" 2015-04-30 19:29:47 +00:00
Dmitriy Ivanov
e99dce4960 am 126b5efa: Adjust DT_MIPS_RLD_MAP2 value
* commit '126b5efa9d2fa0956a12a66305d7a4dac7feb4f9':
  Adjust DT_MIPS_RLD_MAP2 value
2015-04-30 15:19:51 +00:00
Dmitriy Ivanov
775ef1b68b am df877d7b: Merge "Adjust DT_MIPS_RLD_MAP2 value"
* commit 'df877d7b289543e5a969566e0dcbb6102b08f002':
  Adjust DT_MIPS_RLD_MAP2 value
2015-04-30 05:28:42 +00:00
Dmitriy Ivanov
df877d7b28 Merge "Adjust DT_MIPS_RLD_MAP2 value" 2015-04-30 05:07:40 +00:00
Dmitriy Ivanov
18c935ceab Adjust DT_MIPS_RLD_MAP2 value
DT_MIPS_RLD_MAP2 stores the difference between dynamic
  entry address and the address of the _r_debug (used by GDB)
  since the dynamic section and target address are on the
  different sides of the hole it needs to be adjusted accordingly

Bug: http://b/20658994
Bug: http://b/18051137
Change-Id: I4c5e379e8a4c68f029467df6dc660f81a7013a09
2015-04-29 19:53:31 -07:00
Dmitriy Ivanov
17d2d7bec5 am f29640c2: Merge "linker: initialize system properties"
* commit 'f29640c2d8920c98f4cfd461d80c297a1cafa86a':
  linker: initialize system properties
2015-04-30 00:10:16 +00:00
Dmitriy Ivanov
bbd88ad57b am 0b9e1c60: linker: initialize system properties
* commit '0b9e1c6051a6c75bf9040fd1da6109988900d0ac':
  linker: initialize system properties
2015-04-30 00:04:23 +00:00
Dmitriy Ivanov
f29640c2d8 Merge "linker: initialize system properties" 2015-04-29 23:44:57 +00:00
Dmitriy Ivanov
f38aedecb1 am e97d519a: Fix mips relocation to use load_bias as intended
* commit 'e97d519a6b5d5f3272a0c851dff7bcf1f8ac0157':
  Fix mips relocation to use load_bias as intended
2015-04-29 22:29:01 +00:00
Dmitriy Ivanov
1f688c2c2a am c6b9b254: Merge "Fix mips relocation to use load_bias as intended"
* commit 'c6b9b254dc042c9c2b8be72430a9f59803eb0794':
  Fix mips relocation to use load_bias as intended
2015-04-29 22:22:13 +00:00
Dmitriy Ivanov
c6b9b254dc Merge "Fix mips relocation to use load_bias as intended" 2015-04-29 21:58:57 +00:00
Dmitriy Ivanov
0373d4f473 Fix mips relocation to use load_bias as intended
Bug: http://b/20658994
Change-Id: I5a15605fe34db359e26d563e13841ae993083c4a
2015-04-29 14:41:06 -07:00
Mark Salyzyn
c3f4c964a3 bionic: fortify comments in _system_properties.h
Change-Id: I2ef8fb7ae5ae03d5d2a50b5a417d585710099760
2015-04-29 13:57:42 -07:00
Neil Fuller
944e97c13d am fa6f6496: Merge "Update to tzdata 2015d"
* commit 'fa6f6496078426fe332a5ae9bba009c98dfabc94':
  Update to tzdata 2015d
2015-04-29 11:04:09 +00:00
Neil Fuller
fa6f649607 Merge "Update to tzdata 2015d" 2015-04-29 10:42:16 +00:00
Dmitriy Ivanov
b452858e47 am 53ba6636: Fix LD_PRELOAD for dlopen()
* commit '53ba6636178b7fb5d837b52aa6b2983263e3df4e':
  Fix LD_PRELOAD for dlopen()
2015-04-29 03:54:24 +00:00
Dmitriy Ivanov
5757a78b4b am e1a61f5e: Merge "Fix LD_PRELOAD for dlopen()"
* commit 'e1a61f5e931461288c931ce0b5a4e3bfef2e104e':
  Fix LD_PRELOAD for dlopen()
2015-04-29 03:43:23 +00:00
Jeff Brown
436f7a6502 am cb73d0e0: Merge "Add float support to binary event log." into mnc-dev
* commit 'cb73d0e0daff3804092efd49abf3aab9a65c05ff':
  Add float support to binary event log.
2015-04-29 02:11:21 +00:00
Mark Salyzyn
2761571dc4 am 123927df: bionic: add __system_property_area_serial()
* commit '123927dffc28018a1feb1d42c625b601cb948f34':
  bionic: add __system_property_area_serial()
2015-04-29 02:11:19 +00:00
Dmitriy Ivanov
143d6dd6ce am 452742d2: Do not pack relocations for libc.so
* commit '452742d2bf4247106055696c11bc4e59ca630f11':
  Do not pack relocations for libc.so
2015-04-29 02:11:16 +00:00
Dmitriy Ivanov
1e4e857d25 am 62a0a63e: linker: use libc\'s environ variable to store envp
* commit '62a0a63e072c97ba7650bb564d87ac6daf767558':
  linker: use libc's environ variable to store envp
2015-04-29 02:11:14 +00:00
Jeff Brown
317b3bf24a am 0bf65037: Merge "Add float support to binary event log."
* commit '0bf650373e963cb772466092fbc5fd5a25b144d0':
  Add float support to binary event log.
2015-04-29 02:09:52 +00:00
Dmitriy Ivanov
e1a61f5e93 Merge "Fix LD_PRELOAD for dlopen()" 2015-04-29 01:59:53 +00:00
Jeff Brown
0bf650373e Merge "Add float support to binary event log." 2015-04-29 01:42:49 +00:00
Jeff Brown
11331f60dd Add float support to binary event log.
Bug: 20664753
Change-Id: I6e43c07daa727c19d87f5192bb719af63dd93654
2015-04-28 18:20:22 -07:00
Dmitriy Ivanov
f8093a9485 Fix LD_PRELOAD for dlopen()
We did not set DF_1_GLOBAL flag for LD_PRELOADed
 libraries which led to the situation when ld_preloads
 where ignored during on dlopen()

Change-Id: I696b3b2506a8ed4c0984ad2c803210a7a4f8e686
2015-04-28 18:09:53 -07:00
Dmitriy Ivanov
b4e5067cab linker: initialize system properties
Bug: http://b/20567629
Bug: https://code.google.com/p/chromium/issues/detail?id=478886
Change-Id: I8d2d89b749015e7fcd6e7ea646911f2e617dd1ba
2015-04-28 15:52:52 -07:00
Mark Salyzyn
46ba0ac2a0 am b904afa1: Merge "bionic: add __system_property_area_serial()"
* commit 'b904afa16eb02266f4e72c241cc745340698f5fc':
  bionic: add __system_property_area_serial()
2015-04-28 22:30:30 +00:00
Dmitriy Ivanov
0045456336 am 9f0d99d2: Merge "Do not pack relocations for libc.so"
* commit '9f0d99d2983c7692cec8e866514335488a930058':
  Do not pack relocations for libc.so
2015-04-28 22:30:29 +00:00
Mark Salyzyn
b904afa16e Merge "bionic: add __system_property_area_serial()" 2015-04-28 22:11:52 +00:00
Dmitriy Ivanov
9f0d99d298 Merge "Do not pack relocations for libc.so" 2015-04-28 22:06:43 +00:00
Dmitriy Ivanov
62d6533c1a Do not pack relocations for libc.so
Bug: http://b/20645321
Bug: http://b/20655855
(cherry picked from commit 452742d2bf4247106055696c11bc4e59ca630f11)

Change-Id: Ic9125cc1bc4c9ba9eb20d030de72e3ce1fb86fa6
2015-04-28 15:05:20 -07:00
Dmitriy Ivanov
6253e40251 am bed7a7e5: Merge "linker: use libc\'s environ variable to store envp"
* commit 'bed7a7e5eb4b22dbddd2358f759ad925149b6ed3':
  linker: use libc's environ variable to store envp
2015-04-28 22:02:30 +00:00
Dmitriy Ivanov
bed7a7e5eb Merge "linker: use libc's environ variable to store envp" 2015-04-28 21:35:59 +00:00
Christopher Ferris
d3f0a1f3de am 6fa65e7c: Merge "cortex-a9: Fix reference to __memcpy_base_aligned."
* commit '6fa65e7cd54aeffbb2eb2116e30d2d34a5b655a2':
  cortex-a9: Fix reference to __memcpy_base_aligned.
2015-04-28 21:33:40 +00:00
Dmitriy Ivanov
a85bcc2e99 linker: use libc's environ variable to store envp
This is to make getenv() work correctly.

Bug: http://b/20567629
Change-Id: I148627e1efea1649fb0822c95876811652fb4082
2015-04-28 14:21:36 -07:00
Christopher Ferris
6fa65e7cd5 Merge "cortex-a9: Fix reference to __memcpy_base_aligned." 2015-04-28 20:28:42 +00:00
Kyle Repinski
e0905c94d3 cortex-a9: Fix reference to __memcpy_base_aligned.
With a different memcpy, __memcpy_base_aligned ceased to exist.
Instead, point to the name defined by whatever includes memcpy_base.S

Change-Id: I242cf49cbada35337ba155d7f170e86a905ff55f
2015-04-28 14:29:15 -05:00
Neil Fuller
520cbf51b1 Update to tzdata 2015d
Changes affecting future time stamps

    Egypt will not observe DST in 2015 and will consider canceling it
    permanently.  For now, assume no DST indefinitely.
    (Thanks to Ahmed Nazmy and Tim Parenti.)

  Changes affecting past time stamps

    America/Whitehorse switched from UTC-9 to UTC-8 on 1967-05-28, not
    1966-07-01.  Also, Yukon's time zone history is documented better.
    (Thanks to Brian Inglis and Dennis Ferguson.)

  Change affecting past and future time zone abbreviations

    The abbreviations for Hawaii-Aleutian standard and daylight times
    have been changed from HAST/HADT to HST/HDT, as per US Government
    Printing Office style.  This affects only America/Adak since 1983,
    as America/Honolulu was already using the new style.

Bug: 20551453
Change-Id: I02364f15ca4ae20ed1a3b327f8517214bee938e5
2015-04-28 17:11:03 +01:00
Neil Fuller
c9865b656f am 17b602c9: Update to tzdata 2015c
* commit '17b602c903c3199fad6353c43b0e6086c54bcce7':
  Update to tzdata 2015c
2015-04-28 14:55:03 +00:00
Dmitriy Ivanov
652d65a56d am 7936fa65: Reduce p_align for program header to page size.
* commit '7936fa6536934b67b5f9bd836c205f962bd0cea3':
  Reduce p_align for program header to page size.
2015-04-28 14:54:22 +00:00
Dmitriy Ivanov
d583433eea am 42d7468f: Merge "Reduce p_align for program header to page size."
* commit '42d7468f99a49bd598fca9c3cebba33b9bdd0e57':
  Reduce p_align for program header to page size.
2015-04-28 04:10:46 +00:00
Dmitriy Ivanov
42d7468f99 Merge "Reduce p_align for program header to page size." 2015-04-28 03:38:27 +00:00
Dmitriy Ivanov
b293969c6d Reduce p_align for program header to page size.
Having p_align > page_size leads to the situation when striping
 packed executables results in unnecessary p_vaddr adjustments.
 And it also may result (with probability 1 - 1/sizeof(uintptr_t)) in
 misaligned segments following .dynstr

Bug: http://b/20629834
Bug: http://b/18051137
Change-Id: I1c5da4911e4409d63cb09f6b6b0a16ef54f6501b
2015-04-27 20:37:17 -07:00
Dmitriy Ivanov
f27336f276 am 032907d8: Merge "Remove outdated warning"
* commit '032907d8c7ad7a15798c123114b9c8e7601bb3ae':
  Remove outdated warning
2015-04-27 19:01:06 +00:00
Dmitriy Ivanov
032907d8c7 Merge "Remove outdated warning" 2015-04-27 18:28:31 +00:00
Dmitriy Ivanov
2ea504fed1 Remove outdated warning
It is ok to use malloc in linker.

Bug: http://b/20567629
Change-Id: I54183dbe8ebcd223a44e710e511c339688a65dba
2015-04-27 11:24:36 -07:00
Chih-Hung Hsieh
8f893fdb05 am 59bce688: Merge "Fix opcode to compile with both gcc and llvm."
* commit '59bce688c7edfa2479f63a76268cc30f98d1044c':
  Fix opcode to compile with both gcc and llvm.
2015-04-27 17:50:18 +00:00
Chih-Hung Hsieh
59bce688c7 Merge "Fix opcode to compile with both gcc and llvm." 2015-04-27 17:17:45 +00:00
Mark Salyzyn
bfd65279a5 bionic: add __system_property_area_serial()
Adds a new _internal_ function. Provide a global serial number to
support more efficient private caching algorithms. This allows
to skip re-running the __system_property_find() call on misses until
there is a global change in the properties. This call is a read
barrier, the property data to be read following this call will be
read sequentially and up to date.

Bug: 19544788
Change-Id: I58e6a92baa0f3e8e7b9ec79b10af6d56407dab48
2015-04-27 07:44:03 -07:00
Nick Kralevich
85ae807689 am 9e22d0ff: am bb4961cd: am 1d76f1cc: Merge "add a fortified implementation of realpath"
* commit '9e22d0ff3c12e51c20a72e148112bcbb207f816f':
2015-04-27 12:48:51 +00:00
Neil Fuller
45a92efcf4 am 682a240c: Merge "Update to tzdata 2015c"
* commit '682a240c5d6a479ed3b8187ea99044627bf2394c':
  Update to tzdata 2015c
2015-04-27 09:59:18 +00:00
Neil Fuller
682a240c5d Merge "Update to tzdata 2015c" 2015-04-27 08:19:16 +00:00
Nick Kralevich
c2e2a9ddec am 1d76f1cc: Merge "add a fortified implementation of realpath"
* commit '1d76f1cc8be1f40141adac6147cd51061f1ee0b4':
  add a fortified implementation of realpath
2015-04-26 22:14:54 +00:00
Bernhard Rosenkränzer
6f88821e5d Define char16_t and char32_t to make gcc 5.1 happy
gcc 5.1 doesn't define char16_t and char32_t (unless in C++ mode),
causing compile failures.

Change-Id: I08dcd13cdf8cd59a4a2f191864bedf4c0d1bb313
Signed-off-by: Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>
2015-04-24 16:21:38 +02:00
Neil Fuller
d2177404e2 Update to tzdata 2015c
Changes affecting future time stamps

    Egypt's spring-forward transition is at 24:00 on April's last Thursday,
    not 00:00 on April's last Friday.  2015's transition will therefore be on
    Thursday, April 30 at 24:00, not Friday, April 24 at 00:00.  Similar fixes
    apply to 2026, 2037, 2043, etc.  (Thanks to Steffen Thorsen.)

  Changes affecting past time stamps

    The following changes affect some pre-1991 Chile-related time stamps
    in America/Santiago, Antarctica/Palmer, and Pacific/Easter.

      The 1910 transition was January 10, not January 1.

      The 1918 transition was September 10, not September 1.

      The UTC-4 time observed from 1932 to 1942 is now considered to be
      standard time, not year-round DST.

      Santiago observed DST (UTC-3) from 1946-07-15 through 1946-08-31,
      then reverted to standard time, then switched its time zone to
      UTC-5 on 1947-04-01.

      Assume transitions before 1968 were at 00:00, since we have no data
      saying otherwise.

      The spring 1988 transition was 1988-10-09, not 1988-10-02.
      The fall 1990 transition was 1990-03-11, not 1990-03-18.

      Assume no UTC offset change for Pacific/Easter on 1890-01-01,
      and omit all transitions on Pacific/Easter from 1942 through 1946
      since we have no data suggesting that they existed.

    One more zone has been turned into a link, as it differed
    from an existing zone only for older time stamps.  As usual,
    this change affects UTC offsets in pre-1970 time stamps only.
    The zone's old contents have been moved to the 'backzone' file.
    The affected zone is America/Montreal.

Bug: 20287125
Change-Id: I8512c4e9ab09725395b256aba59ca34a23d1c995
2015-04-24 13:56:11 +01:00
Chih-Hung Hsieh
0a93df369c Fix opcode to compile with both gcc and llvm.
BUG: 17302991

Change-Id: I31febd9ad24312388068803ce247b295bd73b607
2015-04-23 21:40:31 +00:00
414 changed files with 32950 additions and 7780 deletions

15
.clang-format Normal file
View File

@ -0,0 +1,15 @@
BasedOnStyle: Google
AllowShortBlocksOnASingleLine: false
AllowShortFunctionsOnASingleLine: false
ColumnLimit: 100
CommentPragmas: NOLINT:.*
DerivePointerAlignment: false
IndentWidth: 2
ContinuationIndentWidth: 2
PointerAlignment: Left
TabWidth: 2
UseTab: Never
PenaltyExcessCharacter: 32
Cpp11BracedListStyle: false

1
Android.bp Normal file
View File

@ -0,0 +1 @@
subdirs = ["*"]

View File

@ -169,9 +169,10 @@ As mentioned above, this is currently a two-step process:
Updating tzdata 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 Verifying changes
@ -194,14 +195,15 @@ The tests are all built from the tests/ directory.
### Device tests ### Device tests
$ mma $ mma
$ adb remount
$ adb sync $ adb sync
$ adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests32 $ adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests32
$ adb shell \ $ adb shell \
/data/nativetest/bionic-unit-tests-static/bionic-unit-tests-static32 /data/nativetest/bionic-unit-tests-static/bionic-unit-tests-static32
# Only for 64-bit targets # Only for 64-bit targets
$ adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests64 $ adb shell /data/nativetest64/bionic-unit-tests/bionic-unit-tests64
$ adb shell \ $ adb shell \
/data/nativetest/bionic-unit-tests-static/bionic-unit-tests-static64 /data/nativetest64/bionic-unit-tests-static/bionic-unit-tests-static64
### Host tests ### Host tests
@ -256,18 +258,33 @@ First, build and run the host tests as usual (see above).
The coverage report is now available at `covreport/index.html`. The coverage report is now available at `covreport/index.html`.
LP32 ABI bugs Attaching GDB to the tests
------------- --------------------------
Bionic's test runner will run each test in its own process by default to prevent
tests failures from impacting other tests. This also has the added benefit of
running them in parallel, so they are much faster.
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`.
32-bit ABI bugs
---------------
This probably belongs in the NDK documentation rather than here, but these 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. * `off_t` is 32-bit. There is `off64_t`, and in newer releases there is
Many of the `off64_t` functions are missing in older releases, and almost-complete support for `_FILE_OFFSET_BITS`. Unfortunately our stdio
stdio uses 32-bit offsets, so there's no way to fully implement implementation uses 32-bit offsets and -- worse -- function pointers to
`_FILE_OFFSET_BITS`. 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 * `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

@ -29,7 +29,6 @@ benchmark_cflags := \
-Wunused \ -Wunused \
benchmark_cppflags := \ benchmark_cppflags := \
-std=gnu++11 \
benchmarklib_src_files := \ benchmarklib_src_files := \
Benchmark.cpp \ Benchmark.cpp \

View File

@ -24,7 +24,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include <base/stringprintf.h> #include <android-base/stringprintf.h>
#include <benchmark/Benchmark.h> #include <benchmark/Benchmark.h>

View File

@ -65,6 +65,50 @@ void BM_math_logb::Run(int iters) {
StopBenchmarkTiming(); StopBenchmarkTiming();
} }
BENCHMARK_WITH_ARG(BM_math_isfinite_macro, double)->AT_COMMON_VALS;
void BM_math_isfinite_macro::Run(int iters, double value) {
StartBenchmarkTiming();
d = 0.0;
v = value;
for (int i = 0; i < iters; ++i) {
d += isfinite(v);
}
StopBenchmarkTiming();
}
#if defined(__BIONIC__)
#define test_isfinite __isfinite
#else
#define test_isfinite __finite
#endif
BENCHMARK_WITH_ARG(BM_math_isfinite, double)->AT_COMMON_VALS;
void BM_math_isfinite::Run(int iters, double value) {
StartBenchmarkTiming();
d = 0.0;
v = value;
for (int i = 0; i < iters; ++i) {
d += test_isfinite(v);
}
StopBenchmarkTiming();
}
BENCHMARK_WITH_ARG(BM_math_isinf_macro, double)->AT_COMMON_VALS;
void BM_math_isinf_macro::Run(int iters, double value) {
StartBenchmarkTiming();
d = 0.0;
v = value;
for (int i = 0; i < iters; ++i) {
d += isinf(v);
}
StopBenchmarkTiming();
}
BENCHMARK_WITH_ARG(BM_math_isinf, double)->AT_COMMON_VALS; BENCHMARK_WITH_ARG(BM_math_isinf, double)->AT_COMMON_VALS;
void BM_math_isinf::Run(int iters, double value) { void BM_math_isinf::Run(int iters, double value) {
StartBenchmarkTiming(); StartBenchmarkTiming();
@ -78,6 +122,60 @@ void BM_math_isinf::Run(int iters, double value) {
StopBenchmarkTiming(); StopBenchmarkTiming();
} }
BENCHMARK_WITH_ARG(BM_math_isnan_macro, double)->AT_COMMON_VALS;
void BM_math_isnan_macro::Run(int iters, double value) {
StartBenchmarkTiming();
d = 0.0;
v = value;
for (int i = 0; i < iters; ++i) {
d += isnan(v);
}
StopBenchmarkTiming();
}
BENCHMARK_WITH_ARG(BM_math_isnan, double)->AT_COMMON_VALS;
void BM_math_isnan::Run(int iters, double value) {
StartBenchmarkTiming();
d = 0.0;
v = value;
for (int i = 0; i < iters; ++i) {
d += (isnan)(v);
}
StopBenchmarkTiming();
}
BENCHMARK_WITH_ARG(BM_math_isnormal_macro, double)->AT_COMMON_VALS;
void BM_math_isnormal_macro::Run(int iters, double value) {
StartBenchmarkTiming();
d = 0.0;
v = value;
for (int i = 0; i < iters; ++i) {
d += isnormal(v);
}
StopBenchmarkTiming();
}
#if defined(__BIONIC__)
BENCHMARK_WITH_ARG(BM_math_isnormal, double)->AT_COMMON_VALS;
void BM_math_isnormal::Run(int iters, double value) {
StartBenchmarkTiming();
d = 0.0;
v = value;
for (int i = 0; i < iters; ++i) {
d += (__isnormal)(v);
}
StopBenchmarkTiming();
}
#endif
BENCHMARK_NO_ARG(BM_math_sin_fast); BENCHMARK_NO_ARG(BM_math_sin_fast);
void BM_math_sin_fast::Run(int iters) { void BM_math_sin_fast::Run(int iters) {
StartBenchmarkTiming(); StartBenchmarkTiming();
@ -134,3 +232,55 @@ void BM_math_fpclassify::Run(int iters, double value) {
StopBenchmarkTiming(); StopBenchmarkTiming();
} }
BENCHMARK_WITH_ARG(BM_math_signbit_macro, double)->AT_COMMON_VALS;
void BM_math_signbit_macro::Run(int iters, double value) {
StartBenchmarkTiming();
d = 0.0;
v = value;
for (int i = 0; i < iters; ++i) {
d += signbit(v);
}
StopBenchmarkTiming();
}
BENCHMARK_WITH_ARG(BM_math_signbit, double)->AT_COMMON_VALS;
void BM_math_signbit::Run(int iters, double value) {
StartBenchmarkTiming();
d = 0.0;
v = value;
for (int i = 0; i < iters; ++i) {
d += (__signbit)(v);
}
StopBenchmarkTiming();
}
BENCHMARK_WITH_ARG(BM_math_fabs_macro, double)->AT_COMMON_VALS;
void BM_math_fabs_macro::Run(int iters, double value) {
StartBenchmarkTiming();
d = 0.0;
v = value;
for (int i = 0; i < iters; ++i) {
d += fabs(v);
}
StopBenchmarkTiming();
}
BENCHMARK_WITH_ARG(BM_math_fabs, double)->AT_COMMON_VALS;
void BM_math_fabs::Run(int iters, double value) {
StartBenchmarkTiming();
d = 0.0;
v = value;
for (int i = 0; i < iters; ++i) {
d += (fabs)(v);
}
StopBenchmarkTiming();
}

View File

@ -16,6 +16,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdio_ext.h> #include <stdio_ext.h>
#include <stdlib.h>
#include <benchmark/Benchmark.h> #include <benchmark/Benchmark.h>
@ -73,7 +74,7 @@ static void FopenFgetsFclose(int iters, bool no_locking) {
for (int i = 0; i < iters; ++i) { for (int i = 0; i < iters; ++i) {
FILE* fp = fopen("/proc/version", "re"); FILE* fp = fopen("/proc/version", "re");
if (no_locking) __fsetlocking(fp, FSETLOCKING_BYCALLER); if (no_locking) __fsetlocking(fp, FSETLOCKING_BYCALLER);
fgets(buf, sizeof(buf), fp); if (fgets(buf, sizeof(buf), fp) == nullptr) abort();
fclose(fp); fclose(fp);
} }
} }

View File

@ -17,6 +17,7 @@
#include <sys/syscall.h> #include <sys/syscall.h>
#include <sys/time.h> #include <sys/time.h>
#include <time.h> #include <time.h>
#include <unistd.h>
#include <benchmark/Benchmark.h> #include <benchmark/Benchmark.h>

View File

@ -14,6 +14,8 @@
* limitations under the License. * limitations under the License.
*/ */
#include "utils.h"
#include <inttypes.h> #include <inttypes.h>
#include <stdio.h> #include <stdio.h>
#include <stdint.h> #include <stdint.h>
@ -21,7 +23,7 @@
#include <string> #include <string>
#include "utils.h" #include <android-base/stringprintf.h>
int Round(int n) { int Round(int n) {
int base = 1; int base = 1;
@ -72,10 +74,7 @@ std::string PrettyInt(long value, size_t base) {
break; break;
} }
} }
char* s = NULL; return android::base::StringPrintf("%s%" PRId64 "%s",
asprintf(&s, "%s%" PRId64 "%s", (negative_number ? "-" : ""), negative_number ? "-" : "",
count / kAmountPerUnit[i], kUnitStrings[i]); count / kAmountPerUnit[i], kUnitStrings[i]);
std::string result(s);
free(s);
return result;
} }

2160
libc/Android.bp Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
LOCAL_PATH := $(call my-dir) LOCAL_PATH := $(call my-dir)
bionic_coverage := false bionic_coverage ?= false
# Make everything depend on any changes to included makefiles. # Make everything depend on any changes to included makefiles.
libc_common_additional_dependencies := $(LOCAL_PATH)/Android.mk libc_common_additional_dependencies := $(LOCAL_PATH)/Android.mk
@ -47,7 +47,6 @@ libc_common_src_files := \
bionic/if_indextoname.c \ bionic/if_indextoname.c \
bionic/if_nametoindex.c \ bionic/if_nametoindex.c \
bionic/initgroups.c \ bionic/initgroups.c \
bionic/ioctl.c \
bionic/isatty.c \ bionic/isatty.c \
bionic/memmem.c \ bionic/memmem.c \
bionic/pututline.c \ bionic/pututline.c \
@ -59,6 +58,7 @@ libc_common_src_files := \
bionic/system_properties_compat.c \ bionic/system_properties_compat.c \
stdio/findfp.c \ stdio/findfp.c \
stdio/fread.c \ stdio/fread.c \
stdio/refill.c \
stdio/snprintf.c\ stdio/snprintf.c\
stdio/sprintf.c \ stdio/sprintf.c \
stdio/stdio.c \ stdio/stdio.c \
@ -70,12 +70,17 @@ libc_common_src_files := \
libc_common_src_files += \ libc_common_src_files += \
bionic/__FD_chk.cpp \ bionic/__FD_chk.cpp \
bionic/__fgets_chk.cpp \ bionic/__fgets_chk.cpp \
bionic/__fread_chk.cpp \
bionic/__fwrite_chk.cpp \
bionic/__getcwd_chk.cpp \
bionic/__memchr_chk.cpp \ bionic/__memchr_chk.cpp \
bionic/__memmove_chk.cpp \ bionic/__memmove_chk.cpp \
bionic/__memrchr_chk.cpp \ bionic/__memrchr_chk.cpp \
bionic/__poll_chk.cpp \ bionic/__poll_chk.cpp \
bionic/__pread64_chk.cpp \ bionic/__pread64_chk.cpp \
bionic/__pread_chk.cpp \ bionic/__pread_chk.cpp \
bionic/__pwrite64_chk.cpp \
bionic/__pwrite_chk.cpp \
bionic/__read_chk.cpp \ bionic/__read_chk.cpp \
bionic/__readlink_chk.cpp \ bionic/__readlink_chk.cpp \
bionic/__readlinkat_chk.cpp \ bionic/__readlinkat_chk.cpp \
@ -92,12 +97,14 @@ libc_common_src_files += \
bionic/__umask_chk.cpp \ bionic/__umask_chk.cpp \
bionic/__vsnprintf_chk.cpp \ bionic/__vsnprintf_chk.cpp \
bionic/__vsprintf_chk.cpp \ bionic/__vsprintf_chk.cpp \
bionic/__write_chk.cpp
libc_bionic_ndk_src_files := \ libc_bionic_ndk_src_files := \
bionic/abort.cpp \ bionic/abort.cpp \
bionic/accept.cpp \ bionic/accept.cpp \
bionic/accept4.cpp \ bionic/accept4.cpp \
bionic/access.cpp \ bionic/access.cpp \
bionic/arpa_inet.cpp \
bionic/assert.cpp \ bionic/assert.cpp \
bionic/atof.cpp \ bionic/atof.cpp \
bionic/bionic_systrace.cpp \ bionic/bionic_systrace.cpp \
@ -130,6 +137,7 @@ libc_bionic_ndk_src_files := \
bionic/fchmodat.cpp \ bionic/fchmodat.cpp \
bionic/ffs.cpp \ bionic/ffs.cpp \
bionic/fgetxattr.cpp \ bionic/fgetxattr.cpp \
bionic/flistxattr.cpp \
bionic/flockfile.cpp \ bionic/flockfile.cpp \
bionic/fpclassify.cpp \ bionic/fpclassify.cpp \
bionic/fsetxattr.cpp \ bionic/fsetxattr.cpp \
@ -141,7 +149,9 @@ libc_bionic_ndk_src_files := \
bionic/getpid.cpp \ bionic/getpid.cpp \
bionic/gettid.cpp \ bionic/gettid.cpp \
bionic/__gnu_basename.cpp \ bionic/__gnu_basename.cpp \
bionic/ifaddrs.cpp \
bionic/inotify_init.cpp \ bionic/inotify_init.cpp \
bionic/ioctl.cpp \
bionic/lchown.cpp \ bionic/lchown.cpp \
bionic/lfs64_support.cpp \ bionic/lfs64_support.cpp \
bionic/__libc_current_sigrtmax.cpp \ bionic/__libc_current_sigrtmax.cpp \
@ -161,6 +171,7 @@ libc_bionic_ndk_src_files := \
bionic/mkfifo.cpp \ bionic/mkfifo.cpp \
bionic/mknod.cpp \ bionic/mknod.cpp \
bionic/mntent.cpp \ bionic/mntent.cpp \
bionic/mremap.cpp \
bionic/NetdClientDispatch.cpp \ bionic/NetdClientDispatch.cpp \
bionic/open.cpp \ bionic/open.cpp \
bionic/pathconf.cpp \ bionic/pathconf.cpp \
@ -207,6 +218,7 @@ libc_bionic_ndk_src_files := \
bionic/socket.cpp \ bionic/socket.cpp \
bionic/stat.cpp \ bionic/stat.cpp \
bionic/statvfs.cpp \ bionic/statvfs.cpp \
bionic/strchrnul.cpp \
bionic/strerror.cpp \ bionic/strerror.cpp \
bionic/strerror_r.cpp \ bionic/strerror_r.cpp \
bionic/strsignal.cpp \ bionic/strsignal.cpp \
@ -232,9 +244,11 @@ libc_bionic_ndk_src_files := \
libc_bionic_src_files := libc_bionic_src_files :=
# The fork implementation depends on pthread data, so we can't include it in # The following implementations depend on pthread data, so we can't include
# libc_ndk.a. # them in libc_ndk.a.
libc_bionic_src_files += bionic/fork.cpp libc_bionic_src_files += \
bionic/__cxa_thread_atexit_impl.cpp \
bionic/fork.cpp \
# The data that backs getauxval is initialized in the libc init functions which # The data that backs getauxval is initialized in the libc init functions which
# are invoked by the linker. If this file is included in libc_ndk.a, only one of # are invoked by the linker. If this file is included in libc_ndk.a, only one of
@ -242,10 +256,20 @@ libc_bionic_src_files += bionic/fork.cpp
# dereferences. # dereferences.
libc_bionic_src_files += bionic/getauxval.cpp libc_bionic_src_files += bionic/getauxval.cpp
# These three require getauxval, which isn't available on older platforms. # These four require getauxval, which isn't available on older platforms.
libc_bionic_src_files += bionic/getentropy_linux.c libc_bionic_src_files += bionic/getentropy_linux.c
libc_bionic_src_files += bionic/sysconf.cpp libc_bionic_src_files += bionic/sysconf.cpp
libc_bionic_src_files += bionic/vdso.cpp libc_bionic_src_files += bionic/vdso.cpp
libc_bionic_src_files += bionic/setjmp_cookie.cpp
libc_bionic_src_files += \
bionic/__memcpy_chk.cpp \
bionic/__memset_chk.cpp \
bionic/__strcat_chk.cpp \
bionic/__strcpy_chk.cpp \
bionic/strchr.cpp \
bionic/strnlen.c \
bionic/strrchr.cpp \
libc_cxa_src_files := \ libc_cxa_src_files := \
bionic/__cxa_guard.cpp \ bionic/__cxa_guard.cpp \
@ -256,30 +280,33 @@ libc_upstream_freebsd_src_files := \
upstream-freebsd/lib/libc/gen/ldexp.c \ upstream-freebsd/lib/libc/gen/ldexp.c \
upstream-freebsd/lib/libc/gen/sleep.c \ upstream-freebsd/lib/libc/gen/sleep.c \
upstream-freebsd/lib/libc/gen/usleep.c \ upstream-freebsd/lib/libc/gen/usleep.c \
upstream-freebsd/lib/libc/stdlib/abs.c \
upstream-freebsd/lib/libc/stdlib/getopt_long.c \ upstream-freebsd/lib/libc/stdlib/getopt_long.c \
upstream-freebsd/lib/libc/stdlib/imaxabs.c \
upstream-freebsd/lib/libc/stdlib/imaxdiv.c \
upstream-freebsd/lib/libc/stdlib/labs.c \
upstream-freebsd/lib/libc/stdlib/llabs.c \
upstream-freebsd/lib/libc/stdlib/qsort.c \ upstream-freebsd/lib/libc/stdlib/qsort.c \
upstream-freebsd/lib/libc/stdlib/quick_exit.c \ upstream-freebsd/lib/libc/stdlib/quick_exit.c \
upstream-freebsd/lib/libc/stdlib/realpath.c \ upstream-freebsd/lib/libc/stdlib/realpath.c \
upstream-freebsd/lib/libc/string/wcpcpy.c \ upstream-freebsd/lib/libc/string/wcpcpy.c \
upstream-freebsd/lib/libc/string/wcpncpy.c \ upstream-freebsd/lib/libc/string/wcpncpy.c \
upstream-freebsd/lib/libc/string/wcscasecmp.c \ upstream-freebsd/lib/libc/string/wcscasecmp.c \
upstream-freebsd/lib/libc/string/wcscat.c \
upstream-freebsd/lib/libc/string/wcschr.c \
upstream-freebsd/lib/libc/string/wcscmp.c \
upstream-freebsd/lib/libc/string/wcscpy.c \
upstream-freebsd/lib/libc/string/wcscspn.c \ upstream-freebsd/lib/libc/string/wcscspn.c \
upstream-freebsd/lib/libc/string/wcsdup.c \ upstream-freebsd/lib/libc/string/wcsdup.c \
upstream-freebsd/lib/libc/string/wcslcat.c \ upstream-freebsd/lib/libc/string/wcslcat.c \
upstream-freebsd/lib/libc/string/wcslen.c \
upstream-freebsd/lib/libc/string/wcsncasecmp.c \ upstream-freebsd/lib/libc/string/wcsncasecmp.c \
upstream-freebsd/lib/libc/string/wcsncat.c \ upstream-freebsd/lib/libc/string/wcsncat.c \
upstream-freebsd/lib/libc/string/wcsncmp.c \ upstream-freebsd/lib/libc/string/wcsncmp.c \
upstream-freebsd/lib/libc/string/wcsncpy.c \ upstream-freebsd/lib/libc/string/wcsncpy.c \
upstream-freebsd/lib/libc/string/wcsnlen.c \ upstream-freebsd/lib/libc/string/wcsnlen.c \
upstream-freebsd/lib/libc/string/wcspbrk.c \ upstream-freebsd/lib/libc/string/wcspbrk.c \
upstream-freebsd/lib/libc/string/wcsrchr.c \
upstream-freebsd/lib/libc/string/wcsspn.c \ upstream-freebsd/lib/libc/string/wcsspn.c \
upstream-freebsd/lib/libc/string/wcstok.c \ upstream-freebsd/lib/libc/string/wcstok.c \
upstream-freebsd/lib/libc/string/wmemchr.c \ upstream-freebsd/lib/libc/string/wmemchr.c \
upstream-freebsd/lib/libc/string/wmemcmp.c \
upstream-freebsd/lib/libc/string/wmemmove.c \
upstream-freebsd/lib/libc/string/wmemset.c \ upstream-freebsd/lib/libc/string/wmemset.c \
libc_upstream_netbsd_src_files := \ libc_upstream_netbsd_src_files := \
@ -309,6 +336,7 @@ libc_upstream_netbsd_src_files := \
upstream-netbsd/lib/libc/stdlib/nrand48.c \ upstream-netbsd/lib/libc/stdlib/nrand48.c \
upstream-netbsd/lib/libc/stdlib/_rand48.c \ upstream-netbsd/lib/libc/stdlib/_rand48.c \
upstream-netbsd/lib/libc/stdlib/rand_r.c \ upstream-netbsd/lib/libc/stdlib/rand_r.c \
upstream-netbsd/lib/libc/stdlib/reallocarr.c \
upstream-netbsd/lib/libc/stdlib/seed48.c \ upstream-netbsd/lib/libc/stdlib/seed48.c \
upstream-netbsd/lib/libc/stdlib/srand48.c \ upstream-netbsd/lib/libc/stdlib/srand48.c \
upstream-netbsd/lib/libc/string/memccpy.c \ upstream-netbsd/lib/libc/string/memccpy.c \
@ -343,11 +371,25 @@ libc_upstream_openbsd_gdtoa_src_files_64 := \
$(libc_upstream_openbsd_gdtoa_src_files) \ $(libc_upstream_openbsd_gdtoa_src_files) \
upstream-openbsd/lib/libc/gdtoa/strtorQ.c \ upstream-openbsd/lib/libc/gdtoa/strtorQ.c \
# These two depend on getentropy_linux.cpp, which isn't in libc_ndk.a. # These two depend on getentropy_linux.c, which isn't in libc_ndk.a.
libc_upstream_openbsd_src_files := \ libc_upstream_openbsd_src_files := \
upstream-openbsd/lib/libc/crypt/arc4random.c \ upstream-openbsd/lib/libc/crypt/arc4random.c \
upstream-openbsd/lib/libc/crypt/arc4random_uniform.c \ upstream-openbsd/lib/libc/crypt/arc4random_uniform.c \
libc_upstream_openbsd_src_files += \
upstream-openbsd/lib/libc/string/memchr.c \
upstream-openbsd/lib/libc/string/memmove.c \
upstream-openbsd/lib/libc/string/memrchr.c \
upstream-openbsd/lib/libc/string/stpcpy.c \
upstream-openbsd/lib/libc/string/stpncpy.c \
upstream-openbsd/lib/libc/string/strcat.c \
upstream-openbsd/lib/libc/string/strcpy.c \
upstream-openbsd/lib/libc/string/strlcat.c \
upstream-openbsd/lib/libc/string/strlcpy.c \
upstream-openbsd/lib/libc/string/strncat.c \
upstream-openbsd/lib/libc/string/strncmp.c \
upstream-openbsd/lib/libc/string/strncpy.c \
libc_upstream_openbsd_ndk_src_files := \ libc_upstream_openbsd_ndk_src_files := \
upstream-openbsd/lib/libc/compat-43/killpg.c \ upstream-openbsd/lib/libc/compat-43/killpg.c \
upstream-openbsd/lib/libc/gen/alarm.c \ upstream-openbsd/lib/libc/gen/alarm.c \
@ -390,11 +432,9 @@ libc_upstream_openbsd_ndk_src_files := \
upstream-openbsd/lib/libc/locale/wctomb.c \ upstream-openbsd/lib/libc/locale/wctomb.c \
upstream-openbsd/lib/libc/net/htonl.c \ upstream-openbsd/lib/libc/net/htonl.c \
upstream-openbsd/lib/libc/net/htons.c \ upstream-openbsd/lib/libc/net/htons.c \
upstream-openbsd/lib/libc/net/inet_addr.c \
upstream-openbsd/lib/libc/net/inet_lnaof.c \ upstream-openbsd/lib/libc/net/inet_lnaof.c \
upstream-openbsd/lib/libc/net/inet_makeaddr.c \ upstream-openbsd/lib/libc/net/inet_makeaddr.c \
upstream-openbsd/lib/libc/net/inet_netof.c \ upstream-openbsd/lib/libc/net/inet_netof.c \
upstream-openbsd/lib/libc/net/inet_network.c \
upstream-openbsd/lib/libc/net/inet_ntoa.c \ upstream-openbsd/lib/libc/net/inet_ntoa.c \
upstream-openbsd/lib/libc/net/inet_ntop.c \ upstream-openbsd/lib/libc/net/inet_ntop.c \
upstream-openbsd/lib/libc/net/inet_pton.c \ upstream-openbsd/lib/libc/net/inet_pton.c \
@ -454,7 +494,6 @@ libc_upstream_openbsd_ndk_src_files := \
upstream-openbsd/lib/libc/stdio/puts.c \ upstream-openbsd/lib/libc/stdio/puts.c \
upstream-openbsd/lib/libc/stdio/putwc.c \ upstream-openbsd/lib/libc/stdio/putwc.c \
upstream-openbsd/lib/libc/stdio/putwchar.c \ upstream-openbsd/lib/libc/stdio/putwchar.c \
upstream-openbsd/lib/libc/stdio/refill.c \
upstream-openbsd/lib/libc/stdio/remove.c \ upstream-openbsd/lib/libc/stdio/remove.c \
upstream-openbsd/lib/libc/stdio/rewind.c \ upstream-openbsd/lib/libc/stdio/rewind.c \
upstream-openbsd/lib/libc/stdio/rget.c \ upstream-openbsd/lib/libc/stdio/rget.c \
@ -488,11 +527,16 @@ libc_upstream_openbsd_ndk_src_files := \
upstream-openbsd/lib/libc/stdio/wprintf.c \ upstream-openbsd/lib/libc/stdio/wprintf.c \
upstream-openbsd/lib/libc/stdio/wscanf.c \ upstream-openbsd/lib/libc/stdio/wscanf.c \
upstream-openbsd/lib/libc/stdio/wsetup.c \ upstream-openbsd/lib/libc/stdio/wsetup.c \
upstream-openbsd/lib/libc/stdlib/abs.c \
upstream-openbsd/lib/libc/stdlib/atoi.c \ upstream-openbsd/lib/libc/stdlib/atoi.c \
upstream-openbsd/lib/libc/stdlib/atol.c \ upstream-openbsd/lib/libc/stdlib/atol.c \
upstream-openbsd/lib/libc/stdlib/atoll.c \ upstream-openbsd/lib/libc/stdlib/atoll.c \
upstream-openbsd/lib/libc/stdlib/getenv.c \ upstream-openbsd/lib/libc/stdlib/getenv.c \
upstream-openbsd/lib/libc/stdlib/insque.c \ upstream-openbsd/lib/libc/stdlib/insque.c \
upstream-openbsd/lib/libc/stdlib/imaxabs.c \
upstream-openbsd/lib/libc/stdlib/imaxdiv.c \
upstream-openbsd/lib/libc/stdlib/labs.c \
upstream-openbsd/lib/libc/stdlib/llabs.c \
upstream-openbsd/lib/libc/stdlib/lsearch.c \ upstream-openbsd/lib/libc/stdlib/lsearch.c \
upstream-openbsd/lib/libc/stdlib/reallocarray.c \ upstream-openbsd/lib/libc/stdlib/reallocarray.c \
upstream-openbsd/lib/libc/stdlib/remque.c \ upstream-openbsd/lib/libc/stdlib/remque.c \
@ -523,6 +567,7 @@ libc_upstream_openbsd_ndk_src_files := \
libc_pthread_src_files := \ libc_pthread_src_files := \
bionic/pthread_atfork.cpp \ bionic/pthread_atfork.cpp \
bionic/pthread_attr.cpp \ bionic/pthread_attr.cpp \
bionic/pthread_barrier.cpp \
bionic/pthread_cond.cpp \ bionic/pthread_cond.cpp \
bionic/pthread_create.cpp \ bionic/pthread_create.cpp \
bionic/pthread_detach.cpp \ bionic/pthread_detach.cpp \
@ -542,9 +587,7 @@ libc_pthread_src_files := \
bionic/pthread_setname_np.cpp \ bionic/pthread_setname_np.cpp \
bionic/pthread_setschedparam.cpp \ bionic/pthread_setschedparam.cpp \
bionic/pthread_sigmask.cpp \ bionic/pthread_sigmask.cpp \
bionic/pthread_spinlock.cpp \
libc_thread_atexit_impl_src_files := \
bionic/__cxa_thread_atexit_impl.cpp \
libc_arch_static_src_files := \ libc_arch_static_src_files := \
bionic/dl_iterate_phdr_static.cpp \ bionic/dl_iterate_phdr_static.cpp \
@ -574,11 +617,19 @@ libc_common_cflags := \
-D_LIBC=1 \ -D_LIBC=1 \
-Wall -Wextra -Wunused \ -Wall -Wextra -Wunused \
ifneq ($(TARGET_USES_LOGD),false) use_clang := $(USE_CLANG_PLATFORM_BUILD)
libc_common_cflags += -DTARGET_USES_LOGD
# Clang/llvm has incompatible long double (fp128) for x86_64.
# https://llvm.org/bugs/show_bug.cgi?id=23897
ifeq ($(TARGET_ARCH),x86_64)
use_clang := false
endif
# b/25291096, Clang/llvm compiled libc.so for mips/mips64 failed to boot.
ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),mips mips64))
use_clang := false
endif endif
use_clang := $(USE_CLANG_PLATFORM_BUILD)
ifeq ($(use_clang),) ifeq ($(use_clang),)
use_clang := false use_clang := false
endif endif
@ -594,7 +645,7 @@ ifeq ($(strip $(DEBUG_BIONIC_LIBC)),true)
libc_common_cflags += -DDEBUG libc_common_cflags += -DDEBUG
endif endif
ifeq ($(MALLOC_IMPL),dlmalloc) ifeq ($(MALLOC_SVELTE),true)
libc_common_cflags += -DUSE_DLMALLOC libc_common_cflags += -DUSE_DLMALLOC
libc_malloc_src := bionic/dlmalloc.c libc_malloc_src := bionic/dlmalloc.c
else else
@ -603,20 +654,12 @@ else
libc_common_c_includes += external/jemalloc/include libc_common_c_includes += external/jemalloc/include
endif 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 # Define some common conlyflags
libc_common_conlyflags := \ libc_common_conlyflags := \
-std=gnu99 -std=gnu99
# Define some common cppflags # Define some common cppflags
libc_common_cppflags := \ libc_common_cppflags := \
-std=gnu++11
# Define some common includes # Define some common includes
# ======================================================== # ========================================================
@ -641,13 +684,21 @@ endef
# libc_stack_protector.a - stack protector code # libc_stack_protector.a - stack protector code
# ======================================================== # ========================================================
# #
# The stack protector code needs to be compiled # Code that implements the stack protector (or that runs
# with -fno-stack-protector, since it modifies the # before TLS has been set up) needs to be compiled with
# stack canary. # -fno-stack-protector, since it accesses the stack canary
# TLS slot.
include $(CLEAR_VARS) include $(CLEAR_VARS)
LOCAL_SRC_FILES := bionic/__stack_chk_fail.cpp 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_CFLAGS := $(libc_common_cflags) -fno-stack-protector
LOCAL_CONLYFLAGS := $(libc_common_conlyflags) LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
LOCAL_CPPFLAGS := $(libc_common_cppflags) LOCAL_CPPFLAGS := $(libc_common_cppflags)
@ -657,7 +708,31 @@ LOCAL_CLANG := $(use_clang)
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies) LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
LOCAL_CXX_STL := none LOCAL_CXX_STL := none
LOCAL_SYSTEM_SHARED_LIBRARIES := LOCAL_SYSTEM_SHARED_LIBRARIES :=
LOCAL_ADDRESS_SANITIZER := false 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_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) LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags)) $(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags))
@ -676,17 +751,22 @@ LOCAL_SRC_FILES += upstream-openbsd/lib/libc/time/wcsftime.c
LOCAL_CFLAGS := $(libc_common_cflags) \ LOCAL_CFLAGS := $(libc_common_cflags) \
-fvisibility=hidden \ -fvisibility=hidden \
-Wno-unused-parameter \
# Don't use ridiculous amounts of stack. # Don't use ridiculous amounts of stack.
LOCAL_CFLAGS += -DALL_STATE LOCAL_CFLAGS += -DALL_STATE
# Include tzsetwall, timelocal, timegm, time2posix, and posix2time. # Include tzsetwall, timelocal, timegm, time2posix, and posix2time.
LOCAL_CFLAGS += -DSTD_INSPIRED LOCAL_CFLAGS += -DSTD_INSPIRED
# Obviously, we want to be thread-safe.
LOCAL_CFLAGS += -DTHREAD_SAFE
# The name of the tm_gmtoff field in our struct tm. # The name of the tm_gmtoff field in our struct tm.
LOCAL_CFLAGS += -DTM_GMTOFF=tm_gmtoff LOCAL_CFLAGS += -DTM_GMTOFF=tm_gmtoff
# Where we store our tzdata. # Where we store our tzdata.
LOCAL_CFLAGS += -DTZDIR=\"/system/usr/share/zoneinfo\" LOCAL_CFLAGS += -DTZDIR=\"/system/usr/share/zoneinfo\"
# Include timezone and daylight globals. # Include timezone and daylight globals.
LOCAL_CFLAGS += -DUSG_COMPAT=1 LOCAL_CFLAGS += -DUSG_COMPAT=1
# Use the empty string (instead of " ") as the timezone abbreviation fallback.
LOCAL_CFLAGS += -DWILDABBR=\"\"
LOCAL_CFLAGS += -DNO_RUN_TIME_WARNINGS_ABOUT_YEAR_2000_PROBLEMS_THANK_YOU LOCAL_CFLAGS += -DNO_RUN_TIME_WARNINGS_ABOUT_YEAR_2000_PROBLEMS_THANK_YOU
LOCAL_CFLAGS += -Dlint LOCAL_CFLAGS += -Dlint
@ -698,7 +778,7 @@ LOCAL_CLANG := $(use_clang)
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies) LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
LOCAL_CXX_STL := none LOCAL_CXX_STL := none
LOCAL_SYSTEM_SHARED_LIBRARIES := LOCAL_SYSTEM_SHARED_LIBRARIES :=
LOCAL_ADDRESS_SANITIZER := false LOCAL_SANITIZE := never
LOCAL_NATIVE_COVERAGE := $(bionic_coverage) LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags)) $(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags))
@ -744,7 +824,7 @@ LOCAL_CLANG := $(use_clang)
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies) LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
LOCAL_CXX_STL := none LOCAL_CXX_STL := none
LOCAL_SYSTEM_SHARED_LIBRARIES := LOCAL_SYSTEM_SHARED_LIBRARIES :=
LOCAL_ADDRESS_SANITIZER := false LOCAL_SANITIZE := never
LOCAL_NATIVE_COVERAGE := $(bionic_coverage) LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags)) $(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags))
@ -777,11 +857,11 @@ LOCAL_CLANG := $(use_clang)
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies) LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
LOCAL_CXX_STL := none LOCAL_CXX_STL := none
LOCAL_SYSTEM_SHARED_LIBRARIES := LOCAL_SYSTEM_SHARED_LIBRARIES :=
LOCAL_ADDRESS_SANITIZER := false LOCAL_SANITIZE := never
LOCAL_NATIVE_COVERAGE := $(bionic_coverage) LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags)) $(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags))
$(eval $(call patch-up-arch-specific-flags,LOCAL_SRC_FILES,libc_freebsd_src_files)) $(eval $(call patch-up-arch-specific-flags,LOCAL_SRC_FILES_EXCLUDE,libc_freebsd_src_files_exclude))
include $(BUILD_STATIC_LIBRARY) include $(BUILD_STATIC_LIBRARY)
@ -812,7 +892,7 @@ LOCAL_CLANG := $(use_clang)
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies) LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
LOCAL_CXX_STL := none LOCAL_CXX_STL := none
LOCAL_SYSTEM_SHARED_LIBRARIES := LOCAL_SYSTEM_SHARED_LIBRARIES :=
LOCAL_ADDRESS_SANITIZER := false LOCAL_SANITIZE := never
LOCAL_NATIVE_COVERAGE := $(bionic_coverage) LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags)) $(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags))
@ -853,7 +933,7 @@ LOCAL_MODULE := libc_openbsd_ndk
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies) LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
LOCAL_CXX_STL := none LOCAL_CXX_STL := none
LOCAL_SYSTEM_SHARED_LIBRARIES := LOCAL_SYSTEM_SHARED_LIBRARIES :=
LOCAL_ADDRESS_SANITIZER := false LOCAL_SANITIZE := never
LOCAL_NATIVE_COVERAGE := $(bionic_coverage) LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags)) $(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags))
@ -891,11 +971,12 @@ LOCAL_MODULE := libc_openbsd
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies) LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
LOCAL_CXX_STL := none LOCAL_CXX_STL := none
LOCAL_SYSTEM_SHARED_LIBRARIES := LOCAL_SYSTEM_SHARED_LIBRARIES :=
LOCAL_ADDRESS_SANITIZER := false LOCAL_SANITIZE := never
LOCAL_NATIVE_COVERAGE := $(bionic_coverage) LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags)) $(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags))
$(eval $(call patch-up-arch-specific-flags,LOCAL_SRC_FILES,libc_openbsd_src_files)) $(eval $(call patch-up-arch-specific-flags,LOCAL_SRC_FILES,libc_openbsd_src_files))
$(eval $(call patch-up-arch-specific-flags,LOCAL_SRC_FILES_EXCLUDE,libc_openbsd_src_files_exclude))
include $(BUILD_STATIC_LIBRARY) include $(BUILD_STATIC_LIBRARY)
@ -929,7 +1010,7 @@ LOCAL_MODULE := libc_gdtoa
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies) LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
LOCAL_CXX_STL := none LOCAL_CXX_STL := none
LOCAL_SYSTEM_SHARED_LIBRARIES := LOCAL_SYSTEM_SHARED_LIBRARIES :=
LOCAL_ADDRESS_SANITIZER := false LOCAL_SANITIZE := never
LOCAL_NATIVE_COVERAGE := $(bionic_coverage) LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags)) $(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags))
@ -954,11 +1035,12 @@ LOCAL_CLANG := $(use_clang)
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies) LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
LOCAL_CXX_STL := none LOCAL_CXX_STL := none
LOCAL_SYSTEM_SHARED_LIBRARIES := LOCAL_SYSTEM_SHARED_LIBRARIES :=
LOCAL_ADDRESS_SANITIZER := false LOCAL_SANITIZE := never
LOCAL_NATIVE_COVERAGE := $(bionic_coverage) LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags)) $(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags))
$(eval $(call patch-up-arch-specific-flags,LOCAL_SRC_FILES,libc_bionic_src_files)) $(eval $(call patch-up-arch-specific-flags,LOCAL_SRC_FILES,libc_bionic_src_files))
$(eval $(call patch-up-arch-specific-flags,LOCAL_SRC_FILES_EXCLUDE,libc_bionic_src_files_exclude))
include $(BUILD_STATIC_LIBRARY) include $(BUILD_STATIC_LIBRARY)
@ -982,31 +1064,13 @@ LOCAL_CLANG := $(use_clang)
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies) LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
LOCAL_CXX_STL := none LOCAL_CXX_STL := none
LOCAL_SYSTEM_SHARED_LIBRARIES := LOCAL_SYSTEM_SHARED_LIBRARIES :=
LOCAL_ADDRESS_SANITIZER := false LOCAL_SANITIZE := never
LOCAL_NATIVE_COVERAGE := $(bionic_coverage) LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags)) $(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags))
$(eval $(call patch-up-arch-specific-flags,LOCAL_SRC_FILES,libc_bionic_ndk_src_files)) $(eval $(call patch-up-arch-specific-flags,LOCAL_SRC_FILES,libc_bionic_ndk_src_files))
include $(BUILD_STATIC_LIBRARY) include $(BUILD_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := $(libc_thread_atexit_impl_src_files)
LOCAL_CFLAGS := $(libc_common_cflags) -Wframe-larger-than=2048
LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
LOCAL_CPPFLAGS := $(libc_common_cppflags) -Wold-style-cast
LOCAL_C_INCLUDES := $(libc_common_c_includes)
LOCAL_MODULE := libc_thread_atexit_impl
# TODO: Clang tries to use __tls_get_addr which is not supported yet
# remove after it is implemented.
LOCAL_CLANG := false
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
LOCAL_CXX_STL := none
LOCAL_SYSTEM_SHARED_LIBRARIES :=
LOCAL_ADDRESS_SANITIZER := false
LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
include $(BUILD_STATIC_LIBRARY)
# ======================================================== # ========================================================
# libc_pthread.a - pthreads parts that previously lived in # libc_pthread.a - pthreads parts that previously lived in
@ -1030,7 +1094,7 @@ LOCAL_CLANG := $(use_clang)
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies) LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
LOCAL_CXX_STL := none LOCAL_CXX_STL := none
LOCAL_SYSTEM_SHARED_LIBRARIES := LOCAL_SYSTEM_SHARED_LIBRARIES :=
LOCAL_ADDRESS_SANITIZER := false LOCAL_SANITIZE := never
LOCAL_NATIVE_COVERAGE := $(bionic_coverage) LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
include $(BUILD_STATIC_LIBRARY) include $(BUILD_STATIC_LIBRARY)
@ -1054,7 +1118,7 @@ LOCAL_CLANG := true # GCC refuses to hide new/delete
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies) LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
LOCAL_CXX_STL := none LOCAL_CXX_STL := none
LOCAL_SYSTEM_SHARED_LIBRARIES := LOCAL_SYSTEM_SHARED_LIBRARIES :=
LOCAL_ADDRESS_SANITIZER := false LOCAL_SANITIZE := never
# b/17574078: Need to disable coverage until we have a prebuilt libprofile_rt. # b/17574078: Need to disable coverage until we have a prebuilt libprofile_rt.
# Since this is a static library built with clang, it needs to link # Since this is a static library built with clang, it needs to link
# libprofile_rt when it is linked into the final binary. Since the final binary # libprofile_rt when it is linked into the final binary. Since the final binary
@ -1082,7 +1146,7 @@ LOCAL_CLANG := $(use_clang)
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies) LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
LOCAL_CXX_STL := none LOCAL_CXX_STL := none
LOCAL_SYSTEM_SHARED_LIBRARIES := LOCAL_SYSTEM_SHARED_LIBRARIES :=
LOCAL_ADDRESS_SANITIZER := false LOCAL_SANITIZE := never
LOCAL_NATIVE_COVERAGE := $(bionic_coverage) LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
include $(BUILD_STATIC_LIBRARY) include $(BUILD_STATIC_LIBRARY)
@ -1104,7 +1168,7 @@ LOCAL_CFLAGS := $(libc_common_cflags) -fno-builtin
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies) LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
LOCAL_CXX_STL := none LOCAL_CXX_STL := none
LOCAL_SYSTEM_SHARED_LIBRARIES := LOCAL_SYSTEM_SHARED_LIBRARIES :=
LOCAL_ADDRESS_SANITIZER := false LOCAL_SANITIZE := never
LOCAL_NATIVE_COVERAGE := $(bionic_coverage) LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
include $(BUILD_STATIC_LIBRARY) include $(BUILD_STATIC_LIBRARY)
@ -1130,7 +1194,7 @@ LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
LOCAL_CFLAGS := $(libc_common_cflags) -fvisibility=hidden -O0 LOCAL_CFLAGS := $(libc_common_cflags) -fvisibility=hidden -O0
LOCAL_CPPFLAGS := $(libc_common_cppflags) LOCAL_CPPFLAGS := $(libc_common_cppflags)
LOCAL_C_INCLUDES := $(libc_common_c_includes) LOCAL_C_INCLUDES := $(libc_common_c_includes)
LOCAL_ADDRESS_SANITIZER := false LOCAL_SANITIZE := never
LOCAL_NATIVE_COVERAGE := $(bionic_coverage) LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
LOCAL_SYSTEM_SHARED_LIBRARIES := LOCAL_SYSTEM_SHARED_LIBRARIES :=
@ -1164,7 +1228,7 @@ LOCAL_WHOLE_STATIC_LIBRARIES := \
LOCAL_WHOLE_STATIC_LIBRARIES_arm := libc_aeabi LOCAL_WHOLE_STATIC_LIBRARIES_arm := libc_aeabi
LOCAL_CXX_STL := none LOCAL_CXX_STL := none
ifneq ($(MALLOC_IMPL),dlmalloc) ifneq ($(MALLOC_SVELTE),true)
LOCAL_WHOLE_STATIC_LIBRARIES += libjemalloc LOCAL_WHOLE_STATIC_LIBRARIES += libjemalloc
endif endif
@ -1204,7 +1268,6 @@ LOCAL_WHOLE_STATIC_LIBRARIES := \
libc_pthread \ libc_pthread \
libc_stack_protector \ libc_stack_protector \
libc_syscalls \ libc_syscalls \
libc_thread_atexit_impl \
libc_tzcode \ libc_tzcode \
LOCAL_WHOLE_STATIC_LIBRARIES_arm := libc_aeabi LOCAL_WHOLE_STATIC_LIBRARIES_arm := libc_aeabi
@ -1214,7 +1277,7 @@ LOCAL_SYSTEM_SHARED_LIBRARIES :=
# TODO: split out the asflags. # TODO: split out the asflags.
LOCAL_ASFLAGS := $(LOCAL_CFLAGS) LOCAL_ASFLAGS := $(LOCAL_CFLAGS)
LOCAL_ADDRESS_SANITIZER := false LOCAL_SANITIZE := never
LOCAL_NATIVE_COVERAGE := $(bionic_coverage) LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags)) $(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags))
@ -1237,7 +1300,6 @@ include $(CLEAR_VARS)
LOCAL_SRC_FILES := \ LOCAL_SRC_FILES := \
$(libc_arch_static_src_files) \ $(libc_arch_static_src_files) \
bionic/libc_init_static.cpp
LOCAL_C_INCLUDES := $(libc_common_c_includes) LOCAL_C_INCLUDES := $(libc_common_c_includes)
LOCAL_CFLAGS := $(libc_common_cflags) \ LOCAL_CFLAGS := $(libc_common_cflags) \
@ -1249,10 +1311,10 @@ LOCAL_CPPFLAGS := $(libc_common_cppflags)
LOCAL_MODULE := libc_nomalloc LOCAL_MODULE := libc_nomalloc
LOCAL_CLANG := $(use_clang) LOCAL_CLANG := $(use_clang)
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies) 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_CXX_STL := none
LOCAL_SYSTEM_SHARED_LIBRARIES := LOCAL_SYSTEM_SHARED_LIBRARIES :=
LOCAL_ADDRESS_SANITIZER := false LOCAL_SANITIZE := never
LOCAL_NATIVE_COVERAGE := $(bionic_coverage) LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags)) $(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags))
@ -1275,7 +1337,7 @@ LOCAL_C_INCLUDES := $(libc_common_c_includes)
LOCAL_MODULE := libc_malloc LOCAL_MODULE := libc_malloc
LOCAL_CLANG := $(use_clang) LOCAL_CLANG := $(use_clang)
LOCAL_CXX_STL := none LOCAL_CXX_STL := none
LOCAL_ADDRESS_SANITIZER := false LOCAL_SANITIZE := never
LOCAL_NATIVE_COVERAGE := $(bionic_coverage) LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies) LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
include $(BUILD_STATIC_LIBRARY) include $(BUILD_STATIC_LIBRARY)
@ -1289,7 +1351,6 @@ include $(CLEAR_VARS)
LOCAL_SRC_FILES := \ LOCAL_SRC_FILES := \
$(libc_arch_static_src_files) \ $(libc_arch_static_src_files) \
bionic/malloc_debug_common.cpp \ bionic/malloc_debug_common.cpp \
bionic/libc_init_static.cpp \
LOCAL_CFLAGS := $(libc_common_cflags) \ LOCAL_CFLAGS := $(libc_common_cflags) \
-DLIBC_STATIC \ -DLIBC_STATIC \
@ -1300,15 +1361,15 @@ LOCAL_C_INCLUDES := $(libc_common_c_includes)
LOCAL_MODULE := libc LOCAL_MODULE := libc
LOCAL_CLANG := $(use_clang) LOCAL_CLANG := $(use_clang)
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies) 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 LOCAL_WHOLE_STATIC_LIBRARIES += libjemalloc
endif endif
LOCAL_CXX_STL := none LOCAL_CXX_STL := none
LOCAL_SYSTEM_SHARED_LIBRARIES := LOCAL_SYSTEM_SHARED_LIBRARIES :=
LOCAL_ADDRESS_SANITIZER := false LOCAL_SANITIZE := never
LOCAL_NATIVE_COVERAGE := $(bionic_coverage) LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags)) $(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags))
@ -1340,7 +1401,15 @@ LOCAL_CLANG := $(use_clang)
LOCAL_REQUIRED_MODULES := tzdata LOCAL_REQUIRED_MODULES := tzdata
LOCAL_ADDITIONAL_DEPENDENCIES := \ LOCAL_ADDITIONAL_DEPENDENCIES := \
$(libc_common_additional_dependencies) \ $(libc_common_additional_dependencies) \
$(LOCAL_PATH)/libc.map \ $(LOCAL_PATH)/libc.arm.map \
$(LOCAL_PATH)/libc.arm64.map \
$(LOCAL_PATH)/libc.mips.map \
$(LOCAL_PATH)/libc.mips64.map \
$(LOCAL_PATH)/libc.x86.map \
$(LOCAL_PATH)/libc.x86_64.map \
$(LOCAL_PATH)/libc.arm.brillo.map \
$(LOCAL_PATH)/libc.mips.brillo.map \
$(LOCAL_PATH)/libc.x86.brillo.map \
# Leave the symbols in the shared library so that stack unwinders can produce # Leave the symbols in the shared library so that stack unwinders can produce
# meaningful name resolution. # meaningful name resolution.
@ -1360,24 +1429,40 @@ LOCAL_PACK_MODULE_RELOCATIONS := false
LOCAL_SHARED_LIBRARIES := libdl LOCAL_SHARED_LIBRARIES := libdl
LOCAL_WHOLE_STATIC_LIBRARIES := libc_common LOCAL_WHOLE_STATIC_LIBRARIES := libc_common
ifneq ($(MALLOC_IMPL),dlmalloc) ifneq ($(MALLOC_SVELTE),true)
LOCAL_WHOLE_STATIC_LIBRARIES += libjemalloc LOCAL_WHOLE_STATIC_LIBRARIES += libjemalloc
endif endif
LOCAL_CXX_STL := none LOCAL_CXX_STL := none
LOCAL_SYSTEM_SHARED_LIBRARIES := LOCAL_SYSTEM_SHARED_LIBRARIES :=
# TODO: This is to work around b/24465209. Remove after root cause is fixed
LOCAL_LDFLAGS_arm := -Wl,--hash-style=both
LOCAL_LDFLAGS_x86 := -Wl,--hash-style=both
# Don't re-export new/delete and friends, even if the compiler really wants to. # Don't re-export new/delete and friends, even if the compiler really wants to.
LOCAL_LDFLAGS := -Wl,--version-script,$(LOCAL_PATH)/libc.map 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
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
# We'd really like to do this for all architectures, but since this wasn't done # 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 # before, these symbols must continue to be exported on LP32 for binary
# compatibility. # compatibility.
LOCAL_LDFLAGS_64 := -Wl,--exclude-libs,libgcc.a LOCAL_LDFLAGS_64 := -Wl,--exclude-libs,libgcc.a
# TODO: This is to work around b/19059885. Remove after root cause is fixed # Unfortunately --exclude-libs clobbers our version script, so we have to
LOCAL_LDFLAGS_arm := -Wl,--hash-style=both # prevent the build system from using this flag.
LOCAL_LDFLAGS_x86 := -Wl,--hash-style=both LOCAL_NO_EXCLUDE_LIBS := true
$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags)) $(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags))
$(eval $(call patch-up-arch-specific-flags,LOCAL_SRC_FILES,libc_arch_dynamic_src_files)) $(eval $(call patch-up-arch-specific-flags,LOCAL_SRC_FILES,libc_arch_dynamic_src_files))
@ -1390,7 +1475,7 @@ LOCAL_CFLAGS_arm += -DCRT_LEGACY_WORKAROUND
LOCAL_SRC_FILES_arm += \ LOCAL_SRC_FILES_arm += \
arch-arm/bionic/atexit_legacy.c arch-arm/bionic/atexit_legacy.c
LOCAL_ADDRESS_SANITIZER := false LOCAL_SANITIZE := never
LOCAL_NATIVE_COVERAGE := $(bionic_coverage) LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
include $(BUILD_SHARED_LIBRARY) include $(BUILD_SHARED_LIBRARY)
@ -1418,8 +1503,8 @@ LOCAL_C_INCLUDES := \
$(libc_common_c_includes) \ $(libc_common_c_includes) \
LOCAL_SRC_FILES := \ LOCAL_SRC_FILES := \
bionic/debug_backtrace.cpp \
bionic/debug_mapinfo.cpp \ bionic/debug_mapinfo.cpp \
bionic/debug_stacktrace.cpp \
bionic/libc_logging.cpp \ bionic/libc_logging.cpp \
bionic/malloc_debug_leak.cpp \ bionic/malloc_debug_leak.cpp \
bionic/malloc_debug_check.cpp \ bionic/malloc_debug_check.cpp \
@ -1436,15 +1521,20 @@ LOCAL_SYSTEM_SHARED_LIBRARIES :=
# Only need this for arm since libc++ uses its own unwind code that # Only need this for arm since libc++ uses its own unwind code that
# doesn't mix with the other default unwind code. # doesn't mix with the other default unwind code.
LOCAL_STATIC_LIBRARIES_arm := libunwind_llvm LOCAL_STATIC_LIBRARIES_arm := libunwind_llvm
LOCAL_LDFLAGS_arm := -Wl,--exclude-libs,libunwind_llvm.a
LOCAL_STATIC_LIBRARIES += libc++abi LOCAL_STATIC_LIBRARIES += libc++abi
LOCAL_ALLOW_UNDEFINED_SYMBOLS := true LOCAL_ALLOW_UNDEFINED_SYMBOLS := true
# Don't re-export new/delete and friends, even if the compiler really wants to. # Don't re-export new/delete and friends, even if the compiler really wants to.
LOCAL_LDFLAGS := -Wl,--version-script,$(LOCAL_PATH)/version_script.txt LOCAL_LDFLAGS := -Wl,--version-script,$(LOCAL_PATH)/version_script.txt
# Unfortunately --exclude-libs clobbers our version script, so we have to
# prevent the build system from using this flag.
LOCAL_NO_EXCLUDE_LIBS := true
# Don't install on release build # Don't install on release build
LOCAL_MODULE_TAGS := eng debug LOCAL_MODULE_TAGS := eng debug
LOCAL_ADDRESS_SANITIZER := false LOCAL_SANITIZE := never
LOCAL_NATIVE_COVERAGE := $(bionic_coverage) LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags)) $(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags))
@ -1482,9 +1572,13 @@ LOCAL_SYSTEM_SHARED_LIBRARIES :=
# Don't re-export new/delete and friends, even if the compiler really wants to. # Don't re-export new/delete and friends, even if the compiler really wants to.
LOCAL_LDFLAGS := -Wl,--version-script,$(LOCAL_PATH)/version_script.txt LOCAL_LDFLAGS := -Wl,--version-script,$(LOCAL_PATH)/version_script.txt
# Unfortunately --exclude-libs clobbers our version script, so we have to
# prevent the build system from using this flag.
LOCAL_NO_EXCLUDE_LIBS := true
# Don't install on release build # Don't install on release build
LOCAL_MODULE_TAGS := eng debug LOCAL_MODULE_TAGS := eng debug
LOCAL_ADDRESS_SANITIZER := false LOCAL_SANITIZE := never
LOCAL_NATIVE_COVERAGE := $(bionic_coverage) LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags)) $(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags))
@ -1506,7 +1600,7 @@ LOCAL_C_INCLUDES := $(libc_common_c_includes) bionic/libstdc++/include
LOCAL_CFLAGS := $(libc_common_cflags) LOCAL_CFLAGS := $(libc_common_cflags)
LOCAL_CPPFLAGS := $(libc_common_cppflags) LOCAL_CPPFLAGS := $(libc_common_cppflags)
# TODO: This is to work around b/19059885. Remove after root cause is fixed # TODO: This is to work around b/24465209. Remove after root cause is fixed
LOCAL_LDFLAGS_arm := -Wl,--hash-style=both LOCAL_LDFLAGS_arm := -Wl,--hash-style=both
LOCAL_LDFLAGS_x86 := -Wl,--hash-style=both LOCAL_LDFLAGS_x86 := -Wl,--hash-style=both
@ -1515,7 +1609,7 @@ LOCAL_MODULE:= libstdc++
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_CXX_STL := none LOCAL_CXX_STL := none
LOCAL_SYSTEM_SHARED_LIBRARIES := libc LOCAL_SYSTEM_SHARED_LIBRARIES := libc
LOCAL_ADDRESS_SANITIZER := false LOCAL_SANITIZE := never
LOCAL_NATIVE_COVERAGE := $(bionic_coverage) LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
include $(BUILD_SHARED_LIBRARY) include $(BUILD_SHARED_LIBRARY)
@ -1531,7 +1625,7 @@ LOCAL_MODULE:= libstdc++
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_CXX_STL := none LOCAL_CXX_STL := none
LOCAL_SYSTEM_SHARED_LIBRARIES := libc LOCAL_SYSTEM_SHARED_LIBRARIES := libc
LOCAL_ADDRESS_SANITIZER := false LOCAL_SANITIZE := never
LOCAL_NATIVE_COVERAGE := $(bionic_coverage) LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
include $(BUILD_STATIC_LIBRARY) include $(BUILD_STATIC_LIBRARY)

View File

@ -307,22 +307,6 @@ SUCH DAMAGE.
------------------------------------------------------------------- -------------------------------------------------------------------
Copyright (C) 2009 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.
-------------------------------------------------------------------
Copyright (C) 2009 The Android Open Source Project Copyright (C) 2009 The Android Open Source Project
All rights reserved. All rights reserved.
@ -3921,35 +3905,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
------------------------------------------------------------------- -------------------------------------------------------------------
Copyright (c) 2009
MIPS Technologies, Inc., California.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. 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.
3. Neither the name of the MIPS Technologies, Inc., nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE MIPS TECHNOLOGIES, INC. ``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 MIPS TECHNOLOGIES, INC. 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.
-------------------------------------------------------------------
Copyright (c) 2009 David Schultz <das@FreeBSD.org> Copyright (c) 2009 David Schultz <das@FreeBSD.org>
All rights reserved. All rights reserved.
@ -4431,6 +4386,64 @@ Copyright (c) 2012, Linaro Limited
------------------------------------------------------------------- -------------------------------------------------------------------
Copyright (c) 2012-2015
MIPS Technologies, Inc., California.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. 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.
3. Neither the name of the MIPS Technologies, Inc., nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE MIPS TECHNOLOGIES, INC. ``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 MIPS TECHNOLOGIES, INC. 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.
-------------------------------------------------------------------
Copyright (c) 2013
MIPS Technologies, Inc., California.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. 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.
3. Neither the name of the MIPS Technologies, Inc., nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE MIPS TECHNOLOGIES, INC. ``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 MIPS TECHNOLOGIES, INC. 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.
-------------------------------------------------------------------
Copyright (c) 2013 ARM Ltd Copyright (c) 2013 ARM Ltd
All rights reserved. All rights reserved.
@ -4504,6 +4517,35 @@ POSSIBILITY OF SUCH DAMAGE.
------------------------------------------------------------------- -------------------------------------------------------------------
Copyright (c) 2014
Imagination Technologies Limited.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. 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.
3. Neither the name of the MIPS Technologies, Inc., nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY IMAGINATION TECHNOLOGIES LIMITED ``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 IMAGINATION TECHNOLOGIES LIMITED 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.
-------------------------------------------------------------------
Copyright (c) 2014 Theo de Raadt <deraadt@openbsd.org> Copyright (c) 2014 Theo de Raadt <deraadt@openbsd.org>
Copyright (c) 2014 Bob Beck <beck@obtuse.com> Copyright (c) 2014 Bob Beck <beck@obtuse.com>

View File

@ -77,7 +77,6 @@ int prlimit64(pid_t, int, struct rlimit64*, const struct rlimit64*) arm,mips,x8
int setgroups:setgroups32(int, const gid_t*) arm,x86 int setgroups:setgroups32(int, const gid_t*) arm,x86
int setgroups:setgroups(int, const gid_t*) arm64,mips,mips64,x86_64 int setgroups:setgroups(int, const gid_t*) arm64,mips,mips64,x86_64
int setpgid(pid_t, pid_t) all int setpgid(pid_t, pid_t) all
pid_t vfork(void) arm
int setregid:setregid32(gid_t, gid_t) arm,x86 int setregid:setregid32(gid_t, gid_t) arm,x86
int setregid:setregid(gid_t, gid_t) arm64,mips,mips64,x86_64 int setregid:setregid(gid_t, gid_t) arm64,mips,mips64,x86_64
int chroot(const char*) all int chroot(const char*) all
@ -95,10 +94,20 @@ ssize_t pread64(int, void*, size_t, off64_t) arm,mips,x86
ssize_t pread64|pread(int, void*, size_t, off_t) arm64,mips64,x86_64 ssize_t pread64|pread(int, void*, size_t, off_t) arm64,mips64,x86_64
ssize_t pwrite64(int, void*, size_t, off64_t) arm,mips,x86 ssize_t pwrite64(int, void*, size_t, off64_t) arm,mips,x86
ssize_t pwrite64|pwrite(int, void*, size_t, off_t) arm64,mips64,x86_64 ssize_t pwrite64|pwrite(int, void*, size_t, off_t) arm64,mips64,x86_64
# On LP32, preadv/pwritev don't use off64_t --- they use pairs of 32-bit
# arguments to avoid problems on architectures like ARM where 64-bit arguments
# must be in a register pair starting with an even-numbered register.
# See linux/fs/read_write.c and https://lwn.net/Articles/311630/.
ssize_t __preadv64:preadv(int, const struct iovec*, int, long, long) arm,mips,x86
ssize_t preadv|preadv64(int, const struct iovec*, int, off_t) arm64,mips64,x86_64
ssize_t __pwritev64:pwritev(int, const struct iovec*, int, long, long) arm,mips,x86
ssize_t pwritev|pwritev64(int, const struct iovec*, int, off_t) arm64,mips64,x86_64
int ___close:close(int) all int ___close:close(int) all
pid_t __getpid:getpid() all pid_t __getpid:getpid() all
int munmap(void*, size_t) all int munmap(void*, size_t) all
void* mremap(void*, size_t, size_t, unsigned long) all void* ___mremap:mremap(void*, size_t, size_t, int, void*) all
int msync(const void*, size_t, int) all int msync(const void*, size_t, int) all
int mprotect(const void*, size_t, int) all int mprotect(const void*, size_t, int) all
int madvise(void*, size_t, int) all int madvise(void*, size_t, int) all
@ -124,7 +133,7 @@ int fchown:fchown(int, uid_t, gid_t) arm64,mips,mips64,x86_64
void sync(void) all void sync(void) all
int ___fsetxattr:fsetxattr(int, const char*, const void*, size_t, int) all int ___fsetxattr:fsetxattr(int, const char*, const void*, size_t, int) all
ssize_t ___fgetxattr:fgetxattr(int, const char*, void*, size_t) all ssize_t ___fgetxattr:fgetxattr(int, const char*, void*, size_t) all
ssize_t flistxattr(int, char*, size_t) all ssize_t ___flistxattr:flistxattr(int, char*, size_t) all
int fremovexattr(int, const char*) all int fremovexattr(int, const char*) all
int __getdents64:getdents64(unsigned int, struct dirent*, unsigned int) arm,arm64,mips,mips64,x86,x86_64 int __getdents64:getdents64(unsigned int, struct dirent*, unsigned int) arm,arm64,mips,mips64,x86,x86_64
@ -333,7 +342,7 @@ int __set_tls:set_thread_area(void*) mips,mips64
int __set_thread_area:set_thread_area(void*) x86 int __set_thread_area:set_thread_area(void*) x86
# vdso stuff. # vdso stuff.
int clock_gettime(clockid_t, timespec*) arm,mips,mips64,x86 int clock_gettime(clockid_t, timespec*) arm,mips,mips64
int __clock_gettime:clock_gettime(clockid_t, timespec*) arm64,x86_64 int __clock_gettime:clock_gettime(clockid_t, timespec*) arm64,x86,x86_64
int gettimeofday(timeval*, timezone*) arm,mips,mips64,x86 int gettimeofday(timeval*, timezone*) arm,mips,mips64
int __gettimeofday:gettimeofday(timeval*, timezone*) arm64,x86_64 int __gettimeofday:gettimeofday(timeval*, timezone*) arm64,x86,x86_64

View File

@ -1,33 +1,19 @@
# 32-bit arm. # 32-bit arm.
#
# Default implementations of functions that are commonly optimized.
#
libc_bionic_src_files_arm += \ libc_bionic_src_files_arm += \
bionic/strchr.cpp \ arch-arm/generic/bionic/memcmp.S \
bionic/strnlen.c \ arch-arm/generic/bionic/memcpy.S \
bionic/strrchr.cpp \ arch-arm/generic/bionic/memset.S \
arch-arm/generic/bionic/strcmp.S \
arch-arm/generic/bionic/strcpy.S \
arch-arm/generic/bionic/strlen.c \
libc_freebsd_src_files_arm += \ libc_bionic_src_files_exclude_arm += \
upstream-freebsd/lib/libc/string/wcscat.c \ bionic/__memcpy_chk.cpp \
upstream-freebsd/lib/libc/string/wcschr.c \ bionic/__memset_chk.cpp \
upstream-freebsd/lib/libc/string/wcscmp.c \
upstream-freebsd/lib/libc/string/wcscpy.c \
upstream-freebsd/lib/libc/string/wcslen.c \
upstream-freebsd/lib/libc/string/wcsrchr.c \
upstream-freebsd/lib/libc/string/wmemcmp.c \
upstream-freebsd/lib/libc/string/wmemmove.c \
libc_openbsd_src_files_arm += \ libc_openbsd_src_files_exclude_arm += \
upstream-openbsd/lib/libc/string/memchr.c \ upstream-openbsd/lib/libc/string/strcpy.c \
upstream-openbsd/lib/libc/string/memrchr.c \
upstream-openbsd/lib/libc/string/stpncpy.c \
upstream-openbsd/lib/libc/string/strlcat.c \
upstream-openbsd/lib/libc/string/strlcpy.c \
upstream-openbsd/lib/libc/string/strncat.c \
upstream-openbsd/lib/libc/string/strncmp.c \
upstream-openbsd/lib/libc/string/strncpy.c \
# #
# Inherently architecture-specific code. # Inherently architecture-specific code.
@ -39,9 +25,11 @@ libc_bionic_src_files_arm += \
arch-arm/bionic/__bionic_clone.S \ arch-arm/bionic/__bionic_clone.S \
arch-arm/bionic/_exit_with_stack_teardown.S \ arch-arm/bionic/_exit_with_stack_teardown.S \
arch-arm/bionic/libgcc_compat.c \ arch-arm/bionic/libgcc_compat.c \
arch-arm/bionic/popcount_tab.c \
arch-arm/bionic/__restore.S \ arch-arm/bionic/__restore.S \
arch-arm/bionic/setjmp.S \ arch-arm/bionic/setjmp.S \
arch-arm/bionic/syscall.S \ arch-arm/bionic/syscall.S \
arch-arm/bionic/vfork.S \
libc_arch_static_src_files_arm := arch-arm/bionic/exidx_static.c libc_arch_static_src_files_arm := arch-arm/bionic/exidx_static.c
libc_arch_dynamic_src_files_arm := arch-arm/bionic/exidx_dynamic.c libc_arch_dynamic_src_files_arm := arch-arm/bionic/exidx_dynamic.c
@ -50,6 +38,7 @@ libc_arch_dynamic_src_files_arm := arch-arm/bionic/exidx_dynamic.c
ifeq ($(strip $(TARGET_$(my_2nd_arch_prefix)CPU_VARIANT)),) ifeq ($(strip $(TARGET_$(my_2nd_arch_prefix)CPU_VARIANT)),)
$(warning TARGET_$(my_2nd_arch_prefix)ARCH is arm, but TARGET_$(my_2nd_arch_prefix)CPU_VARIANT is not defined) $(warning TARGET_$(my_2nd_arch_prefix)ARCH is arm, but TARGET_$(my_2nd_arch_prefix)CPU_VARIANT is not defined)
endif endif
ifneq ($(TARGET_$(my_2nd_arch_prefix)CPU_VARIANT),generic)
cpu_variant_mk := $(LOCAL_PATH)/arch-arm/$(TARGET_$(my_2nd_arch_prefix)CPU_VARIANT)/$(TARGET_$(my_2nd_arch_prefix)CPU_VARIANT).mk cpu_variant_mk := $(LOCAL_PATH)/arch-arm/$(TARGET_$(my_2nd_arch_prefix)CPU_VARIANT)/$(TARGET_$(my_2nd_arch_prefix)CPU_VARIANT).mk
ifeq ($(wildcard $(cpu_variant_mk)),) ifeq ($(wildcard $(cpu_variant_mk)),)
$(error "TARGET_$(my_2nd_arch_prefix)CPU_VARIANT not set or set to an unknown value. Possible values are cortex-a7, cortex-a8, cortex-a9, cortex-a15, krait, denver. Use generic for devices that do not have a CPU similar to any of the supported cpu variants.") $(error "TARGET_$(my_2nd_arch_prefix)CPU_VARIANT not set or set to an unknown value. Possible values are cortex-a7, cortex-a8, cortex-a9, cortex-a15, krait, denver. Use generic for devices that do not have a CPU similar to any of the supported cpu variants.")
@ -58,6 +47,7 @@ include $(cpu_variant_mk)
libc_common_additional_dependencies += $(cpu_variant_mk) libc_common_additional_dependencies += $(cpu_variant_mk)
cpu_variant_mk := cpu_variant_mk :=
endif
libc_crt_target_cflags_arm := \ libc_crt_target_cflags_arm := \

View File

@ -51,34 +51,62 @@ extern int __cxa_atexit(void (*)(void*), void*, void*);
*/ */
int __attribute__((weak)) 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); return __cxa_atexit(destructor, object, dso_handle);
} }
void __attribute__((weak)) void __attribute__((weak)) __aeabi_memcpy8_impl(void *dest, const void *src, size_t n) {
__aeabi_memcpy8(void *dest, const void *src, size_t n) {
memcpy(dest, src, 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); 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); 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); 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); 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); 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 * 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); 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); 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); memset(dest, c, n);
} }
void __attribute__((weak)) __aeabi_memclr8(void *dest, size_t n) { void __attribute__((weak)) __aeabi_memclr8_impl(void *dest, size_t n) {
__aeabi_memset8(dest, n, 0); __aeabi_memset8_impl(dest, n, 0);
} }
void __attribute__((weak)) __aeabi_memclr4(void *dest, size_t n) { void __attribute__((weak)) __aeabi_memclr4_impl(void *dest, size_t n) {
__aeabi_memset4(dest, n, 0); __aeabi_memset4_impl(dest, n, 0);
} }
void __attribute__((weak)) __aeabi_memclr(void *dest, size_t n) { void __attribute__((weak)) __aeabi_memclr_impl(void *dest, size_t n) {
__aeabi_memset(dest, n, 0); __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

@ -34,7 +34,9 @@
// __restore_rt (but covered by the .fnstart/.fnend) so that although they're // __restore_rt (but covered by the .fnstart/.fnend) so that although they're
// not inside the functions from objdump's point of view, an unwinder that // not inside the functions from objdump's point of view, an unwinder that
// blindly looks at the previous instruction (but is then smart enough to check // blindly looks at the previous instruction (but is then smart enough to check
// the DWARF information to find out where it landed) gets the right answer. // the unwind information to find out where it landed) gets the right answer.
// Make sure not to have both DWARF and ARM unwind information, so only
// use the ARM unwind information.
// We need to place .fnstart ourselves (but we may as well keep the free .fnend). // We need to place .fnstart ourselves (but we may as well keep the free .fnend).
#undef __bionic_asm_custom_entry #undef __bionic_asm_custom_entry
@ -44,18 +46,18 @@
.save {r0-r15} .save {r0-r15}
.pad #32 .pad #32
nop nop
ENTRY_PRIVATE(__restore) ENTRY_PRIVATE_NO_DWARF(__restore)
// This function must have exactly this instruction sequence. // This function must have exactly this instruction sequence.
mov r7, #__NR_sigreturn mov r7, #__NR_sigreturn
swi #0 swi #0
END(__restore) END_NO_DWARF(__restore)
.fnstart .fnstart
.save {r0-r15} .save {r0-r15}
.pad #160 .pad #160
nop nop
ENTRY_PRIVATE(__restore_rt) ENTRY_PRIVATE_NO_DWARF(__restore_rt)
// This function must have exactly this instruction sequence. // This function must have exactly this instruction sequence.
mov r7, #__NR_rt_sigreturn mov r7, #__NR_rt_sigreturn
swi #0 swi #0
END(__restore_rt) END_NO_DWARF(__restore_rt)

View File

@ -37,7 +37,13 @@
* the expectation that libc will define it and call through to * the expectation that libc will define it and call through to
* a differently-named function in the dynamic linker. * 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); 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

@ -0,0 +1,42 @@
/*
* 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.
*/
// Export this to maintain ABI compatibilty with libgcc, since compiler-rt
// doesn't use a table-driven implementation of __popcount.
const unsigned char __popcount_tab[256] = {
0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3,
3, 4, 3, 4, 4, 5, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4,
3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4,
4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 2, 3, 3, 4, 3, 4, 4, 5,
3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 1, 2,
2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5,
4, 5, 5, 6, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5,
5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5,
5, 6, 5, 6, 6, 7, 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8
};

View File

@ -51,13 +51,13 @@
// The internal structure of a jmp_buf is totally private. // The internal structure of a jmp_buf is totally private.
// Current layout (may change in the future): // Current layout (may change in the future):
// //
// word name description // word name description
// 0 magic magic number // 0 sigflag/cookie setjmp cookie in top 31 bits, signal mask flag in low bit
// 1 sigmask signal mask (not used with _setjmp / _longjmp) // 1 sigmask signal mask (not used with _setjmp / _longjmp)
// 2 float_base base of float registers (d8 to d15) // 2 float_base base of float registers (d8 to d15)
// 18 float_state floating-point status and control register // 18 float_state floating-point status and control register
// 19 core_base base of core registers (r4 to r14) // 19 core_base base of core registers (r4 to r14)
// 30 reserved reserved entries (room to grow) // 30 reserved reserved entries (room to grow)
// 64 // 64
// //
// NOTE: float_base must be at an even word index, since the // NOTE: float_base must be at an even word index, since the
@ -80,33 +80,82 @@ ENTRY(_setjmp)
b sigsetjmp b sigsetjmp
END(_setjmp) END(_setjmp)
#define MANGLE_REGISTERS 1
.macro m_mangle_registers reg
#if MANGLE_REGISTERS
eor r4, r4, \reg
eor r5, r5, \reg
eor r6, r6, \reg
eor r7, r7, \reg
eor r8, r8, \reg
eor r9, r9, \reg
eor r10, r10, \reg
eor r11, r11, \reg
eor r12, r12, \reg
eor r13, r13, \reg
eor r14, r14, \reg
#endif
.endm
.macro m_unmangle_registers reg
m_mangle_registers \reg
.endm
// int sigsetjmp(sigjmp_buf env, int save_signal_mask); // int sigsetjmp(sigjmp_buf env, int save_signal_mask);
ENTRY(sigsetjmp) ENTRY(sigsetjmp)
// Record whether or not we're saving the signal mask. stmfd sp!, {r0, lr}
.cfi_def_cfa_offset 8
.cfi_rel_offset r0, 0
.cfi_rel_offset lr, 4
mov r0, r1
bl __bionic_setjmp_cookie_get
mov r1, r0
ldmfd sp, {r0}
// Save the setjmp cookie for later.
bic r2, r1, #1
stmfd sp!, {r2}
.cfi_adjust_cfa_offset 4
// Record the setjmp cookie and whether or not we're saving the signal mask.
str r1, [r0, #(_JB_SIGFLAG * 4)] str r1, [r0, #(_JB_SIGFLAG * 4)]
// Do we need to save the signal mask? // Do we need to save the signal mask?
teq r1, #0 tst r1, #1
beq 1f beq 1f
// Get current signal mask. // Align the stack.
stmfd sp!, {r0, r14} sub sp, #4
.cfi_def_cfa_offset 8 .cfi_adjust_cfa_offset 4
.cfi_rel_offset r0, 0
.cfi_rel_offset r14, 4
mov r0, #0
bl sigblock
mov r1, r0
ldmfd sp!, {r0, r14}
.cfi_def_cfa_offset 0
// Save the signal mask. // Save the current signal mask.
str r1, [r0, #(_JB_SIGMASK * 4)] add r2, r0, #(_JB_SIGMASK * 4)
mov r0, #2 // SIG_SETMASK
mov r1, #0
bl sigprocmask
// Unalign the stack.
add sp, #4
.cfi_adjust_cfa_offset -4
1: 1:
ldmfd sp!, {r2}
.cfi_adjust_cfa_offset -4
ldmfd sp!, {r0, lr}
.cfi_adjust_cfa_offset -8
.cfi_restore r0
.cfi_restore lr
// Save core registers. // Save core registers.
add r1, r0, #(_JB_CORE_BASE * 4) add r1, r0, #(_JB_CORE_BASE * 4)
stmia r1, {r4-r14} m_mangle_registers r2
// ARM deprecates using sp in the register list for stmia.
stmia r1, {r4-r12, lr}
str sp, [r1, #(10 * 4)]
m_unmangle_registers r2
// Save floating-point registers. // Save floating-point registers.
add r1, r0, #(_JB_FLOAT_BASE * 4) add r1, r0, #(_JB_FLOAT_BASE * 4)
@ -122,29 +171,30 @@ END(sigsetjmp)
// void siglongjmp(sigjmp_buf env, int value); // void siglongjmp(sigjmp_buf env, int value);
ENTRY(siglongjmp) ENTRY(siglongjmp)
// Do we need to restore the signal mask? stmfd sp!, {r0, r1, lr}
ldr r2, [r0, #(_JB_SIGFLAG * 4)]
teq r2, #0
beq 1f
// Restore the signal mask.
stmfd sp!, {r0, r1, r14}
.cfi_def_cfa_offset 12 .cfi_def_cfa_offset 12
.cfi_rel_offset r0, 0 .cfi_rel_offset r0, 0
.cfi_rel_offset r1, 4 .cfi_rel_offset r1, 4
.cfi_rel_offset r14, 8 .cfi_rel_offset lr, 8
sub sp, sp, #4 // Align the stack.
.cfi_adjust_cfa_offset 4
// Fetch the signal flag.
ldr r1, [r0, #(_JB_SIGFLAG * 4)]
// Do we need to restore the signal mask?
ands r1, r1, #1
beq 1f
// Restore the signal mask.
ldr r0, [r0, #(_JB_SIGMASK * 4)] ldr r0, [r0, #(_JB_SIGMASK * 4)]
bl sigsetmask bl sigsetmask
add sp, sp, #4 // Unalign the stack.
.cfi_adjust_cfa_offset -4
ldmfd sp!, {r0, r1, r14}
.cfi_def_cfa_offset 0
1: 1:
ldmfd sp!, {r0, r1, lr}
.cfi_adjust_cfa_offset -12
.cfi_restore r0
.cfi_restore r1
.cfi_restore lr
// Restore floating-point registers. // Restore floating-point registers.
add r2, r0, #(_JB_FLOAT_BASE * 4) add r2, r0, #(_JB_FLOAT_BASE * 4)
vldmia r2, {d8-d15} vldmia r2, {d8-d15}
@ -154,16 +204,27 @@ ENTRY(siglongjmp)
fmxr fpscr, r2 fmxr fpscr, r2
// Restore core registers. // Restore core registers.
ldr r3, [r0, #(_JB_SIGFLAG * 4)]
bic r3, r3, #1
add r2, r0, #(_JB_CORE_BASE * 4) add r2, r0, #(_JB_CORE_BASE * 4)
ldmia r2, {r4-r14}
// Validate sp and r14. // ARM deprecates using sp in the register list for ldmia.
teq sp, #0 ldmia r2, {r4-r12, lr}
teqne r14, #0 ldr sp, [r2, #(10 * 4)]
bleq longjmperror m_unmangle_registers r3
// Save the return value/address and check the setjmp cookie.
stmfd sp!, {r1, lr}
.cfi_adjust_cfa_offset 8
.cfi_rel_offset lr, 4
mov r0, r3
bl __bionic_setjmp_cookie_check
// Restore return value/address.
ldmfd sp!, {r0, lr}
.cfi_adjust_cfa_offset -8
.cfi_restore lr
// Set return value.
mov r0, r1
teq r0, #0 teq r0, #0
moveq r0, #1 moveq r0, #1
bx lr bx lr

View File

@ -0,0 +1,46 @@
/*
* 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 <private/bionic_asm.h>
ENTRY(vfork)
// __get_tls()[TLS_SLOT_THREAD_ID]->cached_pid_ = 0
mrc p15, 0, r3, c13, c0, 3
ldr r3, [r3, #4]
mov r0, #0
str r0, [r3, #12]
mov ip, r7
ldr r7, =__NR_vfork
swi #0
mov r7, ip
cmn r0, #(MAX_ERRNO + 1)
bxls lr
neg r0, r0
b __set_errno_internal
END(vfork)

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2013 The Android Open Source Project * Copyright (C) 2015 The Android Open Source Project
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -26,191 +26,7 @@
* SUCH DAMAGE. * SUCH DAMAGE.
*/ */
#include <private/bionic_asm.h> // Indicate which memcpy base file to include.
#include <private/libc_events.h> #define MEMCPY_BASE "memcpy_base.S"
.syntax unified #include "__strcat_chk_common.S"
.thumb
.thumb_func
// Get the length of src string, then get the source of the dst string.
// Check that the two lengths together don't exceed the threshold, then
// do a memcpy of the data.
ENTRY(__strcat_chk)
pld [r0, #0]
push {r0, lr}
.cfi_def_cfa_offset 8
.cfi_rel_offset r0, 0
.cfi_rel_offset lr, 4
push {r4, r5}
.cfi_adjust_cfa_offset 8
.cfi_rel_offset r4, 0
.cfi_rel_offset r5, 4
mov lr, r2
// Save the dst register to r5
mov r5, r0
// Zero out r4
eor r4, r4, r4
// r1 contains the address of the string to count.
.L_strlen_start:
mov r0, r1
ands r3, r1, #7
beq .L_mainloop
// Align to a double word (64 bits).
rsb r3, r3, #8
lsls ip, r3, #31
beq .L_align_to_32
ldrb r2, [r1], #1
cbz r2, .L_update_count_and_finish
.L_align_to_32:
bcc .L_align_to_64
ands ip, r3, #2
beq .L_align_to_64
ldrb r2, [r1], #1
cbz r2, .L_update_count_and_finish
ldrb r2, [r1], #1
cbz r2, .L_update_count_and_finish
.L_align_to_64:
tst r3, #4
beq .L_mainloop
ldr r3, [r1], #4
sub ip, r3, #0x01010101
bic ip, ip, r3
ands ip, ip, #0x80808080
bne .L_zero_in_second_register
.p2align 2
.L_mainloop:
ldrd r2, r3, [r1], #8
pld [r1, #64]
sub ip, r2, #0x01010101
bic ip, ip, r2
ands ip, ip, #0x80808080
bne .L_zero_in_first_register
sub ip, r3, #0x01010101
bic ip, ip, r3
ands ip, ip, #0x80808080
bne .L_zero_in_second_register
b .L_mainloop
.L_update_count_and_finish:
sub r3, r1, r0
sub r3, r3, #1
b .L_finish
.L_zero_in_first_register:
sub r3, r1, r0
lsls r2, ip, #17
bne .L_sub8_and_finish
bcs .L_sub7_and_finish
lsls ip, ip, #1
bne .L_sub6_and_finish
sub r3, r3, #5
b .L_finish
.L_sub8_and_finish:
sub r3, r3, #8
b .L_finish
.L_sub7_and_finish:
sub r3, r3, #7
b .L_finish
.L_sub6_and_finish:
sub r3, r3, #6
b .L_finish
.L_zero_in_second_register:
sub r3, r1, r0
lsls r2, ip, #17
bne .L_sub4_and_finish
bcs .L_sub3_and_finish
lsls ip, ip, #1
bne .L_sub2_and_finish
sub r3, r3, #1
b .L_finish
.L_sub4_and_finish:
sub r3, r3, #4
b .L_finish
.L_sub3_and_finish:
sub r3, r3, #3
b .L_finish
.L_sub2_and_finish:
sub r3, r3, #2
.L_finish:
cmp r4, #0
bne .L_strlen_done
// Time to get the dst string length.
mov r1, r5
// Save the original source address to r5.
mov r5, r0
// Save the current length (adding 1 for the terminator).
add r4, r3, #1
b .L_strlen_start
// r0 holds the pointer to the dst string.
// r3 holds the dst string length.
// r4 holds the src string length + 1.
.L_strlen_done:
add r2, r3, r4
cmp r2, lr
bhi __strcat_chk_failed
// Set up the registers for the memcpy code.
mov r1, r5
pld [r1, #64]
mov r2, r4
add r0, r0, r3
pop {r4, r5}
END(__strcat_chk)
#define MEMCPY_BASE __strcat_chk_memcpy_base
#define MEMCPY_BASE_ALIGNED __strcat_chk_memcpy_base_aligned
#include "memcpy_base.S"
ENTRY_PRIVATE(__strcat_chk_failed)
.cfi_def_cfa_offset 8
.cfi_rel_offset r0, 0
.cfi_rel_offset lr, 4
.cfi_adjust_cfa_offset 8
.cfi_rel_offset r4, 0
.cfi_rel_offset r5, 4
ldr r0, error_message
ldr r1, error_code
1:
add r0, pc
bl __fortify_chk_fail
error_code:
.word BIONIC_EVENT_STRCAT_BUFFER_OVERFLOW
error_message:
.word error_string-(1b+4)
END(__strcat_chk_failed)
.data
error_string:
.string "strcat: prevented write past end of buffer"

View File

@ -0,0 +1,212 @@
/*
* Copyright (C) 2013 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 <private/bionic_asm.h>
#include <private/libc_events.h>
.syntax unified
.thumb
.thumb_func
// Get the length of src string, then get the source of the dst string.
// Check that the two lengths together don't exceed the threshold, then
// do a memcpy of the data.
ENTRY(__strcat_chk)
pld [r0, #0]
push {r0, lr}
.cfi_def_cfa_offset 8
.cfi_rel_offset r0, 0
.cfi_rel_offset lr, 4
push {r4, r5}
.cfi_adjust_cfa_offset 8
.cfi_rel_offset r4, 0
.cfi_rel_offset r5, 4
mov lr, r2
// Save the dst register to r5
mov r5, r0
// Zero out r4
eor r4, r4, r4
// r1 contains the address of the string to count.
.L_strlen_start:
mov r0, r1
ands r3, r1, #7
beq .L_mainloop
// Align to a double word (64 bits).
rsb r3, r3, #8
lsls ip, r3, #31
beq .L_align_to_32
ldrb r2, [r1], #1
cbz r2, .L_update_count_and_finish
.L_align_to_32:
bcc .L_align_to_64
ands ip, r3, #2
beq .L_align_to_64
ldrb r2, [r1], #1
cbz r2, .L_update_count_and_finish
ldrb r2, [r1], #1
cbz r2, .L_update_count_and_finish
.L_align_to_64:
tst r3, #4
beq .L_mainloop
ldr r3, [r1], #4
sub ip, r3, #0x01010101
bic ip, ip, r3
ands ip, ip, #0x80808080
bne .L_zero_in_second_register
.p2align 2
.L_mainloop:
ldrd r2, r3, [r1], #8
pld [r1, #64]
sub ip, r2, #0x01010101
bic ip, ip, r2
ands ip, ip, #0x80808080
bne .L_zero_in_first_register
sub ip, r3, #0x01010101
bic ip, ip, r3
ands ip, ip, #0x80808080
bne .L_zero_in_second_register
b .L_mainloop
.L_update_count_and_finish:
sub r3, r1, r0
sub r3, r3, #1
b .L_finish
.L_zero_in_first_register:
sub r3, r1, r0
lsls r2, ip, #17
bne .L_sub8_and_finish
bcs .L_sub7_and_finish
lsls ip, ip, #1
bne .L_sub6_and_finish
sub r3, r3, #5
b .L_finish
.L_sub8_and_finish:
sub r3, r3, #8
b .L_finish
.L_sub7_and_finish:
sub r3, r3, #7
b .L_finish
.L_sub6_and_finish:
sub r3, r3, #6
b .L_finish
.L_zero_in_second_register:
sub r3, r1, r0
lsls r2, ip, #17
bne .L_sub4_and_finish
bcs .L_sub3_and_finish
lsls ip, ip, #1
bne .L_sub2_and_finish
sub r3, r3, #1
b .L_finish
.L_sub4_and_finish:
sub r3, r3, #4
b .L_finish
.L_sub3_and_finish:
sub r3, r3, #3
b .L_finish
.L_sub2_and_finish:
sub r3, r3, #2
.L_finish:
cmp r4, #0
bne .L_strlen_done
// Time to get the dst string length.
mov r1, r5
// Save the original source address to r5.
mov r5, r0
// Save the current length (adding 1 for the terminator).
add r4, r3, #1
b .L_strlen_start
// r0 holds the pointer to the dst string.
// r3 holds the dst string length.
// r4 holds the src string length + 1.
.L_strlen_done:
add r2, r3, r4
cmp r2, lr
bhi .L_strcat_chk_failed
// Set up the registers for the memcpy code.
mov r1, r5
pld [r1, #64]
mov r2, r4
add r0, r0, r3
pop {r4, r5}
.cfi_adjust_cfa_offset -8
.cfi_restore r4
.cfi_restore r5
#include MEMCPY_BASE
// Undo the above cfi directives
.cfi_adjust_cfa_offset 8
.cfi_rel_offset r4, 0
.cfi_rel_offset r5, 4
.L_strcat_chk_failed:
ldr r0, error_message
ldr r1, error_code
1:
add r0, pc
bl __fortify_chk_fail
error_code:
.word BIONIC_EVENT_STRCAT_BUFFER_OVERFLOW
error_message:
.word error_string-(1b+4)
END(__strcat_chk)
.data
error_string:
.string "strcat: prevented write past end of buffer"

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2013 The Android Open Source Project * Copyright (C) 2015 The Android Open Source Project
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -26,155 +26,7 @@
* SUCH DAMAGE. * SUCH DAMAGE.
*/ */
#include <private/bionic_asm.h> // Indicate which memcpy base file to include.
#include <private/libc_events.h> #define MEMCPY_BASE "memcpy_base.S"
.syntax unified #include "__strcpy_chk_common.S"
.thumb
.thumb_func
// Get the length of the source string first, then do a memcpy of the data
// instead of a strcpy.
ENTRY(__strcpy_chk)
pld [r0, #0]
push {r0, lr}
.cfi_def_cfa_offset 8
.cfi_rel_offset r0, 0
.cfi_rel_offset lr, 4
mov lr, r2
mov r0, r1
ands r3, r1, #7
beq .L_mainloop
// Align to a double word (64 bits).
rsb r3, r3, #8
lsls ip, r3, #31
beq .L_align_to_32
ldrb r2, [r0], #1
cbz r2, .L_update_count_and_finish
.L_align_to_32:
bcc .L_align_to_64
ands ip, r3, #2
beq .L_align_to_64
ldrb r2, [r0], #1
cbz r2, .L_update_count_and_finish
ldrb r2, [r0], #1
cbz r2, .L_update_count_and_finish
.L_align_to_64:
tst r3, #4
beq .L_mainloop
ldr r3, [r0], #4
sub ip, r3, #0x01010101
bic ip, ip, r3
ands ip, ip, #0x80808080
bne .L_zero_in_second_register
.p2align 2
.L_mainloop:
ldrd r2, r3, [r0], #8
pld [r0, #64]
sub ip, r2, #0x01010101
bic ip, ip, r2
ands ip, ip, #0x80808080
bne .L_zero_in_first_register
sub ip, r3, #0x01010101
bic ip, ip, r3
ands ip, ip, #0x80808080
bne .L_zero_in_second_register
b .L_mainloop
.L_update_count_and_finish:
sub r3, r0, r1
sub r3, r3, #1
b .L_check_size
.L_zero_in_first_register:
sub r3, r0, r1
lsls r2, ip, #17
bne .L_sub8_and_finish
bcs .L_sub7_and_finish
lsls ip, ip, #1
bne .L_sub6_and_finish
sub r3, r3, #5
b .L_check_size
.L_sub8_and_finish:
sub r3, r3, #8
b .L_check_size
.L_sub7_and_finish:
sub r3, r3, #7
b .L_check_size
.L_sub6_and_finish:
sub r3, r3, #6
b .L_check_size
.L_zero_in_second_register:
sub r3, r0, r1
lsls r2, ip, #17
bne .L_sub4_and_finish
bcs .L_sub3_and_finish
lsls ip, ip, #1
bne .L_sub2_and_finish
sub r3, r3, #1
b .L_check_size
.L_sub4_and_finish:
sub r3, r3, #4
b .L_check_size
.L_sub3_and_finish:
sub r3, r3, #3
b .L_check_size
.L_sub2_and_finish:
sub r3, r3, #2
.L_check_size:
pld [r1, #0]
pld [r1, #64]
ldr r0, [sp]
cmp r3, lr
bhs __strcpy_chk_failed
// Add 1 for copy length to get the string terminator.
add r2, r3, #1
END(__strcpy_chk)
#define MEMCPY_BASE __strcpy_chk_memcpy_base
#define MEMCPY_BASE_ALIGNED __strcpy_chk_memcpy_base_aligned
#include "memcpy_base.S"
ENTRY_PRIVATE(__strcpy_chk_failed)
.cfi_def_cfa_offset 8
.cfi_rel_offset r0, 0
.cfi_rel_offset lr, 4
ldr r0, error_message
ldr r1, error_code
1:
add r0, pc
bl __fortify_chk_fail
error_code:
.word BIONIC_EVENT_STRCPY_BUFFER_OVERFLOW
error_message:
.word error_string-(1b+4)
END(__strcpy_chk_failed)
.data
error_string:
.string "strcpy: prevented write past end of buffer"

View File

@ -0,0 +1,173 @@
/*
* Copyright (C) 2013 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 <private/bionic_asm.h>
#include <private/libc_events.h>
.syntax unified
.thumb
.thumb_func
// Get the length of the source string first, then do a memcpy of the data
// instead of a strcpy.
ENTRY(__strcpy_chk)
pld [r0, #0]
push {r0, lr}
.cfi_def_cfa_offset 8
.cfi_rel_offset r0, 0
.cfi_rel_offset lr, 4
mov lr, r2
mov r0, r1
ands r3, r1, #7
beq .L_mainloop
// Align to a double word (64 bits).
rsb r3, r3, #8
lsls ip, r3, #31
beq .L_align_to_32
ldrb r2, [r0], #1
cbz r2, .L_update_count_and_finish
.L_align_to_32:
bcc .L_align_to_64
ands ip, r3, #2
beq .L_align_to_64
ldrb r2, [r0], #1
cbz r2, .L_update_count_and_finish
ldrb r2, [r0], #1
cbz r2, .L_update_count_and_finish
.L_align_to_64:
tst r3, #4
beq .L_mainloop
ldr r3, [r0], #4
sub ip, r3, #0x01010101
bic ip, ip, r3
ands ip, ip, #0x80808080
bne .L_zero_in_second_register
.p2align 2
.L_mainloop:
ldrd r2, r3, [r0], #8
pld [r0, #64]
sub ip, r2, #0x01010101
bic ip, ip, r2
ands ip, ip, #0x80808080
bne .L_zero_in_first_register
sub ip, r3, #0x01010101
bic ip, ip, r3
ands ip, ip, #0x80808080
bne .L_zero_in_second_register
b .L_mainloop
.L_update_count_and_finish:
sub r3, r0, r1
sub r3, r3, #1
b .L_check_size
.L_zero_in_first_register:
sub r3, r0, r1
lsls r2, ip, #17
bne .L_sub8_and_finish
bcs .L_sub7_and_finish
lsls ip, ip, #1
bne .L_sub6_and_finish
sub r3, r3, #5
b .L_check_size
.L_sub8_and_finish:
sub r3, r3, #8
b .L_check_size
.L_sub7_and_finish:
sub r3, r3, #7
b .L_check_size
.L_sub6_and_finish:
sub r3, r3, #6
b .L_check_size
.L_zero_in_second_register:
sub r3, r0, r1
lsls r2, ip, #17
bne .L_sub4_and_finish
bcs .L_sub3_and_finish
lsls ip, ip, #1
bne .L_sub2_and_finish
sub r3, r3, #1
b .L_check_size
.L_sub4_and_finish:
sub r3, r3, #4
b .L_check_size
.L_sub3_and_finish:
sub r3, r3, #3
b .L_check_size
.L_sub2_and_finish:
sub r3, r3, #2
.L_check_size:
pld [r1, #0]
pld [r1, #64]
ldr r0, [sp]
cmp r3, lr
bhs .L_strcpy_chk_failed
// Add 1 for copy length to get the string terminator.
add r2, r3, #1
#include MEMCPY_BASE
.L_strcpy_chk_failed:
ldr r0, error_message
ldr r1, error_code
1:
add r0, pc
bl __fortify_chk_fail
error_code:
.word BIONIC_EVENT_STRCPY_BUFFER_OVERFLOW
error_message:
.word error_string-(1b+4)
END(__strcpy_chk)
.data
error_string:
.string "strcpy: prevented write past end of buffer"

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2008 The Android Open Source Project * Copyright (C) 2015 The Android Open Source Project
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -25,79 +25,8 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
*/ */
/*
* Copyright (c) 2013 ARM Ltd
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. 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.
* 3. The name of the company may not be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY ARM LTD ``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 ARM LTD 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.
*/
// Prototype: void *memcpy (void *dst, const void *src, size_t count). // Indicate which memcpy base file to include.
#define MEMCPY_BASE "memcpy_base.S"
#include <private/bionic_asm.h> #include "memcpy_common.S"
#include <private/libc_events.h>
.text
.syntax unified
.fpu neon
ENTRY(__memcpy_chk)
cmp r2, r3
bhi __memcpy_chk_fail
// Fall through to memcpy...
END(__memcpy_chk)
ENTRY(memcpy)
pld [r1, #64]
push {r0, lr}
.cfi_def_cfa_offset 8
.cfi_rel_offset r0, 0
.cfi_rel_offset lr, 4
END(memcpy)
#define MEMCPY_BASE __memcpy_base
#define MEMCPY_BASE_ALIGNED __memcpy_base_aligned
#include "memcpy_base.S"
ENTRY_PRIVATE(__memcpy_chk_fail)
// Preserve lr for backtrace.
push {lr}
.cfi_def_cfa_offset 4
.cfi_rel_offset lr, 0
ldr r0, error_message
ldr r1, error_code
1:
add r0, pc
bl __fortify_chk_fail
error_code:
.word BIONIC_EVENT_MEMCPY_BUFFER_OVERFLOW
error_message:
.word error_string-(1b+8)
END(__memcpy_chk_fail)
.data
error_string:
.string "memcpy: prevented write past end of buffer"

View File

@ -53,11 +53,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
ENTRY_PRIVATE(MEMCPY_BASE) .L_memcpy_base:
.cfi_def_cfa_offset 8
.cfi_rel_offset r0, 0
.cfi_rel_offset lr, 4
// Assumes that n >= 0, and dst, src are valid pointers. // Assumes that n >= 0, and dst, src are valid pointers.
// For any sizes less than 832 use the neon code that doesn't // For any sizes less than 832 use the neon code that doesn't
// care about the src alignment. This avoids any checks // care about the src alignment. This avoids any checks
@ -168,12 +164,6 @@ ENTRY_PRIVATE(MEMCPY_BASE)
eor r3, r0, r1 eor r3, r0, r1
ands r3, r3, #0x3 ands r3, r3, #0x3
bne .L_copy_unknown_alignment bne .L_copy_unknown_alignment
END(MEMCPY_BASE)
ENTRY_PRIVATE(MEMCPY_BASE_ALIGNED)
.cfi_def_cfa_offset 8
.cfi_rel_offset r0, 0
.cfi_rel_offset lr, 4
// To try and improve performance, stack layout changed, // To try and improve performance, stack layout changed,
// i.e., not keeping the stack looking like users expect // i.e., not keeping the stack looking like users expect
@ -185,7 +175,7 @@ ENTRY_PRIVATE(MEMCPY_BASE_ALIGNED)
strd r6, r7, [sp, #-8]! strd r6, r7, [sp, #-8]!
.cfi_adjust_cfa_offset 8 .cfi_adjust_cfa_offset 8
.cfi_rel_offset r6, 0 .cfi_rel_offset r6, 0
.cfi_rel_offset r7, 0 .cfi_rel_offset r7, 4
strd r8, r9, [sp, #-8]! strd r8, r9, [sp, #-8]!
.cfi_adjust_cfa_offset 8 .cfi_adjust_cfa_offset 8
.cfi_rel_offset r8, 0 .cfi_rel_offset r8, 0
@ -291,10 +281,28 @@ ENTRY_PRIVATE(MEMCPY_BASE_ALIGNED)
// Restore registers: optimized pop {r0, pc} // Restore registers: optimized pop {r0, pc}
ldrd r8, r9, [sp], #8 ldrd r8, r9, [sp], #8
.cfi_adjust_cfa_offset -8
.cfi_restore r8
.cfi_restore r9
ldrd r6, r7, [sp], #8 ldrd r6, r7, [sp], #8
.cfi_adjust_cfa_offset -8
.cfi_restore r6
.cfi_restore r7
ldrd r4, r5, [sp], #8 ldrd r4, r5, [sp], #8
.cfi_adjust_cfa_offset -8
.cfi_restore r4
.cfi_restore r5
pop {r0, pc} pop {r0, pc}
// Put the cfi directives back for the below instructions.
.cfi_adjust_cfa_offset 24
.cfi_rel_offset r4, 0
.cfi_rel_offset r5, 4
.cfi_rel_offset r6, 8
.cfi_rel_offset r7, 12
.cfi_rel_offset r8, 16
.cfi_rel_offset r9, 20
.L_dst_not_word_aligned: .L_dst_not_word_aligned:
// Align dst to word. // Align dst to word.
rsb ip, ip, #4 rsb ip, ip, #4
@ -315,4 +323,12 @@ ENTRY_PRIVATE(MEMCPY_BASE_ALIGNED)
// Src is guaranteed to be at least word aligned by this point. // Src is guaranteed to be at least word aligned by this point.
b .L_word_aligned b .L_word_aligned
END(MEMCPY_BASE_ALIGNED)
// Undo any cfi directives from above.
.cfi_adjust_cfa_offset -24
.cfi_restore r4
.cfi_restore r5
.cfi_restore r6
.cfi_restore r7
.cfi_restore r8
.cfi_restore r9

View File

@ -0,0 +1,103 @@
/*
* 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.
*/
/*
* Copyright (c) 2013 ARM Ltd
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. 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.
* 3. The name of the company may not be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY ARM LTD ``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 ARM LTD 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 <private/bionic_asm.h>
#include <private/libc_events.h>
.text
.syntax unified
.fpu neon
ENTRY(__memcpy_chk)
cmp r2, r3
bhi .L_memcpy_chk_fail
// Fall through to memcpy...
END(__memcpy_chk)
// Prototype: void *memcpy (void *dst, const void *src, size_t count).
ENTRY(memcpy)
pld [r1, #64]
push {r0, lr}
.cfi_def_cfa_offset 8
.cfi_rel_offset r0, 0
.cfi_rel_offset lr, 4
#include MEMCPY_BASE
// Undo the cfi instructions from above.
.cfi_def_cfa_offset 0
.cfi_restore r0
.cfi_restore lr
.L_memcpy_chk_fail:
// Preserve lr for backtrace.
push {lr}
.cfi_adjust_cfa_offset 4
.cfi_rel_offset lr, 0
ldr r0, error_message
ldr r1, error_code
1:
add r0, pc
bl __fortify_chk_fail
error_code:
.word BIONIC_EVENT_MEMCPY_BUFFER_OVERFLOW
error_message:
.word error_string-(1b+8)
END(memcpy)
.data
error_string:
.string "memcpy: prevented write past end of buffer"

View File

@ -70,7 +70,7 @@
.macro m_scan_byte .macro m_scan_byte
ldrb r3, [r0] ldrb r3, [r0]
cbz r3, strcat_r0_scan_done cbz r3, .L_strcat_r0_scan_done
add r0, #1 add r0, #1
.endm // m_scan_byte .endm // m_scan_byte
@ -84,10 +84,10 @@ ENTRY(strcat)
// Quick check to see if src is empty. // Quick check to see if src is empty.
ldrb r2, [r1] ldrb r2, [r1]
pld [r1, #0] pld [r1, #0]
cbnz r2, strcat_continue cbnz r2, .L_strcat_continue
bx lr bx lr
strcat_continue: .L_strcat_continue:
// To speed up really small dst strings, unroll checking the first 4 bytes. // To speed up really small dst strings, unroll checking the first 4 bytes.
m_push m_push
m_scan_byte m_scan_byte
@ -96,95 +96,102 @@ strcat_continue:
m_scan_byte m_scan_byte
ands r3, r0, #7 ands r3, r0, #7
beq strcat_mainloop beq .L_strcat_mainloop
// Align to a double word (64 bits). // Align to a double word (64 bits).
rsb r3, r3, #8 rsb r3, r3, #8
lsls ip, r3, #31 lsls ip, r3, #31
beq strcat_align_to_32 beq .L_strcat_align_to_32
ldrb r5, [r0] ldrb r5, [r0]
cbz r5, strcat_r0_scan_done cbz r5, .L_strcat_r0_scan_done
add r0, r0, #1 add r0, r0, #1
strcat_align_to_32: .L_strcat_align_to_32:
bcc strcat_align_to_64 bcc .L_strcat_align_to_64
ldrb r2, [r0] ldrb r2, [r0]
cbz r2, strcat_r0_scan_done cbz r2, .L_strcat_r0_scan_done
add r0, r0, #1 add r0, r0, #1
ldrb r4, [r0] ldrb r4, [r0]
cbz r4, strcat_r0_scan_done cbz r4, .L_strcat_r0_scan_done
add r0, r0, #1 add r0, r0, #1
strcat_align_to_64: .L_strcat_align_to_64:
tst r3, #4 tst r3, #4
beq strcat_mainloop beq .L_strcat_mainloop
ldr r3, [r0], #4 ldr r3, [r0], #4
sub ip, r3, #0x01010101 sub ip, r3, #0x01010101
bic ip, ip, r3 bic ip, ip, r3
ands ip, ip, #0x80808080 ands ip, ip, #0x80808080
bne strcat_zero_in_second_register bne .L_strcat_zero_in_second_register
b strcat_mainloop b .L_strcat_mainloop
strcat_r0_scan_done: .L_strcat_r0_scan_done:
// For short copies, hard-code checking the first 8 bytes since this // For short copies, hard-code checking the first 8 bytes since this
// new code doesn't win until after about 8 bytes. // new code doesn't win until after about 8 bytes.
m_copy_byte reg=r2, cmd=cbz, label=strcpy_finish m_copy_byte reg=r2, cmd=cbz, label=.L_strcpy_finish
m_copy_byte reg=r3, cmd=cbz, label=strcpy_finish m_copy_byte reg=r3, cmd=cbz, label=.L_strcpy_finish
m_copy_byte reg=r4, cmd=cbz, label=strcpy_finish m_copy_byte reg=r4, cmd=cbz, label=.L_strcpy_finish
m_copy_byte reg=r5, cmd=cbz, label=strcpy_finish m_copy_byte reg=r5, cmd=cbz, label=.L_strcpy_finish
m_copy_byte reg=r2, cmd=cbz, label=strcpy_finish m_copy_byte reg=r2, cmd=cbz, label=.L_strcpy_finish
m_copy_byte reg=r3, cmd=cbz, label=strcpy_finish m_copy_byte reg=r3, cmd=cbz, label=.L_strcpy_finish
m_copy_byte reg=r4, cmd=cbz, label=strcpy_finish m_copy_byte reg=r4, cmd=cbz, label=.L_strcpy_finish
m_copy_byte reg=r5, cmd=cbnz, label=strcpy_continue m_copy_byte reg=r5, cmd=cbnz, label=.L_strcpy_continue
strcpy_finish: .L_strcpy_finish:
m_pop m_pop
strcpy_continue: .L_strcpy_continue:
ands r3, r0, #7 ands r3, r0, #7
beq strcpy_check_src_align beq .L_strcpy_check_src_align
// Align to a double word (64 bits). // Align to a double word (64 bits).
rsb r3, r3, #8 rsb r3, r3, #8
lsls ip, r3, #31 lsls ip, r3, #31
beq strcpy_align_to_32 beq .L_strcpy_align_to_32
ldrb r2, [r1], #1 ldrb r2, [r1], #1
strb r2, [r0], #1 strb r2, [r0], #1
cbz r2, strcpy_complete cbz r2, .L_strcpy_complete
strcpy_align_to_32: .L_strcpy_align_to_32:
bcc strcpy_align_to_64 bcc .L_strcpy_align_to_64
ldrb r2, [r1], #1 ldrb r2, [r1], #1
strb r2, [r0], #1 strb r2, [r0], #1
cbz r2, strcpy_complete cbz r2, .L_strcpy_complete
ldrb r2, [r1], #1 ldrb r2, [r1], #1
strb r2, [r0], #1 strb r2, [r0], #1
cbz r2, strcpy_complete cbz r2, .L_strcpy_complete
strcpy_align_to_64: .L_strcpy_align_to_64:
tst r3, #4 tst r3, #4
beq strcpy_check_src_align beq .L_strcpy_check_src_align
ldr r2, [r1], #4 // Read one byte at a time since we don't know the src alignment
// and we don't want to read into a different page.
ldrb r2, [r1], #1
strb r2, [r0], #1
cbz r2, .L_strcpy_complete
ldrb r2, [r1], #1
strb r2, [r0], #1
cbz r2, .L_strcpy_complete
ldrb r2, [r1], #1
strb r2, [r0], #1
cbz r2, .L_strcpy_complete
ldrb r2, [r1], #1
strb r2, [r0], #1
cbz r2, .L_strcpy_complete
sub ip, r2, #0x01010101 .L_strcpy_check_src_align:
bic ip, ip, r2
ands ip, ip, #0x80808080
bne strcpy_zero_in_first_register
str r2, [r0], #4
strcpy_check_src_align:
// At this point dst is aligned to a double word, check if src // At this point dst is aligned to a double word, check if src
// is also aligned to a double word. // is also aligned to a double word.
ands r3, r1, #7 ands r3, r1, #7
bne strcpy_unaligned_copy bne .L_strcpy_unaligned_copy
.p2align 2 .p2align 2
strcpy_mainloop: .L_strcpy_mainloop:
ldrd r2, r3, [r1], #8 ldrd r2, r3, [r1], #8
pld [r1, #64] pld [r1, #64]
@ -192,128 +199,128 @@ strcpy_mainloop:
sub ip, r2, #0x01010101 sub ip, r2, #0x01010101
bic ip, ip, r2 bic ip, ip, r2
ands ip, ip, #0x80808080 ands ip, ip, #0x80808080
bne strcpy_zero_in_first_register bne .L_strcpy_zero_in_first_register
sub ip, r3, #0x01010101 sub ip, r3, #0x01010101
bic ip, ip, r3 bic ip, ip, r3
ands ip, ip, #0x80808080 ands ip, ip, #0x80808080
bne strcpy_zero_in_second_register bne .L_strcpy_zero_in_second_register
strd r2, r3, [r0], #8 strd r2, r3, [r0], #8
b strcpy_mainloop b .L_strcpy_mainloop
strcpy_complete: .L_strcpy_complete:
m_pop m_pop
strcpy_zero_in_first_register: .L_strcpy_zero_in_first_register:
lsls lr, ip, #17 lsls lr, ip, #17
bne strcpy_copy1byte bne .L_strcpy_copy1byte
bcs strcpy_copy2bytes bcs .L_strcpy_copy2bytes
lsls ip, ip, #1 lsls ip, ip, #1
bne strcpy_copy3bytes bne .L_strcpy_copy3bytes
strcpy_copy4bytes: .L_strcpy_copy4bytes:
// Copy 4 bytes to the destiniation. // Copy 4 bytes to the destiniation.
str r2, [r0] str r2, [r0]
m_pop m_pop
strcpy_copy1byte: .L_strcpy_copy1byte:
strb r2, [r0] strb r2, [r0]
m_pop m_pop
strcpy_copy2bytes: .L_strcpy_copy2bytes:
strh r2, [r0] strh r2, [r0]
m_pop m_pop
strcpy_copy3bytes: .L_strcpy_copy3bytes:
strh r2, [r0], #2 strh r2, [r0], #2
lsr r2, #16 lsr r2, #16
strb r2, [r0] strb r2, [r0]
m_pop m_pop
strcpy_zero_in_second_register: .L_strcpy_zero_in_second_register:
lsls lr, ip, #17 lsls lr, ip, #17
bne strcpy_copy5bytes bne .L_strcpy_copy5bytes
bcs strcpy_copy6bytes bcs .L_strcpy_copy6bytes
lsls ip, ip, #1 lsls ip, ip, #1
bne strcpy_copy7bytes bne .L_strcpy_copy7bytes
// Copy 8 bytes to the destination. // Copy 8 bytes to the destination.
strd r2, r3, [r0] strd r2, r3, [r0]
m_pop m_pop
strcpy_copy5bytes: .L_strcpy_copy5bytes:
str r2, [r0], #4 str r2, [r0], #4
strb r3, [r0] strb r3, [r0]
m_pop m_pop
strcpy_copy6bytes: .L_strcpy_copy6bytes:
str r2, [r0], #4 str r2, [r0], #4
strh r3, [r0] strh r3, [r0]
m_pop m_pop
strcpy_copy7bytes: .L_strcpy_copy7bytes:
str r2, [r0], #4 str r2, [r0], #4
strh r3, [r0], #2 strh r3, [r0], #2
lsr r3, #16 lsr r3, #16
strb r3, [r0] strb r3, [r0]
m_pop m_pop
strcpy_unaligned_copy: .L_strcpy_unaligned_copy:
// Dst is aligned to a double word, while src is at an unknown alignment. // Dst is aligned to a double word, while src is at an unknown alignment.
// There are 7 different versions of the unaligned copy code // There are 7 different versions of the unaligned copy code
// to prevent overreading the src. The mainloop of every single version // to prevent overreading the src. The mainloop of every single version
// will store 64 bits per loop. The difference is how much of src can // will store 64 bits per loop. The difference is how much of src can
// be read without potentially crossing a page boundary. // be read without potentially crossing a page boundary.
tbb [pc, r3] tbb [pc, r3]
strcpy_unaligned_branchtable: .L_strcpy_unaligned_branchtable:
.byte 0 .byte 0
.byte ((strcpy_unalign7 - strcpy_unaligned_branchtable)/2) .byte ((.L_strcpy_unalign7 - .L_strcpy_unaligned_branchtable)/2)
.byte ((strcpy_unalign6 - strcpy_unaligned_branchtable)/2) .byte ((.L_strcpy_unalign6 - .L_strcpy_unaligned_branchtable)/2)
.byte ((strcpy_unalign5 - strcpy_unaligned_branchtable)/2) .byte ((.L_strcpy_unalign5 - .L_strcpy_unaligned_branchtable)/2)
.byte ((strcpy_unalign4 - strcpy_unaligned_branchtable)/2) .byte ((.L_strcpy_unalign4 - .L_strcpy_unaligned_branchtable)/2)
.byte ((strcpy_unalign3 - strcpy_unaligned_branchtable)/2) .byte ((.L_strcpy_unalign3 - .L_strcpy_unaligned_branchtable)/2)
.byte ((strcpy_unalign2 - strcpy_unaligned_branchtable)/2) .byte ((.L_strcpy_unalign2 - .L_strcpy_unaligned_branchtable)/2)
.byte ((strcpy_unalign1 - strcpy_unaligned_branchtable)/2) .byte ((.L_strcpy_unalign1 - .L_strcpy_unaligned_branchtable)/2)
.p2align 2 .p2align 2
// Can read 7 bytes before possibly crossing a page. // Can read 7 bytes before possibly crossing a page.
strcpy_unalign7: .L_strcpy_unalign7:
ldr r2, [r1], #4 ldr r2, [r1], #4
sub ip, r2, #0x01010101 sub ip, r2, #0x01010101
bic ip, ip, r2 bic ip, ip, r2
ands ip, ip, #0x80808080 ands ip, ip, #0x80808080
bne strcpy_zero_in_first_register bne .L_strcpy_zero_in_first_register
ldrb r3, [r1] ldrb r3, [r1]
cbz r3, strcpy_unalign7_copy5bytes cbz r3, .L_strcpy_unalign7_copy5bytes
ldrb r4, [r1, #1] ldrb r4, [r1, #1]
cbz r4, strcpy_unalign7_copy6bytes cbz r4, .L_strcpy_unalign7_copy6bytes
ldrb r5, [r1, #2] ldrb r5, [r1, #2]
cbz r5, strcpy_unalign7_copy7bytes cbz r5, .L_strcpy_unalign7_copy7bytes
ldr r3, [r1], #4 ldr r3, [r1], #4
pld [r1, #64] pld [r1, #64]
lsrs ip, r3, #24 lsrs ip, r3, #24
strd r2, r3, [r0], #8 strd r2, r3, [r0], #8
beq strcpy_unalign_return beq .L_strcpy_unalign_return
b strcpy_unalign7 b .L_strcpy_unalign7
strcpy_unalign7_copy5bytes: .L_strcpy_unalign7_copy5bytes:
str r2, [r0], #4 str r2, [r0], #4
strb r3, [r0] strb r3, [r0]
strcpy_unalign_return: .L_strcpy_unalign_return:
m_pop m_pop
strcpy_unalign7_copy6bytes: .L_strcpy_unalign7_copy6bytes:
str r2, [r0], #4 str r2, [r0], #4
strb r3, [r0], #1 strb r3, [r0], #1
strb r4, [r0], #1 strb r4, [r0], #1
m_pop m_pop
strcpy_unalign7_copy7bytes: .L_strcpy_unalign7_copy7bytes:
str r2, [r0], #4 str r2, [r0], #4
strb r3, [r0], #1 strb r3, [r0], #1
strb r4, [r0], #1 strb r4, [r0], #1
@ -322,41 +329,41 @@ strcpy_unalign7_copy7bytes:
.p2align 2 .p2align 2
// Can read 6 bytes before possibly crossing a page. // Can read 6 bytes before possibly crossing a page.
strcpy_unalign6: .L_strcpy_unalign6:
ldr r2, [r1], #4 ldr r2, [r1], #4
sub ip, r2, #0x01010101 sub ip, r2, #0x01010101
bic ip, ip, r2 bic ip, ip, r2
ands ip, ip, #0x80808080 ands ip, ip, #0x80808080
bne strcpy_zero_in_first_register bne .L_strcpy_zero_in_first_register
ldrb r4, [r1] ldrb r4, [r1]
cbz r4, strcpy_unalign_copy5bytes cbz r4, .L_strcpy_unalign_copy5bytes
ldrb r5, [r1, #1] ldrb r5, [r1, #1]
cbz r5, strcpy_unalign_copy6bytes cbz r5, .L_strcpy_unalign_copy6bytes
ldr r3, [r1], #4 ldr r3, [r1], #4
pld [r1, #64] pld [r1, #64]
tst r3, #0xff0000 tst r3, #0xff0000
beq strcpy_copy7bytes beq .L_strcpy_copy7bytes
lsrs ip, r3, #24 lsrs ip, r3, #24
strd r2, r3, [r0], #8 strd r2, r3, [r0], #8
beq strcpy_unalign_return beq .L_strcpy_unalign_return
b strcpy_unalign6 b .L_strcpy_unalign6
.p2align 2 .p2align 2
// Can read 5 bytes before possibly crossing a page. // Can read 5 bytes before possibly crossing a page.
strcpy_unalign5: .L_strcpy_unalign5:
ldr r2, [r1], #4 ldr r2, [r1], #4
sub ip, r2, #0x01010101 sub ip, r2, #0x01010101
bic ip, ip, r2 bic ip, ip, r2
ands ip, ip, #0x80808080 ands ip, ip, #0x80808080
bne strcpy_zero_in_first_register bne .L_strcpy_zero_in_first_register
ldrb r4, [r1] ldrb r4, [r1]
cbz r4, strcpy_unalign_copy5bytes cbz r4, .L_strcpy_unalign_copy5bytes
ldr r3, [r1], #4 ldr r3, [r1], #4
@ -365,17 +372,17 @@ strcpy_unalign5:
sub ip, r3, #0x01010101 sub ip, r3, #0x01010101
bic ip, ip, r3 bic ip, ip, r3
ands ip, ip, #0x80808080 ands ip, ip, #0x80808080
bne strcpy_zero_in_second_register bne .L_strcpy_zero_in_second_register
strd r2, r3, [r0], #8 strd r2, r3, [r0], #8
b strcpy_unalign5 b .L_strcpy_unalign5
strcpy_unalign_copy5bytes: .L_strcpy_unalign_copy5bytes:
str r2, [r0], #4 str r2, [r0], #4
strb r4, [r0] strb r4, [r0]
m_pop m_pop
strcpy_unalign_copy6bytes: .L_strcpy_unalign_copy6bytes:
str r2, [r0], #4 str r2, [r0], #4
strb r4, [r0], #1 strb r4, [r0], #1
strb r5, [r0] strb r5, [r0]
@ -383,13 +390,13 @@ strcpy_unalign_copy6bytes:
.p2align 2 .p2align 2
// Can read 4 bytes before possibly crossing a page. // Can read 4 bytes before possibly crossing a page.
strcpy_unalign4: .L_strcpy_unalign4:
ldr r2, [r1], #4 ldr r2, [r1], #4
sub ip, r2, #0x01010101 sub ip, r2, #0x01010101
bic ip, ip, r2 bic ip, ip, r2
ands ip, ip, #0x80808080 ands ip, ip, #0x80808080
bne strcpy_zero_in_first_register bne .L_strcpy_zero_in_first_register
ldr r3, [r1], #4 ldr r3, [r1], #4
pld [r1, #64] pld [r1, #64]
@ -397,20 +404,20 @@ strcpy_unalign4:
sub ip, r3, #0x01010101 sub ip, r3, #0x01010101
bic ip, ip, r3 bic ip, ip, r3
ands ip, ip, #0x80808080 ands ip, ip, #0x80808080
bne strcpy_zero_in_second_register bne .L_strcpy_zero_in_second_register
strd r2, r3, [r0], #8 strd r2, r3, [r0], #8
b strcpy_unalign4 b .L_strcpy_unalign4
.p2align 2 .p2align 2
// Can read 3 bytes before possibly crossing a page. // Can read 3 bytes before possibly crossing a page.
strcpy_unalign3: .L_strcpy_unalign3:
ldrb r2, [r1] ldrb r2, [r1]
cbz r2, strcpy_unalign3_copy1byte cbz r2, .L_strcpy_unalign3_copy1byte
ldrb r3, [r1, #1] ldrb r3, [r1, #1]
cbz r3, strcpy_unalign3_copy2bytes cbz r3, .L_strcpy_unalign3_copy2bytes
ldrb r4, [r1, #2] ldrb r4, [r1, #2]
cbz r4, strcpy_unalign3_copy3bytes cbz r4, .L_strcpy_unalign3_copy3bytes
ldr r2, [r1], #4 ldr r2, [r1], #4
ldr r3, [r1], #4 ldr r3, [r1], #4
@ -418,26 +425,26 @@ strcpy_unalign3:
pld [r1, #64] pld [r1, #64]
lsrs lr, r2, #24 lsrs lr, r2, #24
beq strcpy_copy4bytes beq .L_strcpy_copy4bytes
sub ip, r3, #0x01010101 sub ip, r3, #0x01010101
bic ip, ip, r3 bic ip, ip, r3
ands ip, ip, #0x80808080 ands ip, ip, #0x80808080
bne strcpy_zero_in_second_register bne .L_strcpy_zero_in_second_register
strd r2, r3, [r0], #8 strd r2, r3, [r0], #8
b strcpy_unalign3 b .L_strcpy_unalign3
strcpy_unalign3_copy1byte: .L_strcpy_unalign3_copy1byte:
strb r2, [r0] strb r2, [r0]
m_pop m_pop
strcpy_unalign3_copy2bytes: .L_strcpy_unalign3_copy2bytes:
strb r2, [r0], #1 strb r2, [r0], #1
strb r3, [r0] strb r3, [r0]
m_pop m_pop
strcpy_unalign3_copy3bytes: .L_strcpy_unalign3_copy3bytes:
strb r2, [r0], #1 strb r2, [r0], #1
strb r3, [r0], #1 strb r3, [r0], #1
strb r4, [r0] strb r4, [r0]
@ -445,34 +452,34 @@ strcpy_unalign3_copy3bytes:
.p2align 2 .p2align 2
// Can read 2 bytes before possibly crossing a page. // Can read 2 bytes before possibly crossing a page.
strcpy_unalign2: .L_strcpy_unalign2:
ldrb r2, [r1] ldrb r2, [r1]
cbz r2, strcpy_unalign_copy1byte cbz r2, .L_strcpy_unalign_copy1byte
ldrb r4, [r1, #1] ldrb r4, [r1, #1]
cbz r4, strcpy_unalign_copy2bytes cbz r4, .L_strcpy_unalign_copy2bytes
ldr r2, [r1], #4 ldr r2, [r1], #4
ldr r3, [r1], #4 ldr r3, [r1], #4
pld [r1, #64] pld [r1, #64]
tst r2, #0xff0000 tst r2, #0xff0000
beq strcpy_copy3bytes beq .L_strcpy_copy3bytes
lsrs ip, r2, #24 lsrs ip, r2, #24
beq strcpy_copy4bytes beq .L_strcpy_copy4bytes
sub ip, r3, #0x01010101 sub ip, r3, #0x01010101
bic ip, ip, r3 bic ip, ip, r3
ands ip, ip, #0x80808080 ands ip, ip, #0x80808080
bne strcpy_zero_in_second_register bne .L_strcpy_zero_in_second_register
strd r2, r3, [r0], #8 strd r2, r3, [r0], #8
b strcpy_unalign2 b .L_strcpy_unalign2
.p2align 2 .p2align 2
// Can read 1 byte before possibly crossing a page. // Can read 1 byte before possibly crossing a page.
strcpy_unalign1: .L_strcpy_unalign1:
ldrb r2, [r1] ldrb r2, [r1]
cbz r2, strcpy_unalign_copy1byte cbz r2, .L_strcpy_unalign_copy1byte
ldr r2, [r1], #4 ldr r2, [r1], #4
ldr r3, [r1], #4 ldr r3, [r1], #4
@ -482,27 +489,27 @@ strcpy_unalign1:
sub ip, r2, #0x01010101 sub ip, r2, #0x01010101
bic ip, ip, r2 bic ip, ip, r2
ands ip, ip, #0x80808080 ands ip, ip, #0x80808080
bne strcpy_zero_in_first_register bne .L_strcpy_zero_in_first_register
sub ip, r3, #0x01010101 sub ip, r3, #0x01010101
bic ip, ip, r3 bic ip, ip, r3
ands ip, ip, #0x80808080 ands ip, ip, #0x80808080
bne strcpy_zero_in_second_register bne .L_strcpy_zero_in_second_register
strd r2, r3, [r0], #8 strd r2, r3, [r0], #8
b strcpy_unalign1 b .L_strcpy_unalign1
strcpy_unalign_copy1byte: .L_strcpy_unalign_copy1byte:
strb r2, [r0] strb r2, [r0]
m_pop m_pop
strcpy_unalign_copy2bytes: .L_strcpy_unalign_copy2bytes:
strb r2, [r0], #1 strb r2, [r0], #1
strb r4, [r0] strb r4, [r0]
m_pop m_pop
.p2align 2 .p2align 2
strcat_mainloop: .L_strcat_mainloop:
ldrd r2, r3, [r0], #8 ldrd r2, r3, [r0], #8
pld [r0, #64] pld [r0, #64]
@ -510,59 +517,59 @@ strcat_mainloop:
sub ip, r2, #0x01010101 sub ip, r2, #0x01010101
bic ip, ip, r2 bic ip, ip, r2
ands ip, ip, #0x80808080 ands ip, ip, #0x80808080
bne strcat_zero_in_first_register bne .L_strcat_zero_in_first_register
sub ip, r3, #0x01010101 sub ip, r3, #0x01010101
bic ip, ip, r3 bic ip, ip, r3
ands ip, ip, #0x80808080 ands ip, ip, #0x80808080
bne strcat_zero_in_second_register bne .L_strcat_zero_in_second_register
b strcat_mainloop b .L_strcat_mainloop
strcat_zero_in_first_register: .L_strcat_zero_in_first_register:
// Prefetch the src now, it's going to be used soon. // Prefetch the src now, it's going to be used soon.
pld [r1, #0] pld [r1, #0]
lsls lr, ip, #17 lsls lr, ip, #17
bne strcat_sub8 bne .L_strcat_sub8
bcs strcat_sub7 bcs .L_strcat_sub7
lsls ip, ip, #1 lsls ip, ip, #1
bne strcat_sub6 bne .L_strcat_sub6
sub r0, r0, #5 sub r0, r0, #5
b strcat_r0_scan_done b .L_strcat_r0_scan_done
strcat_sub8: .L_strcat_sub8:
sub r0, r0, #8 sub r0, r0, #8
b strcat_r0_scan_done b .L_strcat_r0_scan_done
strcat_sub7: .L_strcat_sub7:
sub r0, r0, #7 sub r0, r0, #7
b strcat_r0_scan_done b .L_strcat_r0_scan_done
strcat_sub6: .L_strcat_sub6:
sub r0, r0, #6 sub r0, r0, #6
b strcat_r0_scan_done b .L_strcat_r0_scan_done
strcat_zero_in_second_register: .L_strcat_zero_in_second_register:
// Prefetch the src now, it's going to be used soon. // Prefetch the src now, it's going to be used soon.
pld [r1, #0] pld [r1, #0]
lsls lr, ip, #17 lsls lr, ip, #17
bne strcat_sub4 bne .L_strcat_sub4
bcs strcat_sub3 bcs .L_strcat_sub3
lsls ip, ip, #1 lsls ip, ip, #1
bne strcat_sub2 bne .L_strcat_sub2
sub r0, r0, #1 sub r0, r0, #1
b strcat_r0_scan_done b .L_strcat_r0_scan_done
strcat_sub4: .L_strcat_sub4:
sub r0, r0, #4 sub r0, r0, #4
b strcat_r0_scan_done b .L_strcat_r0_scan_done
strcat_sub3: .L_strcat_sub3:
sub r0, r0, #3 sub r0, r0, #3
b strcat_r0_scan_done b .L_strcat_r0_scan_done
strcat_sub2: .L_strcat_sub2:
sub r0, r0, #2 sub r0, r0, #2
b strcat_r0_scan_done b .L_strcat_r0_scan_done
END(strcat) END(strcat)

View File

@ -149,13 +149,20 @@ ENTRY(strcpy)
.Lstringcopy_align_to_64: .Lstringcopy_align_to_64:
tst r3, #4 tst r3, #4
beq .Lstringcopy_check_src_align beq .Lstringcopy_check_src_align
ldr r2, [r1], #4 // Read one byte at a time since we don't have any idea about the alignment
// of the source and we don't want to read into a different page.
sub ip, r2, #0x01010101 ldrb r2, [r1], #1
bic ip, ip, r2 strb r2, [r0], #1
ands ip, ip, #0x80808080 cbz r2, .Lstringcopy_complete
bne .Lstringcopy_zero_in_first_register ldrb r2, [r1], #1
str r2, [r0], #4 strb r2, [r0], #1
cbz r2, .Lstringcopy_complete
ldrb r2, [r1], #1
strb r2, [r0], #1
cbz r2, .Lstringcopy_complete
ldrb r2, [r1], #1
strb r2, [r0], #1
cbz r2, .Lstringcopy_complete
.Lstringcopy_check_src_align: .Lstringcopy_check_src_align:
// At this point dst is aligned to a double word, check if src // At this point dst is aligned to a double word, check if src

View File

@ -65,38 +65,38 @@ ENTRY(strlen)
mov r1, r0 mov r1, r0
ands r3, r0, #7 ands r3, r0, #7
beq mainloop beq .L_mainloop
// Align to a double word (64 bits). // Align to a double word (64 bits).
rsb r3, r3, #8 rsb r3, r3, #8
lsls ip, r3, #31 lsls ip, r3, #31
beq align_to_32 beq .L_align_to_32
ldrb r2, [r1], #1 ldrb r2, [r1], #1
cbz r2, update_count_and_return cbz r2, .L_update_count_and_return
align_to_32: .L_align_to_32:
bcc align_to_64 bcc .L_align_to_64
ands ip, r3, #2 ands ip, r3, #2
beq align_to_64 beq .L_align_to_64
ldrb r2, [r1], #1 ldrb r2, [r1], #1
cbz r2, update_count_and_return cbz r2, .L_update_count_and_return
ldrb r2, [r1], #1 ldrb r2, [r1], #1
cbz r2, update_count_and_return cbz r2, .L_update_count_and_return
align_to_64: .L_align_to_64:
tst r3, #4 tst r3, #4
beq mainloop beq .L_mainloop
ldr r3, [r1], #4 ldr r3, [r1], #4
sub ip, r3, #0x01010101 sub ip, r3, #0x01010101
bic ip, ip, r3 bic ip, ip, r3
ands ip, ip, #0x80808080 ands ip, ip, #0x80808080
bne zero_in_second_register bne .L_zero_in_second_register
.p2align 2 .p2align 2
mainloop: .L_mainloop:
ldrd r2, r3, [r1], #8 ldrd r2, r3, [r1], #8
pld [r1, #64] pld [r1, #64]
@ -104,62 +104,62 @@ mainloop:
sub ip, r2, #0x01010101 sub ip, r2, #0x01010101
bic ip, ip, r2 bic ip, ip, r2
ands ip, ip, #0x80808080 ands ip, ip, #0x80808080
bne zero_in_first_register bne .L_zero_in_first_register
sub ip, r3, #0x01010101 sub ip, r3, #0x01010101
bic ip, ip, r3 bic ip, ip, r3
ands ip, ip, #0x80808080 ands ip, ip, #0x80808080
bne zero_in_second_register bne .L_zero_in_second_register
b mainloop b .L_mainloop
update_count_and_return: .L_update_count_and_return:
sub r0, r1, r0 sub r0, r1, r0
sub r0, r0, #1 sub r0, r0, #1
bx lr bx lr
zero_in_first_register: .L_zero_in_first_register:
sub r0, r1, r0 sub r0, r1, r0
lsls r3, ip, #17 lsls r3, ip, #17
bne sub8_and_return bne .L_sub8_and_return
bcs sub7_and_return bcs .L_sub7_and_return
lsls ip, ip, #1 lsls ip, ip, #1
bne sub6_and_return bne .L_sub6_and_return
sub r0, r0, #5 sub r0, r0, #5
bx lr bx lr
sub8_and_return: .L_sub8_and_return:
sub r0, r0, #8 sub r0, r0, #8
bx lr bx lr
sub7_and_return: .L_sub7_and_return:
sub r0, r0, #7 sub r0, r0, #7
bx lr bx lr
sub6_and_return: .L_sub6_and_return:
sub r0, r0, #6 sub r0, r0, #6
bx lr bx lr
zero_in_second_register: .L_zero_in_second_register:
sub r0, r1, r0 sub r0, r1, r0
lsls r3, ip, #17 lsls r3, ip, #17
bne sub4_and_return bne .L_sub4_and_return
bcs sub3_and_return bcs .L_sub3_and_return
lsls ip, ip, #1 lsls ip, ip, #1
bne sub2_and_return bne .L_sub2_and_return
sub r0, r0, #1 sub r0, r0, #1
bx lr bx lr
sub4_and_return: .L_sub4_and_return:
sub r0, r0, #4 sub r0, r0, #4
bx lr bx lr
sub3_and_return: .L_sub3_and_return:
sub r0, r0, #3 sub r0, r0, #3
bx lr bx lr
sub2_and_return: .L_sub2_and_return:
sub r0, r0, #2 sub r0, r0, #2
bx lr bx lr
END(strlen) END(strlen)

View File

@ -1,3 +1,17 @@
libc_openbsd_src_files_exclude_arm += \
upstream-openbsd/lib/libc/string/memmove.c \
upstream-openbsd/lib/libc/string/stpcpy.c \
upstream-openbsd/lib/libc/string/strcat.c \
libc_bionic_src_files_exclude_arm += \
arch-arm/generic/bionic/memcpy.S \
arch-arm/generic/bionic/memset.S \
arch-arm/generic/bionic/strcmp.S \
arch-arm/generic/bionic/strcpy.S \
arch-arm/generic/bionic/strlen.c \
bionic/__strcat_chk.cpp \
bionic/__strcpy_chk.cpp \
libc_bionic_src_files_arm += \ libc_bionic_src_files_arm += \
arch-arm/cortex-a15/bionic/memcpy.S \ arch-arm/cortex-a15/bionic/memcpy.S \
arch-arm/cortex-a15/bionic/memset.S \ arch-arm/cortex-a15/bionic/memset.S \
@ -9,8 +23,5 @@ libc_bionic_src_files_arm += \
arch-arm/cortex-a15/bionic/__strcpy_chk.S \ arch-arm/cortex-a15/bionic/__strcpy_chk.S \
arch-arm/cortex-a15/bionic/strlen.S \ arch-arm/cortex-a15/bionic/strlen.S \
libc_bionic_src_files_arm += \
arch-arm/generic/bionic/memcmp.S \
libc_bionic_src_files_arm += \ libc_bionic_src_files_arm += \
arch-arm/denver/bionic/memmove.S \ arch-arm/denver/bionic/memmove.S \

View File

@ -0,0 +1,32 @@
# This file represents the best optimized routines that are the middle
# ground when running on a big/little system that is cortex-a57/cortex-a53.
# The cortex-a7 optimized routines, and the cortex-a53 optimized routines
# decrease performance on cortex-a57 processors by as much as 20%.
libc_openbsd_src_files_exclude_arm += \
upstream-openbsd/lib/libc/string/memmove.c \
upstream-openbsd/lib/libc/string/stpcpy.c \
upstream-openbsd/lib/libc/string/strcat.c \
libc_bionic_src_files_exclude_arm += \
arch-arm/generic/bionic/memcpy.S \
arch-arm/generic/bionic/memset.S \
arch-arm/generic/bionic/strcmp.S \
arch-arm/generic/bionic/strcpy.S \
arch-arm/generic/bionic/strlen.c \
bionic/__strcat_chk.cpp \
bionic/__strcpy_chk.cpp \
libc_bionic_src_files_arm += \
arch-arm/cortex-a15/bionic/memcpy.S \
arch-arm/cortex-a15/bionic/memset.S \
arch-arm/cortex-a15/bionic/stpcpy.S \
arch-arm/cortex-a15/bionic/strcat.S \
arch-arm/cortex-a15/bionic/__strcat_chk.S \
arch-arm/cortex-a15/bionic/strcmp.S \
arch-arm/cortex-a15/bionic/strcpy.S \
arch-arm/cortex-a15/bionic/__strcpy_chk.S \
arch-arm/cortex-a15/bionic/strlen.S \
libc_bionic_src_files_arm += \
arch-arm/denver/bionic/memmove.S \

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. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -25,17 +25,8 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
*/ */
#ifndef _BIONIC_TIME_H
#define _BIONIC_TIME_H
#include <time.h> // Indicate which memcpy base file to include.
#include <sys/cdefs.h> #define MEMCPY_BASE "arch-arm/cortex-a53/bionic/memcpy_base.S"
__BEGIN_DECLS #include "arch-arm/cortex-a15/bionic/__strcat_chk_common.S"
// We can't remove this (and this file) until we fix MtpUtils.cpp.
time_t mktime_tz(struct tm* const, char const*);
__END_DECLS
#endif /* _BIONIC_TIME_H */

View File

@ -0,0 +1,32 @@
/*
* 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.
*/
// Indicate which memcpy base file to include.
#define MEMCPY_BASE "arch-arm/cortex-a53/bionic/memcpy_base.S"
#include "arch-arm/cortex-a15/bionic/__strcpy_chk_common.S"

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2014 The Android Open Source Project * Copyright (C) 2015 The Android Open Source Project
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -26,9 +26,7 @@
* SUCH DAMAGE. * SUCH DAMAGE.
*/ */
#ifndef _SYS_SHM_H_ // Indicate which memcpy base file to include.
#define _SYS_SHM_H_ #define MEMCPY_BASE "arch-arm/cortex-a53/bionic/memcpy_base.S"
#include <linux/shm.h> #include "arch-arm/cortex-a15/bionic/memcpy_common.S"
#endif /* _SYS_SHM_H_ */

View File

@ -0,0 +1,143 @@
/*
* 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.
*/
/*
* Copyright (c) 2013 ARM Ltd
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. 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.
* 3. The name of the company may not be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY ARM LTD ``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 ARM LTD 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.
*/
.L_memcpy_base:
// Assumes that n >= 0, and dst, src are valid pointers.
cmp r2, #16
blo .L_copy_less_than_16_unknown_align
.L_copy_unknown_alignment:
// Unknown alignment of src and dst.
// Assumes that the first few bytes have already been prefetched.
// Align destination to 128 bits. The mainloop store instructions
// require this alignment or they will throw an exception.
rsb r3, r0, #0
ands r3, r3, #0xF
beq 2f
// Copy up to 15 bytes (count in r3).
sub r2, r2, r3
movs ip, r3, lsl #31
itt mi
ldrbmi lr, [r1], #1
strbmi lr, [r0], #1
itttt cs
ldrbcs ip, [r1], #1
ldrbcs lr, [r1], #1
strbcs ip, [r0], #1
strbcs lr, [r0], #1
movs ip, r3, lsl #29
bge 1f
// Copies 4 bytes, dst 32 bits aligned before, at least 64 bits after.
vld4.8 {d0[0], d1[0], d2[0], d3[0]}, [r1]!
vst4.8 {d0[0], d1[0], d2[0], d3[0]}, [r0, :32]!
1: bcc 2f
// Copies 8 bytes, dst 64 bits aligned before, at least 128 bits after.
vld1.8 {d0}, [r1]!
vst1.8 {d0}, [r0, :64]!
2: // Make sure we have at least 64 bytes to copy.
subs r2, r2, #64
blo 2f
1: // The main loop copies 64 bytes at a time.
vld1.8 {d0 - d3}, [r1]!
vld1.8 {d4 - d7}, [r1]!
subs r2, r2, #64
vstmia r0!, {d0 - d7}
pld [r1, #(64*10)]
bhs 1b
2: // Fix-up the remaining count and make sure we have >= 32 bytes left.
adds r2, r2, #32
blo 3f
// 32 bytes. These cache lines were already preloaded.
vld1.8 {d0 - d3}, [r1]!
sub r2, r2, #32
vst1.8 {d0 - d3}, [r0, :128]!
3: // Less than 32 left.
add r2, r2, #32
tst r2, #0x10
beq .L_copy_less_than_16_unknown_align
// Copies 16 bytes, destination 128 bits aligned.
vld1.8 {d0, d1}, [r1]!
vst1.8 {d0, d1}, [r0, :128]!
.L_copy_less_than_16_unknown_align:
// Copy up to 15 bytes (count in r2).
movs ip, r2, lsl #29
bcc 1f
vld1.8 {d0}, [r1]!
vst1.8 {d0}, [r0]!
1: bge 2f
vld4.8 {d0[0], d1[0], d2[0], d3[0]}, [r1]!
vst4.8 {d0[0], d1[0], d2[0], d3[0]}, [r0]!
2: // Copy 0 to 4 bytes.
lsls r2, r2, #31
itt ne
ldrbne lr, [r1], #1
strbne lr, [r0], #1
itttt cs
ldrbcs ip, [r1], #1
ldrbcs lr, [r1]
strbcs ip, [r0], #1
strbcs lr, [r0]
pop {r0, pc}

View File

@ -1 +1,31 @@
include bionic/libc/arch-arm/cortex-a7/cortex-a7.mk libc_openbsd_src_files_exclude_arm += \
upstream-openbsd/lib/libc/string/memmove.c \
upstream-openbsd/lib/libc/string/stpcpy.c \
upstream-openbsd/lib/libc/string/strcat.c \
libc_bionic_src_files_exclude_arm += \
arch-arm/generic/bionic/memcpy.S \
arch-arm/generic/bionic/memset.S \
arch-arm/generic/bionic/strcmp.S \
arch-arm/generic/bionic/strcpy.S \
arch-arm/generic/bionic/strlen.c \
bionic/__strcat_chk.cpp \
bionic/__strcpy_chk.cpp \
libc_bionic_src_files_arm += \
arch-arm/cortex-a53/bionic/memcpy.S \
arch-arm/cortex-a53/bionic/__strcat_chk.S \
arch-arm/cortex-a53/bionic/__strcpy_chk.S \
libc_bionic_src_files_arm += \
arch-arm/cortex-a7/bionic/memset.S \
libc_bionic_src_files_arm += \
arch-arm/cortex-a15/bionic/stpcpy.S \
arch-arm/cortex-a15/bionic/strcat.S \
arch-arm/cortex-a15/bionic/strcmp.S \
arch-arm/cortex-a15/bionic/strcpy.S \
arch-arm/cortex-a15/bionic/strlen.S \
libc_bionic_src_files_arm += \
arch-arm/denver/bionic/memmove.S \

View File

@ -0,0 +1,180 @@
/*
* Copyright (C) 2013 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 <machine/cpu-features.h>
#include <private/bionic_asm.h>
#include <private/libc_events.h>
/*
* Optimized memset() for ARM.
*
* memset() returns its first argument.
*/
.fpu neon
.syntax unified
ENTRY(__memset_chk)
cmp r2, r3
bls .L_done
// Preserve lr for backtrace.
push {lr}
.cfi_def_cfa_offset 4
.cfi_rel_offset lr, 0
ldr r0, error_message
ldr r1, error_code
1:
add r0, pc
bl __fortify_chk_fail
error_code:
.word BIONIC_EVENT_MEMSET_BUFFER_OVERFLOW
error_message:
.word error_string-(1b+8)
END(__memset_chk)
ENTRY(bzero)
mov r2, r1
mov r1, #0
.L_done:
// Fall through to memset...
END(bzero)
ENTRY(memset)
mov r3, r0
// At this point only d0, d1 are going to be used below.
vdup.8 q0, r1
cmp r2, #16
blo .L_set_less_than_16_unknown_align
.L_check_alignment:
// Align destination to a double word to avoid the store crossing
// a cache line boundary.
ands ip, r3, #7
bne .L_do_double_word_align
.L_double_word_aligned:
// Duplicate since the less than 64 can use d2, d3.
vmov q1, q0
subs r2, #64
blo .L_set_less_than_64
// Duplicate the copy value so that we can store 64 bytes at a time.
vmov q2, q0
vmov q3, q0
1: // Main loop stores 64 bytes at a time.
subs r2, #64
vstmia r3!, {d0 - d7}
bge 1b
.L_set_less_than_64:
// Restore r2 to the count of bytes left to set.
add r2, #64
lsls ip, r2, #27
bcc .L_set_less_than_32
// Set 32 bytes.
vstmia r3!, {d0 - d3}
.L_set_less_than_32:
bpl .L_set_less_than_16
// Set 16 bytes.
vstmia r3!, {d0, d1}
.L_set_less_than_16:
// Less than 16 bytes to set.
lsls ip, r2, #29
bcc .L_set_less_than_8
// Set 8 bytes.
vstmia r3!, {d0}
.L_set_less_than_8:
bpl .L_set_less_than_4
// Set 4 bytes
vst1.32 {d0[0]}, [r3]!
.L_set_less_than_4:
lsls ip, r2, #31
it ne
strbne r1, [r3], #1
itt cs
strbcs r1, [r3], #1
strbcs r1, [r3]
bx lr
.L_do_double_word_align:
rsb ip, ip, #8
sub r2, r2, ip
// Do this comparison now, otherwise we'll need to save a
// register to the stack since we've used all available
// registers.
cmp ip, #4
blo 1f
// Need to do a four byte copy.
movs ip, ip, lsl #31
it mi
strbmi r1, [r3], #1
itt cs
strbcs r1, [r3], #1
strbcs r1, [r3], #1
vst1.32 {d0[0]}, [r3]!
b .L_double_word_aligned
1:
// No four byte copy.
movs ip, ip, lsl #31
it mi
strbmi r1, [r3], #1
itt cs
strbcs r1, [r3], #1
strbcs r1, [r3], #1
b .L_double_word_aligned
.L_set_less_than_16_unknown_align:
// Set up to 15 bytes.
movs ip, r2, lsl #29
bcc 1f
vst1.8 {d0}, [r3]!
1: bge 2f
vst1.32 {d0[0]}, [r3]!
2: movs ip, r2, lsl #31
it mi
strbmi r1, [r3], #1
itt cs
strbcs r1, [r3], #1
strbcs r1, [r3], #1
bx lr
END(memset)
.data
error_string:
.string "memset: prevented write past end of buffer"

View File

@ -1 +1,29 @@
include bionic/libc/arch-arm/cortex-a15/cortex-a15.mk libc_openbsd_src_files_exclude_arm += \
upstream-openbsd/lib/libc/string/memmove.c \
upstream-openbsd/lib/libc/string/stpcpy.c \
upstream-openbsd/lib/libc/string/strcat.c \
libc_bionic_src_files_exclude_arm += \
arch-arm/generic/bionic/memcpy.S \
arch-arm/generic/bionic/memset.S \
arch-arm/generic/bionic/strcmp.S \
arch-arm/generic/bionic/strcpy.S \
arch-arm/generic/bionic/strlen.c \
bionic/__strcat_chk.cpp \
bionic/__strcpy_chk.cpp \
libc_bionic_src_files_arm += \
arch-arm/cortex-a7/bionic/memset.S \
libc_bionic_src_files_arm += \
arch-arm/cortex-a15/bionic/memcpy.S \
arch-arm/cortex-a15/bionic/stpcpy.S \
arch-arm/cortex-a15/bionic/strcat.S \
arch-arm/cortex-a15/bionic/__strcat_chk.S \
arch-arm/cortex-a15/bionic/strcmp.S \
arch-arm/cortex-a15/bionic/strcpy.S \
arch-arm/cortex-a15/bionic/__strcpy_chk.S \
arch-arm/cortex-a15/bionic/strlen.S \
libc_bionic_src_files_arm += \
arch-arm/denver/bionic/memmove.S \

View File

@ -44,7 +44,7 @@ ENTRY_PRIVATE(MEMCPY_BASE)
/* check if buffers are aligned. If so, run arm-only version */ /* check if buffers are aligned. If so, run arm-only version */
eor r3, r0, r1 eor r3, r0, r1
ands r3, r3, #0x3 ands r3, r3, #0x3
beq __memcpy_base_aligned beq MEMCPY_BASE_ALIGNED
/* Check the upper size limit for Neon unaligned memory access in memcpy */ /* Check the upper size limit for Neon unaligned memory access in memcpy */
cmp r2, #224 cmp r2, #224
@ -133,8 +133,7 @@ ENTRY_PRIVATE(MEMCPY_BASE)
strbcs ip, [r0], #1 strbcs ip, [r0], #1
strbcs lr, [r0], #1 strbcs lr, [r0], #1
ldmfd sp!, {r0, lr} ldmfd sp!, {r0, pc}
bx lr
END(MEMCPY_BASE) END(MEMCPY_BASE)
ENTRY_PRIVATE(MEMCPY_BASE_ALIGNED) ENTRY_PRIVATE(MEMCPY_BASE_ALIGNED)

View File

@ -69,12 +69,9 @@ END(bzero)
ENTRY(memset) ENTRY(memset)
// The neon memset only wins for less than 132. // The neon memset only wins for less than 132.
cmp r2, #132 cmp r2, #132
bhi __memset_large_copy bhi .L_memset_large_copy
stmfd sp!, {r0}
.cfi_def_cfa_offset 4
.cfi_rel_offset r0, 0
mov r3, r0
vdup.8 q0, r1 vdup.8 q0, r1
/* make sure we have at least 32 bytes to write */ /* make sure we have at least 32 bytes to write */
@ -84,7 +81,7 @@ ENTRY(memset)
1: /* The main loop writes 32 bytes at a time */ 1: /* The main loop writes 32 bytes at a time */
subs r2, r2, #32 subs r2, r2, #32
vst1.8 {d0 - d3}, [r0]! vst1.8 {d0 - d3}, [r3]!
bhs 1b bhs 1b
2: /* less than 32 left */ 2: /* less than 32 left */
@ -93,22 +90,20 @@ ENTRY(memset)
beq 3f beq 3f
// writes 16 bytes, 128-bits aligned // writes 16 bytes, 128-bits aligned
vst1.8 {d0, d1}, [r0]! vst1.8 {d0, d1}, [r3]!
3: /* write up to 15-bytes (count in r2) */ 3: /* write up to 15-bytes (count in r2) */
movs ip, r2, lsl #29 movs ip, r2, lsl #29
bcc 1f bcc 1f
vst1.8 {d0}, [r0]! vst1.8 {d0}, [r3]!
1: bge 2f 1: bge 2f
vst1.32 {d0[0]}, [r0]! vst1.32 {d0[0]}, [r3]!
2: movs ip, r2, lsl #31 2: movs ip, r2, lsl #31
strbmi r1, [r0], #1 strbmi r1, [r3], #1
strbcs r1, [r0], #1 strbcs r1, [r3], #1
strbcs r1, [r0], #1 strbcs r1, [r3], #1
ldmfd sp!, {r0}
bx lr bx lr
END(memset)
ENTRY_PRIVATE(__memset_large_copy) .L_memset_large_copy:
/* compute the offset to align the destination /* compute the offset to align the destination
* offset = (4-(src&3))&3 = -src & 3 * offset = (4-(src&3))&3 = -src & 3
*/ */
@ -136,8 +131,7 @@ ENTRY_PRIVATE(__memset_large_copy)
strbcs r1, [r0], #1 strbcs r1, [r0], #1
strbmi r1, [r0], #1 strbmi r1, [r0], #1
subs r2, r2, r3 subs r2, r2, r3
popls {r0, r4-r7, lr} /* return */ popls {r0, r4-r7, pc} /* return */
bxls lr
/* align the destination to a cache-line */ /* align the destination to a cache-line */
mov r12, r1 mov r12, r1
@ -180,9 +174,8 @@ ENTRY_PRIVATE(__memset_large_copy)
strhmi r1, [r0], #2 strhmi r1, [r0], #2
movs r2, r2, lsl #2 movs r2, r2, lsl #2
strbcs r1, [r0] strbcs r1, [r0]
ldmfd sp!, {r0, r4-r7, lr} ldmfd sp!, {r0, r4-r7, pc}
bx lr END(memset)
END(__memset_large_copy)
.data .data
error_string: error_string:

View File

@ -70,7 +70,7 @@
.macro m_scan_byte .macro m_scan_byte
ldrb r3, [r0] ldrb r3, [r0]
cbz r3, strcat_r0_scan_done cbz r3, .Lstrcat_r0_scan_done
add r0, #1 add r0, #1
.endm // m_scan_byte .endm // m_scan_byte
@ -84,10 +84,10 @@ ENTRY(strcat)
// Quick check to see if src is empty. // Quick check to see if src is empty.
ldrb r2, [r1] ldrb r2, [r1]
pld [r1, #0] pld [r1, #0]
cbnz r2, strcat_continue cbnz r2, .Lstrcat_continue
bx lr bx lr
strcat_continue: .Lstrcat_continue:
// To speed up really small dst strings, unroll checking the first 4 bytes. // To speed up really small dst strings, unroll checking the first 4 bytes.
m_push m_push
m_scan_byte m_scan_byte
@ -96,10 +96,10 @@ strcat_continue:
m_scan_byte m_scan_byte
ands r3, r0, #7 ands r3, r0, #7
bne strcat_align_src bne .Lstrcat_align_src
.p2align 2 .p2align 2
strcat_mainloop: .Lstrcat_mainloop:
ldmia r0!, {r2, r3} ldmia r0!, {r2, r3}
pld [r0, #64] pld [r0, #64]
@ -107,28 +107,28 @@ strcat_mainloop:
sub ip, r2, #0x01010101 sub ip, r2, #0x01010101
bic ip, ip, r2 bic ip, ip, r2
ands ip, ip, #0x80808080 ands ip, ip, #0x80808080
bne strcat_zero_in_first_register bne .Lstrcat_zero_in_first_register
sub ip, r3, #0x01010101 sub ip, r3, #0x01010101
bic ip, ip, r3 bic ip, ip, r3
ands ip, ip, #0x80808080 ands ip, ip, #0x80808080
bne strcat_zero_in_second_register bne .Lstrcat_zero_in_second_register
b strcat_mainloop b .Lstrcat_mainloop
strcat_zero_in_first_register: .Lstrcat_zero_in_first_register:
sub r0, r0, #4 sub r0, r0, #4
strcat_zero_in_second_register: .Lstrcat_zero_in_second_register:
// Check for zero in byte 0. // Check for zero in byte 0.
tst ip, #0x80 tst ip, #0x80
it ne it ne
subne r0, r0, #4 subne r0, r0, #4
bne strcat_r0_scan_done bne .Lstrcat_r0_scan_done
// Check for zero in byte 1. // Check for zero in byte 1.
tst ip, #0x8000 tst ip, #0x8000
it ne it ne
subne r0, r0, #3 subne r0, r0, #3
bne strcat_r0_scan_done bne .Lstrcat_r0_scan_done
// Check for zero in byte 2. // Check for zero in byte 2.
tst ip, #0x800000 tst ip, #0x800000
it ne it ne
@ -137,33 +137,33 @@ strcat_zero_in_second_register:
// Zero is in byte 3. // Zero is in byte 3.
subeq r0, r0, #1 subeq r0, r0, #1
strcat_r0_scan_done: .Lstrcat_r0_scan_done:
// Unroll the first 8 bytes that will be copied. // Unroll the first 8 bytes that will be copied.
m_copy_byte reg=r2, cmd=cbz, label=strcpy_finish m_copy_byte reg=r2, cmd=cbz, label=.Lstrcpy_finish
m_copy_byte reg=r3, cmd=cbz, label=strcpy_finish m_copy_byte reg=r3, cmd=cbz, label=.Lstrcpy_finish
m_copy_byte reg=r4, cmd=cbz, label=strcpy_finish m_copy_byte reg=r4, cmd=cbz, label=.Lstrcpy_finish
m_copy_byte reg=r5, cmd=cbz, label=strcpy_finish m_copy_byte reg=r5, cmd=cbz, label=.Lstrcpy_finish
m_copy_byte reg=r2, cmd=cbz, label=strcpy_finish m_copy_byte reg=r2, cmd=cbz, label=.Lstrcpy_finish
m_copy_byte reg=r3, cmd=cbz, label=strcpy_finish m_copy_byte reg=r3, cmd=cbz, label=.Lstrcpy_finish
m_copy_byte reg=r4, cmd=cbz, label=strcpy_finish m_copy_byte reg=r4, cmd=cbz, label=.Lstrcpy_finish
m_copy_byte reg=r5, cmd=cbnz, label=strcpy_continue m_copy_byte reg=r5, cmd=cbnz, label=.Lstrcpy_continue
strcpy_finish: .Lstrcpy_finish:
m_ret inst=pop m_ret inst=pop
strcpy_continue: .Lstrcpy_continue:
pld [r1, #0] pld [r1, #0]
ands r3, r0, #7 ands r3, r0, #7
bne strcpy_align_dst bne .Lstrcpy_align_dst
strcpy_check_src_align: .Lstrcpy_check_src_align:
// At this point dst is aligned to a double word, check if src // At this point dst is aligned to a double word, check if src
// is also aligned to a double word. // is also aligned to a double word.
ands r3, r1, #7 ands r3, r1, #7
bne strcpy_unaligned_copy bne .Lstrcpy_unaligned_copy
.p2align 2 .p2align 2
strcpy_mainloop: .Lstrcpy_mainloop:
ldmia r1!, {r2, r3} ldmia r1!, {r2, r3}
pld [r1, #64] pld [r1, #64]
@ -171,17 +171,17 @@ strcpy_mainloop:
sub ip, r2, #0x01010101 sub ip, r2, #0x01010101
bic ip, ip, r2 bic ip, ip, r2
ands ip, ip, #0x80808080 ands ip, ip, #0x80808080
bne strcpy_zero_in_first_register bne .Lstrcpy_zero_in_first_register
sub ip, r3, #0x01010101 sub ip, r3, #0x01010101
bic ip, ip, r3 bic ip, ip, r3
ands ip, ip, #0x80808080 ands ip, ip, #0x80808080
bne strcpy_zero_in_second_register bne .Lstrcpy_zero_in_second_register
stmia r0!, {r2, r3} stmia r0!, {r2, r3}
b strcpy_mainloop b .Lstrcpy_mainloop
strcpy_zero_in_first_register: .Lstrcpy_zero_in_first_register:
lsls lr, ip, #17 lsls lr, ip, #17
itt ne itt ne
strbne r2, [r0] strbne r2, [r0]
@ -198,7 +198,7 @@ strcpy_zero_in_first_register:
strb r3, [r0] strb r3, [r0]
m_ret inst=pop m_ret inst=pop
strcpy_zero_in_second_register: .Lstrcpy_zero_in_second_register:
lsls lr, ip, #17 lsls lr, ip, #17
ittt ne ittt ne
stmiane r0!, {r2} stmiane r0!, {r2}
@ -218,18 +218,18 @@ strcpy_zero_in_second_register:
strb r4, [r0] strb r4, [r0]
m_ret inst=pop m_ret inst=pop
strcpy_align_dst: .Lstrcpy_align_dst:
// Align to a double word (64 bits). // Align to a double word (64 bits).
rsb r3, r3, #8 rsb r3, r3, #8
lsls ip, r3, #31 lsls ip, r3, #31
beq strcpy_align_to_32 beq .Lstrcpy_align_to_32
ldrb r2, [r1], #1 ldrb r2, [r1], #1
strb r2, [r0], #1 strb r2, [r0], #1
cbz r2, strcpy_complete cbz r2, .Lstrcpy_complete
strcpy_align_to_32: .Lstrcpy_align_to_32:
bcc strcpy_align_to_64 bcc .Lstrcpy_align_to_64
ldrb r4, [r1], #1 ldrb r4, [r1], #1
strb r4, [r0], #1 strb r4, [r0], #1
@ -242,76 +242,83 @@ strcpy_align_to_32:
it eq it eq
m_ret inst=popeq m_ret inst=popeq
strcpy_align_to_64: .Lstrcpy_align_to_64:
tst r3, #4 tst r3, #4
beq strcpy_check_src_align beq .Lstrcpy_check_src_align
ldr r2, [r1], #4 // Read one byte at a time since we don't know the src alignment
// and we don't want to read into a different page.
ldrb r4, [r1], #1
strb r4, [r0], #1
cbz r4, .Lstrcpy_complete
ldrb r5, [r1], #1
strb r5, [r0], #1
cbz r5, .Lstrcpy_complete
ldrb r4, [r1], #1
strb r4, [r0], #1
cbz r4, .Lstrcpy_complete
ldrb r5, [r1], #1
strb r5, [r0], #1
cbz r5, .Lstrcpy_complete
b .Lstrcpy_check_src_align
sub ip, r2, #0x01010101 .Lstrcpy_complete:
bic ip, ip, r2
ands ip, ip, #0x80808080
bne strcpy_zero_in_first_register
stmia r0!, {r2}
b strcpy_check_src_align
strcpy_complete:
m_ret inst=pop m_ret inst=pop
strcpy_unaligned_copy: .Lstrcpy_unaligned_copy:
// Dst is aligned to a double word, while src is at an unknown alignment. // Dst is aligned to a double word, while src is at an unknown alignment.
// There are 7 different versions of the unaligned copy code // There are 7 different versions of the unaligned copy code
// to prevent overreading the src. The mainloop of every single version // to prevent overreading the src. The mainloop of every single version
// will store 64 bits per loop. The difference is how much of src can // will store 64 bits per loop. The difference is how much of src can
// be read without potentially crossing a page boundary. // be read without potentially crossing a page boundary.
tbb [pc, r3] tbb [pc, r3]
strcpy_unaligned_branchtable: .Lstrcpy_unaligned_branchtable:
.byte 0 .byte 0
.byte ((strcpy_unalign7 - strcpy_unaligned_branchtable)/2) .byte ((.Lstrcpy_unalign7 - .Lstrcpy_unaligned_branchtable)/2)
.byte ((strcpy_unalign6 - strcpy_unaligned_branchtable)/2) .byte ((.Lstrcpy_unalign6 - .Lstrcpy_unaligned_branchtable)/2)
.byte ((strcpy_unalign5 - strcpy_unaligned_branchtable)/2) .byte ((.Lstrcpy_unalign5 - .Lstrcpy_unaligned_branchtable)/2)
.byte ((strcpy_unalign4 - strcpy_unaligned_branchtable)/2) .byte ((.Lstrcpy_unalign4 - .Lstrcpy_unaligned_branchtable)/2)
.byte ((strcpy_unalign3 - strcpy_unaligned_branchtable)/2) .byte ((.Lstrcpy_unalign3 - .Lstrcpy_unaligned_branchtable)/2)
.byte ((strcpy_unalign2 - strcpy_unaligned_branchtable)/2) .byte ((.Lstrcpy_unalign2 - .Lstrcpy_unaligned_branchtable)/2)
.byte ((strcpy_unalign1 - strcpy_unaligned_branchtable)/2) .byte ((.Lstrcpy_unalign1 - .Lstrcpy_unaligned_branchtable)/2)
.p2align 2 .p2align 2
// Can read 7 bytes before possibly crossing a page. // Can read 7 bytes before possibly crossing a page.
strcpy_unalign7: .Lstrcpy_unalign7:
ldr r2, [r1], #4 ldr r2, [r1], #4
sub ip, r2, #0x01010101 sub ip, r2, #0x01010101
bic ip, ip, r2 bic ip, ip, r2
ands ip, ip, #0x80808080 ands ip, ip, #0x80808080
bne strcpy_zero_in_first_register bne .Lstrcpy_zero_in_first_register
ldrb r3, [r1] ldrb r3, [r1]
cbz r3, strcpy_unalign7_copy5bytes cbz r3, .Lstrcpy_unalign7_copy5bytes
ldrb r4, [r1, #1] ldrb r4, [r1, #1]
cbz r4, strcpy_unalign7_copy6bytes cbz r4, .Lstrcpy_unalign7_copy6bytes
ldrb r5, [r1, #2] ldrb r5, [r1, #2]
cbz r5, strcpy_unalign7_copy7bytes cbz r5, .Lstrcpy_unalign7_copy7bytes
ldr r3, [r1], #4 ldr r3, [r1], #4
pld [r1, #64] pld [r1, #64]
lsrs ip, r3, #24 lsrs ip, r3, #24
stmia r0!, {r2, r3} stmia r0!, {r2, r3}
beq strcpy_unalign_return beq .Lstrcpy_unalign_return
b strcpy_unalign7 b .Lstrcpy_unalign7
strcpy_unalign7_copy5bytes: .Lstrcpy_unalign7_copy5bytes:
stmia r0!, {r2} stmia r0!, {r2}
strb r3, [r0] strb r3, [r0]
strcpy_unalign_return: .Lstrcpy_unalign_return:
m_ret inst=pop m_ret inst=pop
strcpy_unalign7_copy6bytes: .Lstrcpy_unalign7_copy6bytes:
stmia r0!, {r2} stmia r0!, {r2}
strb r3, [r0], #1 strb r3, [r0], #1
strb r4, [r0], #1 strb r4, [r0], #1
m_ret inst=pop m_ret inst=pop
strcpy_unalign7_copy7bytes: .Lstrcpy_unalign7_copy7bytes:
stmia r0!, {r2} stmia r0!, {r2}
strb r3, [r0], #1 strb r3, [r0], #1
strb r4, [r0], #1 strb r4, [r0], #1
@ -320,30 +327,30 @@ strcpy_unalign7_copy7bytes:
.p2align 2 .p2align 2
// Can read 6 bytes before possibly crossing a page. // Can read 6 bytes before possibly crossing a page.
strcpy_unalign6: .Lstrcpy_unalign6:
ldr r2, [r1], #4 ldr r2, [r1], #4
sub ip, r2, #0x01010101 sub ip, r2, #0x01010101
bic ip, ip, r2 bic ip, ip, r2
ands ip, ip, #0x80808080 ands ip, ip, #0x80808080
bne strcpy_zero_in_first_register bne .Lstrcpy_zero_in_first_register
ldrb r4, [r1] ldrb r4, [r1]
cbz r4, strcpy_unalign_copy5bytes cbz r4, .Lstrcpy_unalign_copy5bytes
ldrb r5, [r1, #1] ldrb r5, [r1, #1]
cbz r5, strcpy_unalign_copy6bytes cbz r5, .Lstrcpy_unalign_copy6bytes
ldr r3, [r1], #4 ldr r3, [r1], #4
pld [r1, #64] pld [r1, #64]
tst r3, #0xff0000 tst r3, #0xff0000
beq strcpy_unalign6_copy7bytes beq .Lstrcpy_unalign6_copy7bytes
lsrs ip, r3, #24 lsrs ip, r3, #24
stmia r0!, {r2, r3} stmia r0!, {r2, r3}
beq strcpy_unalign_return beq .Lstrcpy_unalign_return
b strcpy_unalign6 b .Lstrcpy_unalign6
strcpy_unalign6_copy7bytes: .Lstrcpy_unalign6_copy7bytes:
stmia r0!, {r2} stmia r0!, {r2}
strh r3, [r0], #2 strh r3, [r0], #2
lsr r3, #16 lsr r3, #16
@ -352,16 +359,16 @@ strcpy_unalign6_copy7bytes:
.p2align 2 .p2align 2
// Can read 5 bytes before possibly crossing a page. // Can read 5 bytes before possibly crossing a page.
strcpy_unalign5: .Lstrcpy_unalign5:
ldr r2, [r1], #4 ldr r2, [r1], #4
sub ip, r2, #0x01010101 sub ip, r2, #0x01010101
bic ip, ip, r2 bic ip, ip, r2
ands ip, ip, #0x80808080 ands ip, ip, #0x80808080
bne strcpy_zero_in_first_register bne .Lstrcpy_zero_in_first_register
ldrb r4, [r1] ldrb r4, [r1]
cbz r4, strcpy_unalign_copy5bytes cbz r4, .Lstrcpy_unalign_copy5bytes
ldr r3, [r1], #4 ldr r3, [r1], #4
@ -370,17 +377,17 @@ strcpy_unalign5:
sub ip, r3, #0x01010101 sub ip, r3, #0x01010101
bic ip, ip, r3 bic ip, ip, r3
ands ip, ip, #0x80808080 ands ip, ip, #0x80808080
bne strcpy_zero_in_second_register bne .Lstrcpy_zero_in_second_register
stmia r0!, {r2, r3} stmia r0!, {r2, r3}
b strcpy_unalign5 b .Lstrcpy_unalign5
strcpy_unalign_copy5bytes: .Lstrcpy_unalign_copy5bytes:
stmia r0!, {r2} stmia r0!, {r2}
strb r4, [r0] strb r4, [r0]
m_ret inst=pop m_ret inst=pop
strcpy_unalign_copy6bytes: .Lstrcpy_unalign_copy6bytes:
stmia r0!, {r2} stmia r0!, {r2}
strb r4, [r0], #1 strb r4, [r0], #1
strb r5, [r0] strb r5, [r0]
@ -388,13 +395,13 @@ strcpy_unalign_copy6bytes:
.p2align 2 .p2align 2
// Can read 4 bytes before possibly crossing a page. // Can read 4 bytes before possibly crossing a page.
strcpy_unalign4: .Lstrcpy_unalign4:
ldmia r1!, {r2} ldmia r1!, {r2}
sub ip, r2, #0x01010101 sub ip, r2, #0x01010101
bic ip, ip, r2 bic ip, ip, r2
ands ip, ip, #0x80808080 ands ip, ip, #0x80808080
bne strcpy_zero_in_first_register bne .Lstrcpy_zero_in_first_register
ldmia r1!, {r3} ldmia r1!, {r3}
pld [r1, #64] pld [r1, #64]
@ -402,20 +409,20 @@ strcpy_unalign4:
sub ip, r3, #0x01010101 sub ip, r3, #0x01010101
bic ip, ip, r3 bic ip, ip, r3
ands ip, ip, #0x80808080 ands ip, ip, #0x80808080
bne strcpy_zero_in_second_register bne .Lstrcpy_zero_in_second_register
stmia r0!, {r2, r3} stmia r0!, {r2, r3}
b strcpy_unalign4 b .Lstrcpy_unalign4
.p2align 2 .p2align 2
// Can read 3 bytes before possibly crossing a page. // Can read 3 bytes before possibly crossing a page.
strcpy_unalign3: .Lstrcpy_unalign3:
ldrb r2, [r1] ldrb r2, [r1]
cbz r2, strcpy_unalign3_copy1byte cbz r2, .Lstrcpy_unalign3_copy1byte
ldrb r3, [r1, #1] ldrb r3, [r1, #1]
cbz r3, strcpy_unalign3_copy2bytes cbz r3, .Lstrcpy_unalign3_copy2bytes
ldrb r4, [r1, #2] ldrb r4, [r1, #2]
cbz r4, strcpy_unalign3_copy3bytes cbz r4, .Lstrcpy_unalign3_copy3bytes
ldr r2, [r1], #4 ldr r2, [r1], #4
ldr r3, [r1], #4 ldr r3, [r1], #4
@ -423,26 +430,26 @@ strcpy_unalign3:
pld [r1, #64] pld [r1, #64]
lsrs lr, r2, #24 lsrs lr, r2, #24
beq strcpy_unalign_copy4bytes beq .Lstrcpy_unalign_copy4bytes
sub ip, r3, #0x01010101 sub ip, r3, #0x01010101
bic ip, ip, r3 bic ip, ip, r3
ands ip, ip, #0x80808080 ands ip, ip, #0x80808080
bne strcpy_zero_in_second_register bne .Lstrcpy_zero_in_second_register
stmia r0!, {r2, r3} stmia r0!, {r2, r3}
b strcpy_unalign3 b .Lstrcpy_unalign3
strcpy_unalign3_copy1byte: .Lstrcpy_unalign3_copy1byte:
strb r2, [r0] strb r2, [r0]
m_ret inst=pop m_ret inst=pop
strcpy_unalign3_copy2bytes: .Lstrcpy_unalign3_copy2bytes:
strb r2, [r0], #1 strb r2, [r0], #1
strb r3, [r0] strb r3, [r0]
m_ret inst=pop m_ret inst=pop
strcpy_unalign3_copy3bytes: .Lstrcpy_unalign3_copy3bytes:
strb r2, [r0], #1 strb r2, [r0], #1
strb r3, [r0], #1 strb r3, [r0], #1
strb r4, [r0] strb r4, [r0]
@ -450,34 +457,34 @@ strcpy_unalign3_copy3bytes:
.p2align 2 .p2align 2
// Can read 2 bytes before possibly crossing a page. // Can read 2 bytes before possibly crossing a page.
strcpy_unalign2: .Lstrcpy_unalign2:
ldrb r2, [r1] ldrb r2, [r1]
cbz r2, strcpy_unalign_copy1byte cbz r2, .Lstrcpy_unalign_copy1byte
ldrb r3, [r1, #1] ldrb r3, [r1, #1]
cbz r3, strcpy_unalign_copy2bytes cbz r3, .Lstrcpy_unalign_copy2bytes
ldr r2, [r1], #4 ldr r2, [r1], #4
ldr r3, [r1], #4 ldr r3, [r1], #4
pld [r1, #64] pld [r1, #64]
tst r2, #0xff0000 tst r2, #0xff0000
beq strcpy_unalign_copy3bytes beq .Lstrcpy_unalign_copy3bytes
lsrs ip, r2, #24 lsrs ip, r2, #24
beq strcpy_unalign_copy4bytes beq .Lstrcpy_unalign_copy4bytes
sub ip, r3, #0x01010101 sub ip, r3, #0x01010101
bic ip, ip, r3 bic ip, ip, r3
ands ip, ip, #0x80808080 ands ip, ip, #0x80808080
bne strcpy_zero_in_second_register bne .Lstrcpy_zero_in_second_register
stmia r0!, {r2, r3} stmia r0!, {r2, r3}
b strcpy_unalign2 b .Lstrcpy_unalign2
.p2align 2 .p2align 2
// Can read 1 byte before possibly crossing a page. // Can read 1 byte before possibly crossing a page.
strcpy_unalign1: .Lstrcpy_unalign1:
ldrb r2, [r1] ldrb r2, [r1]
cbz r2, strcpy_unalign_copy1byte cbz r2, .Lstrcpy_unalign_copy1byte
ldr r2, [r1], #4 ldr r2, [r1], #4
ldr r3, [r1], #4 ldr r3, [r1], #4
@ -487,62 +494,62 @@ strcpy_unalign1:
sub ip, r2, #0x01010101 sub ip, r2, #0x01010101
bic ip, ip, r2 bic ip, ip, r2
ands ip, ip, #0x80808080 ands ip, ip, #0x80808080
bne strcpy_zero_in_first_register bne .Lstrcpy_zero_in_first_register
sub ip, r3, #0x01010101 sub ip, r3, #0x01010101
bic ip, ip, r3 bic ip, ip, r3
ands ip, ip, #0x80808080 ands ip, ip, #0x80808080
bne strcpy_zero_in_second_register bne .Lstrcpy_zero_in_second_register
stmia r0!, {r2, r3} stmia r0!, {r2, r3}
b strcpy_unalign1 b .Lstrcpy_unalign1
strcpy_unalign_copy1byte: .Lstrcpy_unalign_copy1byte:
strb r2, [r0] strb r2, [r0]
m_ret inst=pop m_ret inst=pop
strcpy_unalign_copy2bytes: .Lstrcpy_unalign_copy2bytes:
strb r2, [r0], #1 strb r2, [r0], #1
strb r3, [r0] strb r3, [r0]
m_ret inst=pop m_ret inst=pop
strcpy_unalign_copy3bytes: .Lstrcpy_unalign_copy3bytes:
strh r2, [r0], #2 strh r2, [r0], #2
lsr r2, #16 lsr r2, #16
strb r2, [r0] strb r2, [r0]
m_ret inst=pop m_ret inst=pop
strcpy_unalign_copy4bytes: .Lstrcpy_unalign_copy4bytes:
stmia r0, {r2} stmia r0, {r2}
m_ret inst=pop m_ret inst=pop
strcat_align_src: .Lstrcat_align_src:
// Align to a double word (64 bits). // Align to a double word (64 bits).
rsb r3, r3, #8 rsb r3, r3, #8
lsls ip, r3, #31 lsls ip, r3, #31
beq strcat_align_to_32 beq .Lstrcat_align_to_32
ldrb r2, [r0], #1 ldrb r2, [r0], #1
cbz r2, strcat_r0_update cbz r2, .Lstrcat_r0_update
strcat_align_to_32: .Lstrcat_align_to_32:
bcc strcat_align_to_64 bcc .Lstrcat_align_to_64
ldrb r2, [r0], #1 ldrb r2, [r0], #1
cbz r2, strcat_r0_update cbz r2, .Lstrcat_r0_update
ldrb r2, [r0], #1 ldrb r2, [r0], #1
cbz r2, strcat_r0_update cbz r2, .Lstrcat_r0_update
strcat_align_to_64: .Lstrcat_align_to_64:
tst r3, #4 tst r3, #4
beq strcat_mainloop beq .Lstrcat_mainloop
ldr r3, [r0], #4 ldr r3, [r0], #4
sub ip, r3, #0x01010101 sub ip, r3, #0x01010101
bic ip, ip, r3 bic ip, ip, r3
ands ip, ip, #0x80808080 ands ip, ip, #0x80808080
bne strcat_zero_in_second_register bne .Lstrcat_zero_in_second_register
b strcat_mainloop b .Lstrcat_mainloop
strcat_r0_update: .Lstrcat_r0_update:
sub r0, r0, #1 sub r0, r0, #1
b strcat_r0_scan_done b .Lstrcat_r0_scan_done
END(strcat) END(strcat)

View File

@ -244,13 +244,20 @@ ENTRY(strcpy)
.Lstringcopy_align_to_64: .Lstringcopy_align_to_64:
tst r3, #4 tst r3, #4
beq .Lstringcopy_check_src_align beq .Lstringcopy_check_src_align
ldr r2, [r1], #4 // Read one byte at a time since we don't have any idea about the alignment
// of the source and we don't want to read into a different page.
sub ip, r2, #0x01010101 ldrb r2, [r1], #1
bic ip, ip, r2 strb r2, [r0], #1
ands ip, ip, #0x80808080 cbz r2, .Lstringcopy_complete
bne .Lstringcopy_zero_in_first_register ldrb r2, [r1], #1
stmia r0!, {r2} strb r2, [r0], #1
cbz r2, .Lstringcopy_complete
ldrb r2, [r1], #1
strb r2, [r0], #1
cbz r2, .Lstringcopy_complete
ldrb r2, [r1], #1
strb r2, [r0], #1
cbz r2, .Lstringcopy_complete
b .Lstringcopy_check_src_align b .Lstringcopy_check_src_align
.Lstringcopy_complete: .Lstringcopy_complete:

View File

@ -1,3 +1,18 @@
libc_openbsd_src_files_exclude_arm += \
upstream-openbsd/lib/libc/string/memmove.c \
upstream-openbsd/lib/libc/string/stpcpy.c \
upstream-openbsd/lib/libc/string/strcat.c \
upstream-openbsd/lib/libc/string/strcpy.c \
libc_bionic_src_files_exclude_arm += \
arch-arm/generic/bionic/memcpy.S \
arch-arm/generic/bionic/memset.S \
arch-arm/generic/bionic/strcmp.S \
arch-arm/generic/bionic/strcpy.S \
arch-arm/generic/bionic/strlen.c \
bionic/__strcat_chk.cpp \
bionic/__strcpy_chk.cpp \
libc_bionic_src_files_arm += \ libc_bionic_src_files_arm += \
arch-arm/cortex-a9/bionic/memcpy.S \ arch-arm/cortex-a9/bionic/memcpy.S \
arch-arm/cortex-a9/bionic/memset.S \ arch-arm/cortex-a9/bionic/memset.S \
@ -9,8 +24,5 @@ libc_bionic_src_files_arm += \
arch-arm/cortex-a9/bionic/__strcpy_chk.S \ arch-arm/cortex-a9/bionic/__strcpy_chk.S \
arch-arm/cortex-a9/bionic/strlen.S \ arch-arm/cortex-a9/bionic/strlen.S \
libc_bionic_src_files_arm += \
arch-arm/generic/bionic/memcmp.S \
libc_bionic_src_files_arm += \ libc_bionic_src_files_arm += \
arch-arm/denver/bionic/memmove.S \ arch-arm/denver/bionic/memmove.S \

View File

@ -1,5 +1,18 @@
libc_openbsd_src_files_exclude_arm += \
upstream-openbsd/lib/libc/string/memmove.c \
upstream-openbsd/lib/libc/string/stpcpy.c \
upstream-openbsd/lib/libc/string/strcat.c \
libc_bionic_src_files_exclude_arm += \
arch-arm/generic/bionic/memcpy.S \
arch-arm/generic/bionic/memset.S \
arch-arm/generic/bionic/strcmp.S \
arch-arm/generic/bionic/strcpy.S \
arch-arm/generic/bionic/strlen.c \
bionic/__strcat_chk.cpp \
bionic/__strcpy_chk.cpp \
libc_bionic_src_files_arm += \ libc_bionic_src_files_arm += \
arch-arm/generic/bionic/memcmp.S \
arch-arm/denver/bionic/memcpy.S \ arch-arm/denver/bionic/memcpy.S \
arch-arm/denver/bionic/memmove.S \ arch-arm/denver/bionic/memmove.S \
arch-arm/denver/bionic/memset.S \ arch-arm/denver/bionic/memset.S \

View File

@ -221,8 +221,7 @@ ENTRY(memcmp)
bne 8b bne 8b
9: /* restore registers and return */ 9: /* restore registers and return */
ldmfd sp!, {r4, lr} ldmfd sp!, {r4, pc}
bx lr
10: /* process less than 12 bytes */ 10: /* process less than 12 bytes */
cmp r2, #0 cmp r2, #0

View File

@ -194,8 +194,7 @@ ENTRY(memcpy)
/* we're done! restore everything and return */ /* we're done! restore everything and return */
1: ldmfd sp!, {r5-r11} 1: ldmfd sp!, {r5-r11}
ldmfd sp!, {r0, r4, lr} ldmfd sp!, {r0, r4, pc}
bx lr
/********************************************************************/ /********************************************************************/
@ -385,8 +384,7 @@ ENTRY(memcpy)
/* we're done! restore sp and spilled registers and return */ /* we're done! restore sp and spilled registers and return */
add sp, sp, #28 add sp, sp, #28
ldmfd sp!, {r0, r4, lr} ldmfd sp!, {r0, r4, pc}
bx lr
END(memcpy) END(memcpy)
// Only reached when the __memcpy_chk check fails. // Only reached when the __memcpy_chk check fails.

View File

@ -82,8 +82,7 @@ ENTRY(memset)
strbcs r1, [r0], #1 strbcs r1, [r0], #1
strbmi r1, [r0], #1 strbmi r1, [r0], #1
subs r2, r2, r3 subs r2, r2, r3
popls {r0, r4-r7, lr} /* return */ popls {r0, r4-r7, pc} /* return */
bxls lr
/* align the destination to a cache-line */ /* align the destination to a cache-line */
mov r12, r1 mov r12, r1
@ -126,8 +125,7 @@ ENTRY(memset)
strhmi r1, [r0], #2 strhmi r1, [r0], #2
movs r2, r2, lsl #2 movs r2, r2, lsl #2
strbcs r1, [r0] strbcs r1, [r0]
ldmfd sp!, {r0, r4-r7, lr} ldmfd sp!, {r0, r4-r7, pc}
bx lr
END(memset) END(memset)
.data .data

View File

@ -1,14 +0,0 @@
libc_bionic_src_files_arm += \
arch-arm/generic/bionic/memcmp.S \
arch-arm/generic/bionic/memcpy.S \
arch-arm/generic/bionic/memset.S \
arch-arm/generic/bionic/strcmp.S \
arch-arm/generic/bionic/strcpy.S \
arch-arm/generic/bionic/strlen.c \
bionic/__strcat_chk.cpp \
bionic/__strcpy_chk.cpp \
libc_openbsd_src_files_arm += \
upstream-openbsd/lib/libc/string/memmove.c \
upstream-openbsd/lib/libc/string/stpcpy.c \
upstream-openbsd/lib/libc/string/strcat.c \

View File

@ -40,7 +40,7 @@
ENTRY(__strcat_chk) ENTRY(__strcat_chk)
pld [r0, #0] pld [r0, #0]
push {r0, lr} push {r0, lr}
.cfi_def_cfa_offset 8 .cfi_adjust_cfa_offset 8
.cfi_rel_offset r0, 0 .cfi_rel_offset r0, 0
.cfi_rel_offset lr, 4 .cfi_rel_offset lr, 4
push {r4, r5} push {r4, r5}
@ -177,7 +177,7 @@ ENTRY(__strcat_chk)
.L_strlen_done: .L_strlen_done:
add r2, r3, r4 add r2, r3, r4
cmp r2, lr cmp r2, lr
bhi __strcat_chk_failed bhi .L_strcat_chk_failed
// Set up the registers for the memcpy code. // Set up the registers for the memcpy code.
mov r1, r5 mov r1, r5
@ -185,20 +185,17 @@ ENTRY(__strcat_chk)
mov r2, r4 mov r2, r4
add r0, r0, r3 add r0, r0, r3
pop {r4, r5} pop {r4, r5}
END(__strcat_chk) .cfi_adjust_cfa_offset -8
.cfi_restore r4
.cfi_restore r5
#define MEMCPY_BASE __strcat_chk_memcpy_base
#define MEMCPY_BASE_ALIGNED __strcat_chk_memcpy_base_aligned
#include "memcpy_base.S" #include "memcpy_base.S"
ENTRY_PRIVATE(__strcat_chk_failed) // Undo the above cfi directives.
.cfi_def_cfa_offset 8
.cfi_rel_offset r0, 0
.cfi_rel_offset lr, 4
.cfi_adjust_cfa_offset 8 .cfi_adjust_cfa_offset 8
.cfi_rel_offset r4, 0 .cfi_rel_offset r4, 0
.cfi_rel_offset r5, 4 .cfi_rel_offset r5, 4
.L_strcat_chk_failed:
ldr r0, error_message ldr r0, error_message
ldr r1, error_code ldr r1, error_code
1: 1:
@ -208,7 +205,7 @@ error_code:
.word BIONIC_EVENT_STRCAT_BUFFER_OVERFLOW .word BIONIC_EVENT_STRCAT_BUFFER_OVERFLOW
error_message: error_message:
.word error_string-(1b+4) .word error_string-(1b+4)
END(__strcat_chk_failed) END(__strcat_chk)
.data .data
error_string: error_string:

View File

@ -39,7 +39,7 @@
ENTRY(__strcpy_chk) ENTRY(__strcpy_chk)
pld [r0, #0] pld [r0, #0]
push {r0, lr} push {r0, lr}
.cfi_def_cfa_offset 8 .cfi_adjust_cfa_offset 8
.cfi_rel_offset r0, 0 .cfi_rel_offset r0, 0
.cfi_rel_offset lr, 4 .cfi_rel_offset lr, 4
@ -149,21 +149,14 @@ ENTRY(__strcpy_chk)
pld [r1, #64] pld [r1, #64]
ldr r0, [sp] ldr r0, [sp]
cmp r3, lr cmp r3, lr
bhs __strcpy_chk_failed bhs .L_strcpy_chk_failed
// Add 1 for copy length to get the string terminator. // Add 1 for copy length to get the string terminator.
add r2, r3, #1 add r2, r3, #1
END(__strcpy_chk)
#define MEMCPY_BASE __strcpy_chk_memcpy_base
#define MEMCPY_BASE_ALIGNED __strcpy_chk_memcpy_base_aligned
#include "memcpy_base.S" #include "memcpy_base.S"
ENTRY_PRIVATE(__strcpy_chk_failed) .L_strcpy_chk_failed:
.cfi_def_cfa_offset 8
.cfi_rel_offset r0, 0
.cfi_rel_offset lr, 4
ldr r0, error_message ldr r0, error_message
ldr r1, error_code ldr r1, error_code
1: 1:
@ -173,7 +166,7 @@ error_code:
.word BIONIC_EVENT_STRCPY_BUFFER_OVERFLOW .word BIONIC_EVENT_STRCPY_BUFFER_OVERFLOW
error_message: error_message:
.word error_string-(1b+4) .word error_string-(1b+4)
END(__strcpy_chk_failed) END(__strcpy_chk)
.data .data
error_string: error_string:

View File

@ -45,7 +45,7 @@
ENTRY(__memcpy_chk) ENTRY(__memcpy_chk)
cmp r2, r3 cmp r2, r3
bhi __memcpy_chk_fail bhi .L_memcpy_chk_fail
// Fall through to memcpy... // Fall through to memcpy...
END(__memcpy_chk) END(__memcpy_chk)
@ -53,19 +53,20 @@ END(__memcpy_chk)
ENTRY(memcpy) ENTRY(memcpy)
pld [r1, #64] pld [r1, #64]
stmfd sp!, {r0, lr} stmfd sp!, {r0, lr}
.cfi_def_cfa_offset 8 .cfi_adjust_cfa_offset 8
.cfi_rel_offset r0, 0 .cfi_rel_offset r0, 0
.cfi_rel_offset lr, 4 .cfi_rel_offset lr, 4
END(memcpy)
#define MEMCPY_BASE __memcpy_base
#define MEMCPY_BASE_ALIGNED __memcpy_base_aligned
#include "memcpy_base.S" #include "memcpy_base.S"
ENTRY_PRIVATE(__memcpy_chk_fail) // Undo the cfi directives from above.
.cfi_adjust_cfa_offset -8
.cfi_restore r0
.cfi_restore lr
.L_memcpy_chk_fail:
// Preserve lr for backtrace. // Preserve lr for backtrace.
push {lr} push {lr}
.cfi_def_cfa_offset 4 .cfi_adjust_cfa_offset 4
.cfi_rel_offset lr, 0 .cfi_rel_offset lr, 0
ldr r0, error_message ldr r0, error_message
@ -77,7 +78,7 @@ error_code:
.word BIONIC_EVENT_MEMCPY_BUFFER_OVERFLOW .word BIONIC_EVENT_MEMCPY_BUFFER_OVERFLOW
error_message: error_message:
.word error_string-(1b+4) .word error_string-(1b+4)
END(__memcpy_chk_fail) END(memcpy)
.data .data
error_string: error_string:

View File

@ -1,123 +1,191 @@
/* /***************************************************************************
* Copyright (C) 2013 The Android Open Source Project Copyright (c) 2009-2013 The Linux Foundation. All rights reserved.
* 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.
*/
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.
* Neither the name of The Linux Foundation nor the names of its contributors may
be used to endorse or promote products derived from this software
without specific prior written permission.
/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* This code assumes it is running on a processor that supports all arm v7 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* instructions, that supports neon instructions, and that has a 32 byte IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* cache line. ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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.
***************************************************************************/
// Assumes neon instructions and a cache line size of 32 bytes. /* Assumes neon instructions and a cache line size of 64 bytes. */
ENTRY_PRIVATE(MEMCPY_BASE) #include <machine/cpu-features.h>
.cfi_def_cfa_offset 8 #include <machine/asm.h>
.cfi_rel_offset r0, 0
.cfi_rel_offset lr, 4
/* do we have at least 16-bytes to copy (needed for alignment below) */ #define PLDOFFS (10)
cmp r2, #16 #define PLDTHRESH (PLDOFFS)
blo 5f #define BBTHRESH (4096/64)
#define PLDSIZE (64)
/* align destination to cache-line for the write-buffer */ #if (PLDOFFS < 1)
rsb r3, r0, #0 #error Routine does not support offsets less than 1
ands r3, r3, #0xF #endif
beq 2f
/* copy up to 15-bytes (count in r3) */ #if (PLDTHRESH < PLDOFFS)
sub r2, r2, r3 #error PLD threshold must be greater than or equal to the PLD offset
movs ip, r3, lsl #31 #endif
itt mi
ldrbmi lr, [r1], #1
strbmi lr, [r0], #1
itttt cs
ldrbcs ip, [r1], #1
ldrbcs lr, [r1], #1
strbcs ip, [r0], #1
strbcs lr, [r0], #1
movs ip, r3, lsl #29
bge 1f
// copies 4 bytes, destination 32-bits aligned
vld4.8 {d0[0], d1[0], d2[0], d3[0]}, [r1]!
vst4.8 {d0[0], d1[0], d2[0], d3[0]}, [r0, :32]!
1: bcc 2f
// copies 8 bytes, destination 64-bits aligned
vld1.8 {d0}, [r1]!
vst1.8 {d0}, [r0, :64]!
2: /* make sure we have at least 64 bytes to copy */ .text
subs r2, r2, #64 .fpu neon
blo 2f
1: /* The main loop copies 64 bytes at a time */ .L_memcpy_base:
vld1.8 {d0 - d3}, [r1]! cmp r2, #4
vld1.8 {d4 - d7}, [r1]! blt .L_neon_lt4
pld [r1, #(32*8)] cmp r2, #16
subs r2, r2, #64 blt .L_neon_lt16
vst1.8 {d0 - d3}, [r0, :128]! cmp r2, #32
vst1.8 {d4 - d7}, [r0, :128]! blt .L_neon_16
bhs 1b cmp r2, #64
blt .L_neon_copy_32_a
2: /* fix-up the remaining count and make sure we have >= 32 bytes left */ mov r12, r2, lsr #6
adds r2, r2, #32 cmp r12, #PLDTHRESH
blo 4f ble .L_neon_copy_64_loop_nopld
/* Copy 32 bytes. These cache lines were already preloaded */ push {r9, r10}
vld1.8 {d0 - d3}, [r1]! .cfi_adjust_cfa_offset 8
sub r2, r2, #32 .cfi_rel_offset r9, 0
vst1.8 {d0 - d3}, [r0, :128]! .cfi_rel_offset r10, 4
4: /* less than 32 left */ cmp r12, #BBTHRESH
add r2, r2, #32 ble .L_neon_prime_pump
tst r2, #0x10
beq 5f
// copies 16 bytes, 128-bits aligned
vld1.8 {d0, d1}, [r1]!
vst1.8 {d0, d1}, [r0, :128]!
5: /* copy up to 15-bytes (count in r2) */ add lr, r0, #0x400
movs ip, r2, lsl #29 add r9, r1, #(PLDOFFS*PLDSIZE)
bcc 1f sub lr, lr, r9
vld1.8 {d0}, [r1]! lsl lr, lr, #21
vst1.8 {d0}, [r0]! lsr lr, lr, #21
1: bge 2f add lr, lr, #(PLDOFFS*PLDSIZE)
vld4.8 {d0[0], d1[0], d2[0], d3[0]}, [r1]! cmp r12, lr, lsr #6
vst4.8 {d0[0], d1[0], d2[0], d3[0]}, [r0]! ble .L_neon_prime_pump
2: movs ip, r2, lsl #31
itt mi
ldrbmi r3, [r1], #1
strbmi r3, [r0], #1
itttt cs
ldrbcs ip, [r1], #1
ldrbcs lr, [r1], #1
strbcs ip, [r0], #1
strbcs lr, [r0], #1
ldmfd sp!, {r0, lr} itt gt
bx lr movgt r9, #(PLDOFFS)
END(MEMCPY_BASE) rsbsgt r9, r9, lr, lsr #6
ble .L_neon_prime_pump
add r10, r1, lr
bic r10, #0x3F
sub r12, r12, lr, lsr #6
cmp r9, r12
itee le
suble r12, r12, r9
movgt r9, r12
movgt r12, #0
pld [r1, #((PLDOFFS-1)*PLDSIZE)]
.L_neon_copy_64_loop_outer_doublepld:
pld [r1, #((PLDOFFS)*PLDSIZE)]
vld1.32 {q0, q1}, [r1]!
vld1.32 {q2, q3}, [r1]!
ldr r3, [r10]
subs r9, r9, #1
vst1.32 {q0, q1}, [r0]!
vst1.32 {q2, q3}, [r0]!
add r10, #64
bne .L_neon_copy_64_loop_outer_doublepld
cmp r12, #0
beq .L_neon_pop_before_nopld
cmp r12, #(512*1024/64)
blt .L_neon_copy_64_loop_outer
.L_neon_copy_64_loop_ddr:
vld1.32 {q0, q1}, [r1]!
vld1.32 {q2, q3}, [r1]!
pld [r10]
subs r12, r12, #1
vst1.32 {q0, q1}, [r0]!
vst1.32 {q2, q3}, [r0]!
add r10, #64
bne .L_neon_copy_64_loop_ddr
b .L_neon_pop_before_nopld
.L_neon_prime_pump:
mov lr, #(PLDOFFS*PLDSIZE)
add r10, r1, #(PLDOFFS*PLDSIZE)
bic r10, #0x3F
sub r12, r12, #PLDOFFS
ldr r3, [r10, #(-1*PLDSIZE)]
.L_neon_copy_64_loop_outer:
vld1.32 {q0, q1}, [r1]!
vld1.32 {q2, q3}, [r1]!
ldr r3, [r10]
subs r12, r12, #1
vst1.32 {q0, q1}, [r0]!
vst1.32 {q2, q3}, [r0]!
add r10, #64
bne .L_neon_copy_64_loop_outer
.L_neon_pop_before_nopld:
mov r12, lr, lsr #6
pop {r9, r10}
.cfi_adjust_cfa_offset -8
.cfi_restore r9
.cfi_restore r10
.L_neon_copy_64_loop_nopld:
vld1.32 {q8, q9}, [r1]!
vld1.32 {q10, q11}, [r1]!
subs r12, r12, #1
vst1.32 {q8, q9}, [r0]!
vst1.32 {q10, q11}, [r0]!
bne .L_neon_copy_64_loop_nopld
ands r2, r2, #0x3f
beq .L_neon_exit
.L_neon_copy_32_a:
movs r3, r2, lsl #27
bcc .L_neon_16
vld1.32 {q0,q1}, [r1]!
vst1.32 {q0,q1}, [r0]!
.L_neon_16:
bpl .L_neon_lt16
vld1.32 {q8}, [r1]!
vst1.32 {q8}, [r0]!
ands r2, r2, #0x0f
beq .L_neon_exit
.L_neon_lt16:
movs r3, r2, lsl #29
bcc 1f
vld1.8 {d0}, [r1]!
vst1.8 {d0}, [r0]!
1:
bge .L_neon_lt4
vld4.8 {d0[0], d1[0], d2[0], d3[0]}, [r1]!
vst4.8 {d0[0], d1[0], d2[0], d3[0]}, [r0]!
.L_neon_lt4:
movs r2, r2, lsl #31
itt cs
ldrhcs r3, [r1], #2
strhcs r3, [r0], #2
itt mi
ldrbmi r3, [r1]
strbmi r3, [r0]
.L_neon_exit:
pop {r0, pc}

View File

@ -69,10 +69,7 @@ END(bzero)
/* memset() returns its first argument. */ /* memset() returns its first argument. */
ENTRY(memset) ENTRY(memset)
stmfd sp!, {r0} mov r3, r0
.cfi_def_cfa_offset 4
.cfi_rel_offset r0, 0
vdup.8 q0, r1 vdup.8 q0, r1
/* make sure we have at least 32 bytes to write */ /* make sure we have at least 32 bytes to write */
@ -82,7 +79,7 @@ ENTRY(memset)
1: /* The main loop writes 32 bytes at a time */ 1: /* The main loop writes 32 bytes at a time */
subs r2, r2, #32 subs r2, r2, #32
vst1.8 {d0 - d3}, [r0]! vst1.8 {d0 - d3}, [r3]!
bhs 1b bhs 1b
2: /* less than 32 left */ 2: /* less than 32 left */
@ -91,18 +88,17 @@ ENTRY(memset)
beq 3f beq 3f
// writes 16 bytes, 128-bits aligned // writes 16 bytes, 128-bits aligned
vst1.8 {d0, d1}, [r0]! vst1.8 {d0, d1}, [r3]!
3: /* write up to 15-bytes (count in r2) */ 3: /* write up to 15-bytes (count in r2) */
movs ip, r2, lsl #29 movs ip, r2, lsl #29
bcc 1f bcc 1f
vst1.8 {d0}, [r0]! vst1.8 {d0}, [r3]!
1: bge 2f 1: bge 2f
vst1.32 {d0[0]}, [r0]! vst1.32 {d0[0]}, [r3]!
2: movs ip, r2, lsl #31 2: movs ip, r2, lsl #31
strbmi r1, [r0], #1 strbmi r1, [r3], #1
strbcs r1, [r0], #1 strbcs r1, [r3], #1
strbcs r1, [r0], #1 strbcs r1, [r3], #1
ldmfd sp!, {r0}
bx lr bx lr
END(memset) END(memset)

View File

@ -1,3 +1,18 @@
libc_openbsd_src_files_exclude_arm += \
upstream-openbsd/lib/libc/string/memmove.c \
upstream-openbsd/lib/libc/string/stpcpy.c \
upstream-openbsd/lib/libc/string/stpcpy.c \
upstream-openbsd/lib/libc/string/strcat.c \
libc_bionic_src_files_exclude_arm += \
arch-arm/generic/bionic/memcpy.S \
arch-arm/generic/bionic/memset.S \
arch-arm/generic/bionic/strcmp.S \
arch-arm/generic/bionic/strcpy.S \
arch-arm/generic/bionic/strlen.c \
bionic/__strcat_chk.cpp \
bionic/__strcpy_chk.cpp \
libc_bionic_src_files_arm += \ libc_bionic_src_files_arm += \
arch-arm/krait/bionic/memcpy.S \ arch-arm/krait/bionic/memcpy.S \
arch-arm/krait/bionic/memset.S \ arch-arm/krait/bionic/memset.S \
@ -12,8 +27,5 @@ libc_bionic_src_files_arm += \
arch-arm/cortex-a15/bionic/strcpy.S \ arch-arm/cortex-a15/bionic/strcpy.S \
arch-arm/cortex-a15/bionic/strlen.S \ arch-arm/cortex-a15/bionic/strlen.S \
libc_bionic_src_files_arm += \
arch-arm/generic/bionic/memcmp.S \
libc_bionic_src_files_arm += \ libc_bionic_src_files_arm += \
arch-arm/denver/bionic/memmove.S \ arch-arm/denver/bionic/memmove.S \

View File

@ -2,7 +2,7 @@
#include <private/bionic_asm.h> #include <private/bionic_asm.h>
ENTRY(flistxattr) ENTRY(___flistxattr)
mov ip, r7 mov ip, r7
ldr r7, =__NR_flistxattr ldr r7, =__NR_flistxattr
swi #0 swi #0
@ -11,4 +11,5 @@ ENTRY(flistxattr)
bxls lr bxls lr
neg r0, r0 neg r0, r0
b __set_errno_internal b __set_errno_internal
END(flistxattr) END(___flistxattr)
.hidden ___flistxattr

View File

@ -0,0 +1,23 @@
/* Generated by gensyscalls.py. Do not edit. */
#include <private/bionic_asm.h>
ENTRY(___mremap)
mov ip, sp
stmfd sp!, {r4, r5, r6, r7}
.cfi_def_cfa_offset 16
.cfi_rel_offset r4, 0
.cfi_rel_offset r5, 4
.cfi_rel_offset r6, 8
.cfi_rel_offset r7, 12
ldmfd ip, {r4, r5, r6}
ldr r7, =__NR_mremap
swi #0
ldmfd sp!, {r4, r5, r6, r7}
.cfi_def_cfa_offset 0
cmn r0, #(MAX_ERRNO + 1)
bxls lr
neg r0, r0
b __set_errno_internal
END(___mremap)
.hidden ___mremap

View File

@ -0,0 +1,22 @@
/* Generated by gensyscalls.py. Do not edit. */
#include <private/bionic_asm.h>
ENTRY(__preadv64)
mov ip, sp
stmfd sp!, {r4, r5, r6, r7}
.cfi_def_cfa_offset 16
.cfi_rel_offset r4, 0
.cfi_rel_offset r5, 4
.cfi_rel_offset r6, 8
.cfi_rel_offset r7, 12
ldmfd ip, {r4, r5, r6}
ldr r7, =__NR_preadv
swi #0
ldmfd sp!, {r4, r5, r6, r7}
.cfi_def_cfa_offset 0
cmn r0, #(MAX_ERRNO + 1)
bxls lr
neg r0, r0
b __set_errno_internal
END(__preadv64)

View File

@ -0,0 +1,22 @@
/* Generated by gensyscalls.py. Do not edit. */
#include <private/bionic_asm.h>
ENTRY(__pwritev64)
mov ip, sp
stmfd sp!, {r4, r5, r6, r7}
.cfi_def_cfa_offset 16
.cfi_rel_offset r4, 0
.cfi_rel_offset r5, 4
.cfi_rel_offset r6, 8
.cfi_rel_offset r7, 12
ldmfd ip, {r4, r5, r6}
ldr r7, =__NR_pwritev
swi #0
ldmfd sp!, {r4, r5, r6, r7}
.cfi_def_cfa_offset 0
cmn r0, #(MAX_ERRNO + 1)
bxls lr
neg r0, r0
b __set_errno_internal
END(__pwritev64)

View File

@ -1,14 +0,0 @@
/* Generated by gensyscalls.py. Do not edit. */
#include <private/bionic_asm.h>
ENTRY(mremap)
mov ip, r7
ldr r7, =__NR_mremap
swi #0
mov r7, ip
cmn r0, #(MAX_ERRNO + 1)
bxls lr
neg r0, r0
b __set_errno_internal
END(mremap)

View File

@ -1,14 +0,0 @@
/* Generated by gensyscalls.py. Do not edit. */
#include <private/bionic_asm.h>
ENTRY(vfork)
mov ip, r7
ldr r7, =__NR_vfork
swi #0
mov r7, ip
cmn r0, #(MAX_ERRNO + 1)
bxls lr
neg r0, r0
b __set_errno_internal
END(vfork)

View File

@ -1,32 +1,38 @@
# 64-bit arm. # 64-bit arm.
# #
# Default implementations of functions that are commonly optimized. # Generic arm64 optimizations, may be overriden by CPU variants.
# #
libc_bionic_src_files_arm64 += \ libc_bionic_src_files_arm64 += \
bionic/__memset_chk.cpp \ arch-arm64/generic/bionic/memchr.S \
bionic/__strcpy_chk.cpp \ arch-arm64/generic/bionic/memcmp.S \
bionic/__strcat_chk.cpp \ arch-arm64/generic/bionic/memcpy.S \
bionic/strrchr.cpp \ arch-arm64/generic/bionic/memmove.S \
arch-arm64/generic/bionic/memset.S \
arch-arm64/generic/bionic/stpcpy.S \
arch-arm64/generic/bionic/strchr.S \
arch-arm64/generic/bionic/strcmp.S \
arch-arm64/generic/bionic/strcpy.S \
arch-arm64/generic/bionic/strlen.S \
arch-arm64/generic/bionic/strncmp.S \
arch-arm64/generic/bionic/strnlen.S \
arch-arm64/generic/bionic/wmemmove.S \
libc_freebsd_src_files_arm64 += \ libc_bionic_src_files_exclude_arm64 += \
upstream-freebsd/lib/libc/string/wcscat.c \ bionic/__memcpy_chk.cpp \
upstream-freebsd/lib/libc/string/wcschr.c \ bionic/strchr.cpp \
upstream-freebsd/lib/libc/string/wcscmp.c \ bionic/strnlen.c \
upstream-freebsd/lib/libc/string/wcscpy.c \
upstream-freebsd/lib/libc/string/wcslen.c \
upstream-freebsd/lib/libc/string/wcsrchr.c \
upstream-freebsd/lib/libc/string/wmemcmp.c \
libc_openbsd_src_files_arm64 += \ libc_freebsd_src_files_exclude_arm64 += \
upstream-openbsd/lib/libc/string/memrchr.c \ upstream-freebsd/lib/libc/string/wmemmove.c \
upstream-openbsd/lib/libc/string/stpncpy.c \
upstream-openbsd/lib/libc/string/strcat.c \ libc_openbsd_src_files_exclude_arm64 += \
upstream-openbsd/lib/libc/string/strlcat.c \ upstream-openbsd/lib/libc/string/memchr.c \
upstream-openbsd/lib/libc/string/strlcpy.c \ upstream-openbsd/lib/libc/string/memmove.c \
upstream-openbsd/lib/libc/string/strncat.c \ upstream-openbsd/lib/libc/string/stpcpy.c \
upstream-openbsd/lib/libc/string/strncpy.c \ upstream-openbsd/lib/libc/string/strcpy.c \
upstream-openbsd/lib/libc/string/strncmp.c \
# #
# Inherently architecture-specific code. # Inherently architecture-specific code.
@ -36,7 +42,6 @@ libc_bionic_src_files_arm64 += \
arch-arm64/bionic/__bionic_clone.S \ arch-arm64/bionic/__bionic_clone.S \
arch-arm64/bionic/_exit_with_stack_teardown.S \ arch-arm64/bionic/_exit_with_stack_teardown.S \
arch-arm64/bionic/setjmp.S \ arch-arm64/bionic/setjmp.S \
arch-arm64/bionic/__set_tls.c \
arch-arm64/bionic/syscall.S \ arch-arm64/bionic/syscall.S \
arch-arm64/bionic/vfork.S \ arch-arm64/bionic/vfork.S \
@ -54,6 +59,7 @@ libc_crt_target_crtbegin_so_file_arm64 := \
ifeq ($(strip $(TARGET_CPU_VARIANT)),) ifeq ($(strip $(TARGET_CPU_VARIANT)),)
$(warning TARGET_ARCH is arm64, but TARGET_CPU_VARIANT is not defined) $(warning TARGET_ARCH is arm64, but TARGET_CPU_VARIANT is not defined)
endif endif
ifneq ($(TARGET_CPU_VARIANT),generic)
cpu_variant_mk := $(LOCAL_PATH)/arch-arm64/$(TARGET_CPU_VARIANT)/$(TARGET_CPU_VARIANT).mk cpu_variant_mk := $(LOCAL_PATH)/arch-arm64/$(TARGET_CPU_VARIANT)/$(TARGET_CPU_VARIANT).mk
ifeq ($(wildcard $(cpu_variant_mk)),) ifeq ($(wildcard $(cpu_variant_mk)),)
$(error "TARGET_CPU_VARIANT not set or set to an unknown value. Possible values are generic, denver64. Use generic for devices that do not have a CPU similar to any of the supported cpu variants.") $(error "TARGET_CPU_VARIANT not set or set to an unknown value. Possible values are generic, denver64. Use generic for devices that do not have a CPU similar to any of the supported cpu variants.")
@ -62,3 +68,4 @@ include $(cpu_variant_mk)
libc_common_additional_dependencies += $(cpu_variant_mk) libc_common_additional_dependencies += $(cpu_variant_mk)
cpu_variant_mk := cpu_variant_mk :=
endif

View File

@ -52,6 +52,29 @@
#define _JB_D10_D11 (_JB_D12_D13 + 2) #define _JB_D10_D11 (_JB_D12_D13 + 2)
#define _JB_D8_D9 (_JB_D10_D11 + 2) #define _JB_D8_D9 (_JB_D10_D11 + 2)
#define MANGLE_REGISTERS 1
.macro m_mangle_registers reg, sp_reg
#if MANGLE_REGISTERS
eor x19, x19, \reg
eor x20, x20, \reg
eor x21, x21, \reg
eor x22, x22, \reg
eor x23, x23, \reg
eor x24, x24, \reg
eor x25, x25, \reg
eor x26, x26, \reg
eor x27, x27, \reg
eor x28, x28, \reg
eor x29, x29, \reg
eor x30, x30, \reg
eor \sp_reg, \sp_reg, \reg
#endif
.endm
.macro m_unmangle_registers reg, sp_reg
m_mangle_registers \reg, sp_reg=\sp_reg
.endm
ENTRY(setjmp) ENTRY(setjmp)
mov w1, #1 mov w1, #1
b sigsetjmp b sigsetjmp
@ -64,23 +87,47 @@ END(_setjmp)
// int sigsetjmp(sigjmp_buf env, int save_signal_mask); // int sigsetjmp(sigjmp_buf env, int save_signal_mask);
ENTRY(sigsetjmp) ENTRY(sigsetjmp)
// Record whether or not we're saving the signal mask. stp x0, x30, [sp, #-16]!
str w1, [x0, #(_JB_SIGFLAG * 8)] .cfi_def_cfa_offset 16
.cfi_rel_offset x0, 0
.cfi_rel_offset x30, 8
// Get the cookie and store it along with the signal flag.
mov x0, x1
bl __bionic_setjmp_cookie_get
mov x1, x0
ldr x0, [sp, #0]
str x1, [x0, #(_JB_SIGFLAG * 8)]
// Do we need to save the signal mask? // Do we need to save the signal mask?
cbz w1, 1f tbz w1, #0, 1f
// Save the cookie for later.
stp x1, xzr, [sp, #-16]!
.cfi_adjust_cfa_offset 16
// Save current signal mask. // Save current signal mask.
stp x0, x30, [sp, #-16]!
// The 'how' argument is ignored if new_mask is NULL. // The 'how' argument is ignored if new_mask is NULL.
mov x1, #0 // NULL. mov x1, #0 // NULL.
add x2, x0, #(_JB_SIGMASK * 8) // old_mask. add x2, x0, #(_JB_SIGMASK * 8) // old_mask.
bl sigprocmask bl sigprocmask
ldp x0, x30, [sp], #16
ldp x1, xzr, [sp], #16
.cfi_adjust_cfa_offset -16
1: 1:
// Restore original x0 and lr.
ldp x0, x30, [sp], #16
.cfi_adjust_cfa_offset -16
.cfi_restore x0
.cfi_restore x30
// Mask off the signal flag bit.
bic x1, x1, #1
// Save core registers. // Save core registers.
mov x10, sp mov x10, sp
m_mangle_registers x1, sp_reg=x10
stp x30, x10, [x0, #(_JB_X30_SP * 8)] stp x30, x10, [x0, #(_JB_X30_SP * 8)]
stp x28, x29, [x0, #(_JB_X28_X29 * 8)] stp x28, x29, [x0, #(_JB_X28_X29 * 8)]
stp x26, x27, [x0, #(_JB_X26_X27 * 8)] stp x26, x27, [x0, #(_JB_X26_X27 * 8)]
@ -88,6 +135,7 @@ ENTRY(sigsetjmp)
stp x22, x23, [x0, #(_JB_X22_X23 * 8)] stp x22, x23, [x0, #(_JB_X22_X23 * 8)]
stp x20, x21, [x0, #(_JB_X20_X21 * 8)] stp x20, x21, [x0, #(_JB_X20_X21 * 8)]
str x19, [x0, #(_JB_X19 * 8)] str x19, [x0, #(_JB_X19 * 8)]
m_unmangle_registers x1, sp_reg=x10
// Save floating point registers. // Save floating point registers.
stp d14, d15, [x0, #(_JB_D14_D15 * 8)] stp d14, d15, [x0, #(_JB_D14_D15 * 8)]
@ -102,30 +150,60 @@ END(sigsetjmp)
// void siglongjmp(sigjmp_buf env, int value); // void siglongjmp(sigjmp_buf env, int value);
ENTRY(siglongjmp) ENTRY(siglongjmp)
// Do we need to restore the signal mask? // Do we need to restore the signal mask?
ldr w9, [x0, #(_JB_SIGFLAG * 8)] ldr x2, [x0, #(_JB_SIGFLAG * 8)]
cbz w9, 1f tbz w2, #0, 1f
stp x0, x30, [sp, #-16]!
.cfi_adjust_cfa_offset 16
.cfi_rel_offset x0, 0
.cfi_rel_offset x30, 8
// Restore signal mask. // Restore signal mask.
stp x0, x30, [sp, #-16]!
mov x19, x1 // Save 'value'. mov x19, x1 // Save 'value'.
mov x2, x0 mov x2, x0
mov x0, #2 // SIG_SETMASK mov x0, #2 // SIG_SETMASK
add x1, x2, #(_JB_SIGMASK * 8) // new_mask. add x1, x2, #(_JB_SIGMASK * 8) // new_mask.
mov x2, #0 // NULL. mov x2, #0 // NULL.
bl sigprocmask bl sigprocmask
mov x1, x19 // Restore 'value'. mov x1, x19 // Restore 'value'.
ldp x0, x30, [sp], #16
// Restore original x0 and lr.
ldp x0, x30, [sp], #16
.cfi_adjust_cfa_offset -16
.cfi_restore x0
.cfi_restore x30
ldr x2, [x0, #(_JB_SIGFLAG * 8)]
1: 1:
// Restore core registers. // Restore core registers.
bic x2, x2, #1
ldp x30, x10, [x0, #(_JB_X30_SP * 8)] ldp x30, x10, [x0, #(_JB_X30_SP * 8)]
mov sp, x10
ldp x28, x29, [x0, #(_JB_X28_X29 * 8)] ldp x28, x29, [x0, #(_JB_X28_X29 * 8)]
ldp x26, x27, [x0, #(_JB_X26_X27 * 8)] ldp x26, x27, [x0, #(_JB_X26_X27 * 8)]
ldp x24, x25, [x0, #(_JB_X24_X25 * 8)] ldp x24, x25, [x0, #(_JB_X24_X25 * 8)]
ldp x22, x23, [x0, #(_JB_X22_X23 * 8)] ldp x22, x23, [x0, #(_JB_X22_X23 * 8)]
ldp x20, x21, [x0, #(_JB_X20_X21 * 8)] ldp x20, x21, [x0, #(_JB_X20_X21 * 8)]
ldr x19, [x0, #(_JB_X19 * 8)] ldr x19, [x0, #(_JB_X19 * 8)]
m_unmangle_registers x2, sp_reg=x10
mov sp, x10
stp x0, x1, [sp, #-16]!
.cfi_adjust_cfa_offset 16
.cfi_rel_offset x0, 0
.cfi_rel_offset x1, 8
stp x30, xzr, [sp, #-16]!
.cfi_adjust_cfa_offset 16
.cfi_rel_offset x30, 0
ldr x0, [x0, #(_JB_SIGFLAG * 8)]
bl __bionic_setjmp_cookie_check
ldp x30, xzr, [sp], #16
.cfi_adjust_cfa_offset -16
.cfi_restore x30
ldp x0, x1, [sp], #16
.cfi_adjust_cfa_offset -16
.cfi_restore x0
.cfi_restore x1
// Restore floating point registers. // Restore floating point registers.
ldp d14, d15, [x0, #(_JB_D14_D15 * 8)] ldp d14, d15, [x0, #(_JB_D14_D15 * 8)]
@ -133,13 +211,6 @@ ENTRY(siglongjmp)
ldp d10, d11, [x0, #(_JB_D10_D11 * 8)] ldp d10, d11, [x0, #(_JB_D10_D11 * 8)]
ldp d8, d9, [x0, #(_JB_D8_D9 * 8)] ldp d8, d9, [x0, #(_JB_D8_D9 * 8)]
// Validate sp (sp mod 16 = 0) and lr (lr mod 4 = 0).
tst x30, #3
b.ne longjmperror
mov x10, sp
tst x10, #15
b.ne longjmperror
// Set return value. // Set return value.
cmp w1, wzr cmp w1, wzr
csinc w0, w1, wzr, ne csinc w0, w1, wzr, ne

View File

@ -31,6 +31,11 @@
#include <linux/sched.h> #include <linux/sched.h>
ENTRY(vfork) ENTRY(vfork)
// __get_tls()[TLS_SLOT_THREAD_ID]->cached_pid_ = 0
mrs x0, tpidr_el0
ldr x0, [x0, #8]
str wzr, [x0, #20]
mov x0, #(CLONE_VM | CLONE_VFORK | SIGCHLD) mov x0, #(CLONE_VM | CLONE_VFORK | SIGCHLD)
mov x1, xzr mov x1, xzr
mov x2, xzr mov x2, xzr

View File

@ -1 +0,0 @@
include bionic/libc/arch-arm64/generic/generic.mk

View File

@ -1,14 +1,7 @@
libc_bionic_src_files_arm64 += \ libc_bionic_src_files_arm64 += \
arch-arm64/generic/bionic/memchr.S \
arch-arm64/generic/bionic/memcmp.S \
arch-arm64/denver64/bionic/memcpy.S \ arch-arm64/denver64/bionic/memcpy.S \
arch-arm64/generic/bionic/memmove.S \
arch-arm64/denver64/bionic/memset.S \ arch-arm64/denver64/bionic/memset.S \
arch-arm64/generic/bionic/stpcpy.S \
arch-arm64/generic/bionic/strchr.S \ libc_bionic_src_files_exclude_arm64 += \
arch-arm64/generic/bionic/strcmp.S \ arch-arm64/generic/bionic/memcpy.S \
arch-arm64/generic/bionic/strcpy.S \ arch-arm64/generic/bionic/memset.S \
arch-arm64/generic/bionic/strlen.S \
arch-arm64/generic/bionic/strncmp.S \
arch-arm64/generic/bionic/strnlen.S \
arch-arm64/generic/bionic/wmemmove.S

View File

@ -35,10 +35,6 @@
#include <private/bionic_asm.h> #include <private/bionic_asm.h>
/* Parameters and result. */ /* Parameters and result. */
#ifdef BCOPY
#define origdstin x1
#define origsrc x0
#endif
#define dstin x0 #define dstin x0
#define src x1 #define src x1
#define count x2 #define count x2
@ -59,13 +55,7 @@
#define D_l x13 #define D_l x13
#define D_h x14 #define D_h x14
#ifdef BCOPY #if defined(WMEMMOVE)
ENTRY(bcopy)
/* Swap src and dst so that a branch to memcpy doesn't cause issues. */
mov tmp1, origsrc
mov origsrc, origdstin
mov origdstin, tmp1
#elif defined(WMEMMOVE)
ENTRY(wmemmove) ENTRY(wmemmove)
lsl count, count, #2 lsl count, count, #2
#else #else
@ -332,9 +322,7 @@ ENTRY(memmove)
tst count, #0x3f tst count, #0x3f
b.ne .Ltail63down b.ne .Ltail63down
ret ret
#ifdef BCOPY #if defined(WMEMMOVE)
END(bcopy)
#elif defined(WMEMMOVE)
END(wmemmove) END(wmemmove)
#else #else
END(memmove) END(memmove)

View File

@ -1,14 +0,0 @@
libc_bionic_src_files_arm64 += \
arch-arm64/generic/bionic/memchr.S \
arch-arm64/generic/bionic/memcmp.S \
arch-arm64/generic/bionic/memcpy.S \
arch-arm64/generic/bionic/memmove.S \
arch-arm64/generic/bionic/memset.S \
arch-arm64/generic/bionic/stpcpy.S \
arch-arm64/generic/bionic/strchr.S \
arch-arm64/generic/bionic/strcmp.S \
arch-arm64/generic/bionic/strcpy.S \
arch-arm64/generic/bionic/strlen.S \
arch-arm64/generic/bionic/strncmp.S \
arch-arm64/generic/bionic/strnlen.S \
arch-arm64/generic/bionic/wmemmove.S

View File

@ -2,7 +2,7 @@
#include <private/bionic_asm.h> #include <private/bionic_asm.h>
ENTRY(flistxattr) ENTRY(___flistxattr)
mov x8, __NR_flistxattr mov x8, __NR_flistxattr
svc #0 svc #0
@ -11,4 +11,5 @@ ENTRY(flistxattr)
b.hi __set_errno_internal b.hi __set_errno_internal
ret ret
END(flistxattr) END(___flistxattr)
.hidden ___flistxattr

View File

@ -2,7 +2,7 @@
#include <private/bionic_asm.h> #include <private/bionic_asm.h>
ENTRY(mremap) ENTRY(___mremap)
mov x8, __NR_mremap mov x8, __NR_mremap
svc #0 svc #0
@ -11,4 +11,5 @@ ENTRY(mremap)
b.hi __set_errno_internal b.hi __set_errno_internal
ret ret
END(mremap) END(___mremap)
.hidden ___mremap

View File

@ -0,0 +1,16 @@
/* Generated by gensyscalls.py. Do not edit. */
#include <private/bionic_asm.h>
ENTRY(preadv)
mov x8, __NR_preadv
svc #0
cmn x0, #(MAX_ERRNO + 1)
cneg x0, x0, hi
b.hi __set_errno_internal
ret
END(preadv)
ALIAS_SYMBOL(preadv64, preadv)

View File

@ -0,0 +1,16 @@
/* Generated by gensyscalls.py. Do not edit. */
#include <private/bionic_asm.h>
ENTRY(pwritev)
mov x8, __NR_pwritev
svc #0
cmn x0, #(MAX_ERRNO + 1)
cneg x0, x0, hi
b.hi __set_errno_internal
ret
END(pwritev)
ALIAS_SYMBOL(pwritev64, pwritev)

View File

@ -132,10 +132,9 @@
/* field: byte offset: size: */ /* field: byte offset: size: */
/* dynam filler (0*4) 0-4 bytes of rounddown filler, DON'T TOUCH!! /* dynam filler (0*4) 0-4 bytes of rounddown filler, DON'T TOUCH!!
often overlays user storage!! */ often overlays user storage!! */
#define SC_MAGIC_OFFSET (1*4) /* 4 bytes, identify jmpbuf, first actual field */ #define SC_FPSR_OFFSET (1*4) /* 4 bytes, floating point control/status reg */
#define SC_FLAG_OFFSET (2*4) /* 4 bytes, savesigs flag */
#define SC_FPSR_OFFSET (3*4) /* 4 bytes, floating point control/status reg */
/* following fields are 8-byte aligned */ /* following fields are 8-byte aligned */
#define SC_FLAG_OFFSET (2*4) /* 8 bytes, cookie and savesigs flag, first actual field */
#define SC_MASK_OFFSET (4*4) /* 16 bytes, mips32/mips64 version of sigset_t */ #define SC_MASK_OFFSET (4*4) /* 16 bytes, mips32/mips64 version of sigset_t */
#define SC_SPARE_OFFSET (8*4) /* 8 bytes, reserved for future uses */ #define SC_SPARE_OFFSET (8*4) /* 8 bytes, reserved for future uses */
@ -166,6 +165,16 @@
#error _JBLEN is too small #error _JBLEN is too small
#endif #endif
.macro m_mangle_reg_and_store reg, cookie, temp, offset
xor \temp, \reg, \cookie
REG_S \temp, \offset
.endm
.macro m_unmangle_reg_and_load reg, cookie, temp, offset
REG_L \temp, \offset
xor \reg, \temp, \cookie
.endm
/* /*
* *
* GPOFF and FRAMESIZE must be the same for all setjmp/longjmp routines * GPOFF and FRAMESIZE must be the same for all setjmp/longjmp routines
@ -190,36 +199,46 @@ setjmp_common:
li t0, ~7 li t0, ~7
and a0, t0 # round jmpbuf addr DOWN to 8-byte boundary and a0, t0 # round jmpbuf addr DOWN to 8-byte boundary
#endif #endif
sw a1, SC_FLAG_OFFSET(a0) # save savesigs flag
beqz a1, 1f # do saving of signal mask?
REG_S ra, RAOFF(sp) # spill state REG_S ra, RAOFF(sp) # spill state
REG_S a0, A0OFF(sp) REG_S a0, A0OFF(sp)
# get the cookie and store it along with the signal flag.
move a0, a1
jal __bionic_setjmp_cookie_get
REG_L a0, A0OFF(sp)
REG_S v0, SC_FLAG_OFFSET(a0) # save cookie and savesigs flag
andi t0, v0, 1 # extract savesigs flag
beqz t0, 1f # do saving of signal mask?
# call sigprocmask(int how ignored, sigset_t* null, sigset_t* SC_MASK(a0)): # call sigprocmask(int how ignored, sigset_t* null, sigset_t* SC_MASK(a0)):
LA a2, SC_MASK_OFFSET(a0) # gets current signal mask LA a2, SC_MASK_OFFSET(a0) # gets current signal mask
li a0, 0 # how; ignored when new mask is null li a0, 0 # how; ignored when new mask is null
li a1, 0 # null new mask li a1, 0 # null new mask
jal sigprocmask # get current signal mask jal sigprocmask # get current signal mask
REG_L a0, A0OFF(sp) REG_L a0, A0OFF(sp)
REG_L ra, RAOFF(sp)
1: 1:
li v0, 0xACEDBADE # sigcontext magic number REG_L gp, GPOFF(sp) # restore spills
sw v0, SC_MAGIC_OFFSET(a0) REG_L ra, RAOFF(sp)
REG_L t0, SC_FLAG_OFFSET(a0) # move cookie to temp reg
# callee-saved long-sized regs: # callee-saved long-sized regs:
REG_S ra, SC_REGS+0*REGSZ(a0) PTR_ADDU v1, sp, FRAMESZ # save orig sp
REG_S s0, SC_REGS+1*REGSZ(a0)
REG_S s1, SC_REGS+2*REGSZ(a0) # m_mangle_reg_and_store reg, cookie, temp, offset
REG_S s2, SC_REGS+3*REGSZ(a0) m_mangle_reg_and_store ra, t0, t1, SC_REGS+0*REGSZ(a0)
REG_S s3, SC_REGS+4*REGSZ(a0) m_mangle_reg_and_store s0, t0, t2, SC_REGS+1*REGSZ(a0)
REG_S s4, SC_REGS+5*REGSZ(a0) m_mangle_reg_and_store s1, t0, t3, SC_REGS+2*REGSZ(a0)
REG_S s5, SC_REGS+6*REGSZ(a0) m_mangle_reg_and_store s2, t0, t1, SC_REGS+3*REGSZ(a0)
REG_S s6, SC_REGS+7*REGSZ(a0) m_mangle_reg_and_store s3, t0, t2, SC_REGS+4*REGSZ(a0)
REG_S s7, SC_REGS+8*REGSZ(a0) m_mangle_reg_and_store s4, t0, t3, SC_REGS+5*REGSZ(a0)
REG_S s8, SC_REGS+9*REGSZ(a0) m_mangle_reg_and_store s5, t0, t1, SC_REGS+6*REGSZ(a0)
REG_L v0, GPOFF(sp) m_mangle_reg_and_store s6, t0, t2, SC_REGS+7*REGSZ(a0)
REG_S v0, SC_REGS+10*REGSZ(a0) # save gp m_mangle_reg_and_store s7, t0, t3, SC_REGS+8*REGSZ(a0)
PTR_ADDU v0, sp, FRAMESZ m_mangle_reg_and_store s8, t0, t1, SC_REGS+9*REGSZ(a0)
REG_S v0, SC_REGS+11*REGSZ(a0) # save orig sp m_mangle_reg_and_store gp, t0, t2, SC_REGS+10*REGSZ(a0)
m_mangle_reg_and_store v1, t0, t3, SC_REGS+11*REGSZ(a0)
cfc1 v0, $31 cfc1 v0, $31
@ -288,36 +307,41 @@ NON_LEAF(siglongjmp, FRAMESZ, ra)
li t0, ~7 li t0, ~7
and a0, t0 # round jmpbuf addr DOWN to 8-byte boundary and a0, t0 # round jmpbuf addr DOWN to 8-byte boundary
#endif #endif
lw v0, SC_MAGIC_OFFSET(a0)
li t0, 0xACEDBADE
bne v0, t0, longjmp_botch # jump if error
lw t0, SC_FLAG_OFFSET(a0) # get savesigs flag move s1, a1 # temp spill
move s0, a0
# extract savesigs flag
REG_L s2, SC_FLAG_OFFSET(s0)
andi t0, s2, 1
beqz t0, 1f # restore signal mask? beqz t0, 1f # restore signal mask?
REG_S a1, A1OFF(sp) # temp spill # call sigprocmask(int how SIG_SETMASK, sigset_t* SC_MASK(a0), sigset_t* null):
REG_S a0, A0OFF(sp) LA a1, SC_MASK_OFFSET(s0) # signals being restored
# call sigprocmask(int how SIG_SETMASK, sigset_t* SC_MASK(a0), sigset_t* null):
LA a1, SC_MASK_OFFSET(a0) # signals being restored
li a0, 3 # mips SIG_SETMASK li a0, 3 # mips SIG_SETMASK
li a2, 0 # null li a2, 0 # null
jal sigprocmask # restore signal mask jal sigprocmask # restore signal mask
REG_L a0, A0OFF(sp)
REG_L a1, A1OFF(sp)
1: 1:
move t0, s2 # get cookie to temp reg
move a1, s1
move a0, s0
# callee-saved long-sized regs: # callee-saved long-sized regs:
REG_L ra, SC_REGS+0*REGSZ(a0)
REG_L s0, SC_REGS+1*REGSZ(a0) # m_unmangle_reg_and_load reg, cookie, temp, offset
REG_L s1, SC_REGS+2*REGSZ(a0) # don't restore gp yet, old value is needed for cookie_check call
REG_L s2, SC_REGS+3*REGSZ(a0) m_unmangle_reg_and_load ra, t0, t1, SC_REGS+0*REGSZ(a0)
REG_L s3, SC_REGS+4*REGSZ(a0) m_unmangle_reg_and_load s0, t0, t2, SC_REGS+1*REGSZ(a0)
REG_L s4, SC_REGS+5*REGSZ(a0) m_unmangle_reg_and_load s1, t0, t3, SC_REGS+2*REGSZ(a0)
REG_L s5, SC_REGS+6*REGSZ(a0) m_unmangle_reg_and_load s2, t0, t1, SC_REGS+3*REGSZ(a0)
REG_L s6, SC_REGS+7*REGSZ(a0) m_unmangle_reg_and_load s3, t0, t2, SC_REGS+4*REGSZ(a0)
REG_L s7, SC_REGS+8*REGSZ(a0) m_unmangle_reg_and_load s4, t0, t3, SC_REGS+5*REGSZ(a0)
REG_L s8, SC_REGS+9*REGSZ(a0) m_unmangle_reg_and_load s5, t0, t1, SC_REGS+6*REGSZ(a0)
REG_L gp, SC_REGS+10*REGSZ(a0) m_unmangle_reg_and_load s6, t0, t2, SC_REGS+7*REGSZ(a0)
REG_L sp, SC_REGS+11*REGSZ(a0) m_unmangle_reg_and_load s7, t0, t3, SC_REGS+8*REGSZ(a0)
m_unmangle_reg_and_load s8, t0, t1, SC_REGS+9*REGSZ(a0)
m_unmangle_reg_and_load v1, t0, t2, SC_REGS+10*REGSZ(a0)
m_unmangle_reg_and_load sp, t0, t3, SC_REGS+11*REGSZ(a0)
lw v0, SC_FPSR_OFFSET(a0) lw v0, SC_FPSR_OFFSET(a0)
ctc1 v0, $31 # restore old fr mode before fp values ctc1 v0, $31 # restore old fr mode before fp values
@ -341,15 +365,22 @@ NON_LEAF(siglongjmp, FRAMESZ, ra)
l.d $f28, SC_FPREGS+4*REGSZ_FP(a0) l.d $f28, SC_FPREGS+4*REGSZ_FP(a0)
l.d $f30, SC_FPREGS+5*REGSZ_FP(a0) l.d $f30, SC_FPREGS+5*REGSZ_FP(a0)
#endif #endif
bne a1, zero, 1f
li a1, 1 # never return 0!
1:
move v0, a1
j ra # return to setjmp call site
longjmp_botch: # check cookie
jal longjmperror PTR_SUBU sp, FRAMESZ
jal abort REG_S v1, GPOFF(sp)
REG_S ra, RAOFF(sp)
REG_S a1, A1OFF(sp)
move a0, t0
jal __bionic_setjmp_cookie_check
REG_L gp, GPOFF(sp)
REG_L ra, RAOFF(sp)
REG_L a1, A1OFF(sp)
PTR_ADDU sp, FRAMESZ
sltiu t0, a1, 1 # never return 0!
xor v0, a1, t0
j ra # return to setjmp call site
END(siglongjmp) END(siglongjmp)
ALIAS_SYMBOL(longjmp, siglongjmp) ALIAS_SYMBOL(longjmp, siglongjmp)

View File

@ -37,6 +37,14 @@ ENTRY(vfork)
.set noreorder .set noreorder
.cpload t9 .cpload t9
// __get_tls()[TLS_SLOT_THREAD_ID]->cached_pid_ = 0
.set push
.set mips32r2
rdhwr v0, $29 // v0 = tls; kernel trap on mips32r1
.set pop
lw v0, REGSZ*1(v0) // v0 = v0[TLS_SLOT_THREAD_ID ie 1]
sw $0, REGSZ*2+4(v0) // v0->cached_pid_ = 0
li a0, (CLONE_VM | CLONE_VFORK | SIGCHLD) li a0, (CLONE_VM | CLONE_VFORK | SIGCHLD)
li a1, 0 li a1, 0
li a2, 0 li a2, 0

View File

@ -1,45 +1,10 @@
# 32-bit mips. # 32-bit mips.
#
# Default implementations of functions that are commonly optimized.
#
libc_bionic_src_files_mips += \ libc_bionic_src_files_mips += \
arch-mips/string/memcmp.c \ arch-mips/string/memcmp.c \
arch-mips/string/memcpy.S \ arch-mips/string/memcpy.S \
arch-mips/string/memset.S \ arch-mips/string/memset.S \
arch-mips/string/strcmp.S \ arch-mips/string/strcmp.S \
bionic/__memcpy_chk.cpp \
bionic/__memset_chk.cpp \
bionic/__strcpy_chk.cpp \
bionic/__strcat_chk.cpp \
bionic/strchr.cpp \
bionic/strnlen.c \
bionic/strrchr.cpp \
libc_freebsd_src_files_mips += \
upstream-freebsd/lib/libc/string/wcscat.c \
upstream-freebsd/lib/libc/string/wcschr.c \
upstream-freebsd/lib/libc/string/wcscmp.c \
upstream-freebsd/lib/libc/string/wcscpy.c \
upstream-freebsd/lib/libc/string/wcslen.c \
upstream-freebsd/lib/libc/string/wcsrchr.c \
upstream-freebsd/lib/libc/string/wmemcmp.c \
upstream-freebsd/lib/libc/string/wmemmove.c \
libc_openbsd_src_files_mips += \
upstream-openbsd/lib/libc/string/memchr.c \
upstream-openbsd/lib/libc/string/memmove.c \
upstream-openbsd/lib/libc/string/memrchr.c \
upstream-openbsd/lib/libc/string/stpcpy.c \
upstream-openbsd/lib/libc/string/stpncpy.c \
upstream-openbsd/lib/libc/string/strcat.c \
upstream-openbsd/lib/libc/string/strcpy.c \
upstream-openbsd/lib/libc/string/strlcat.c \
upstream-openbsd/lib/libc/string/strlcpy.c \
upstream-openbsd/lib/libc/string/strncat.c \
upstream-openbsd/lib/libc/string/strncmp.c \
upstream-openbsd/lib/libc/string/strncpy.c \
# #
# Inherently architecture-specific code. # Inherently architecture-specific code.

View File

@ -2,7 +2,7 @@
#include <private/bionic_asm.h> #include <private/bionic_asm.h>
ENTRY(flistxattr) ENTRY(___flistxattr)
.set noreorder .set noreorder
.cpload t9 .cpload t9
li v0, __NR_flistxattr li v0, __NR_flistxattr
@ -16,4 +16,5 @@ ENTRY(flistxattr)
j t9 j t9
nop nop
.set reorder .set reorder
END(flistxattr) END(___flistxattr)
.hidden ___flistxattr

View File

@ -2,7 +2,7 @@
#include <private/bionic_asm.h> #include <private/bionic_asm.h>
ENTRY(mremap) ENTRY(___mremap)
.set noreorder .set noreorder
.cpload t9 .cpload t9
li v0, __NR_mremap li v0, __NR_mremap
@ -16,4 +16,5 @@ ENTRY(mremap)
j t9 j t9
nop nop
.set reorder .set reorder
END(mremap) END(___mremap)
.hidden ___mremap

View File

@ -0,0 +1,19 @@
/* Generated by gensyscalls.py. Do not edit. */
#include <private/bionic_asm.h>
ENTRY(__preadv64)
.set noreorder
.cpload t9
li v0, __NR_preadv
syscall
bnez a3, 1f
move a0, v0
j ra
nop
1:
la t9,__set_errno_internal
j t9
nop
.set reorder
END(__preadv64)

View File

@ -0,0 +1,19 @@
/* Generated by gensyscalls.py. Do not edit. */
#include <private/bionic_asm.h>
ENTRY(__pwritev64)
.set noreorder
.cpload t9
li v0, __NR_pwritev
syscall
bnez a3, 1f
move a0, v0
j ra
nop
1:
la t9,__set_errno_internal
j t9
nop
.set reorder
END(__pwritev64)

View File

@ -46,6 +46,12 @@ LEAF(vfork,FRAMESZ)
PTR_SUBU sp, FRAMESZ PTR_SUBU sp, FRAMESZ
#endif #endif
SETUP_GP64(a5, vfork) SETUP_GP64(a5, vfork)
// __get_tls()[TLS_SLOT_THREAD_ID]->cached_pid_ = 0
rdhwr v0, $29 // v0 = tls
REG_L v0, REGSZ*1(v0) // v0 = v0[TLS_SLOT_THREAD_ID ie 1]
sw $0, REGSZ*2+4(v0) // v0->cached_pid_ = 0
LI a0, (CLONE_VM | CLONE_VFORK | SIGCHLD) LI a0, (CLONE_VM | CLONE_VFORK | SIGCHLD)
move a1, $0 move a1, $0
move a2, $0 move a2, $0

View File

@ -1,46 +1,11 @@
# 64-bit mips. # 64-bit mips.
#
# Default implementations of functions that are commonly optimized.
#
libc_bionic_src_files_mips64 += \ libc_bionic_src_files_mips64 += \
arch-mips/string/memcmp.c \ arch-mips/string/memcmp.c \
arch-mips/string/memcpy.S \ arch-mips/string/memcpy.S \
arch-mips/string/memset.S \ arch-mips/string/memset.S \
arch-mips/string/strcmp.S \ arch-mips/string/strcmp.S \
arch-mips/string/strlen.c \ arch-mips/string/strlen.c \
bionic/__memcpy_chk.cpp \
bionic/__memset_chk.cpp \
bionic/__strcpy_chk.cpp \
bionic/__strcat_chk.cpp \
bionic/strchr.cpp \
bionic/strnlen.c \
bionic/strrchr.cpp \
libc_freebsd_src_files_mips64 += \
upstream-freebsd/lib/libc/string/wcscat.c \
upstream-freebsd/lib/libc/string/wcschr.c \
upstream-freebsd/lib/libc/string/wcscmp.c \
upstream-freebsd/lib/libc/string/wcscpy.c \
upstream-freebsd/lib/libc/string/wcslen.c \
upstream-freebsd/lib/libc/string/wcsrchr.c \
upstream-freebsd/lib/libc/string/wmemcmp.c \
upstream-freebsd/lib/libc/string/wmemmove.c \
libc_openbsd_src_files_mips64 += \
upstream-openbsd/lib/libc/string/memchr.c \
upstream-openbsd/lib/libc/string/memmove.c \
upstream-openbsd/lib/libc/string/memrchr.c \
upstream-openbsd/lib/libc/string/stpcpy.c \
upstream-openbsd/lib/libc/string/stpncpy.c \
upstream-openbsd/lib/libc/string/strcat.c \
upstream-openbsd/lib/libc/string/strcpy.c \
upstream-openbsd/lib/libc/string/strlcat.c \
upstream-openbsd/lib/libc/string/strlcpy.c \
upstream-openbsd/lib/libc/string/strncat.c \
upstream-openbsd/lib/libc/string/strncmp.c \
upstream-openbsd/lib/libc/string/strncpy.c \
# #
# Inherently architecture-specific code. # Inherently architecture-specific code.

View File

@ -2,7 +2,7 @@
#include <private/bionic_asm.h> #include <private/bionic_asm.h>
ENTRY(flistxattr) ENTRY(___flistxattr)
.set push .set push
.set noreorder .set noreorder
li v0, __NR_flistxattr li v0, __NR_flistxattr
@ -22,4 +22,5 @@ ENTRY(flistxattr)
j t9 j t9
move ra, t0 move ra, t0
.set pop .set pop
END(flistxattr) END(___flistxattr)
.hidden ___flistxattr

View File

@ -2,7 +2,7 @@
#include <private/bionic_asm.h> #include <private/bionic_asm.h>
ENTRY(mremap) ENTRY(___mremap)
.set push .set push
.set noreorder .set noreorder
li v0, __NR_mremap li v0, __NR_mremap
@ -22,4 +22,5 @@ ENTRY(mremap)
j t9 j t9
move ra, t0 move ra, t0
.set pop .set pop
END(mremap) END(___mremap)
.hidden ___mremap

View File

@ -0,0 +1,27 @@
/* Generated by gensyscalls.py. Do not edit. */
#include <private/bionic_asm.h>
ENTRY(preadv)
.set push
.set noreorder
li v0, __NR_preadv
syscall
bnez a3, 1f
move a0, v0
j ra
nop
1:
move t0, ra
bal 2f
nop
2:
.cpsetup ra, t1, 2b
LA t9,__set_errno_internal
.cpreturn
j t9
move ra, t0
.set pop
END(preadv)
ALIAS_SYMBOL(preadv64, preadv)

View File

@ -0,0 +1,27 @@
/* Generated by gensyscalls.py. Do not edit. */
#include <private/bionic_asm.h>
ENTRY(pwritev)
.set push
.set noreorder
li v0, __NR_pwritev
syscall
bnez a3, 1f
move a0, v0
j ra
nop
1:
move t0, ra
bal 2f
nop
2:
.cpsetup ra, t1, 2b
LA t9,__set_errno_internal
.cpreturn
j t9
move ra, t0
.set pop
END(pwritev)
ALIAS_SYMBOL(pwritev64, pwritev)

View File

@ -1,32 +1,27 @@
libc_bionic_src_files_x86 += \ libc_bionic_src_files_x86 += \
arch-x86/atom/string/sse2-bzero-atom.S \ arch-x86/atom/string/sse2-bzero-atom.S \
arch-x86/atom/string/sse2-memchr-atom.S \
arch-x86/atom/string/sse2-memrchr-atom.S \
arch-x86/atom/string/sse2-memset-atom.S \ arch-x86/atom/string/sse2-memset-atom.S \
arch-x86/atom/string/sse2-strchr-atom.S \
arch-x86/atom/string/sse2-strlen-atom.S \ arch-x86/atom/string/sse2-strlen-atom.S \
arch-x86/atom/string/sse2-strnlen-atom.S \
arch-x86/atom/string/sse2-strrchr-atom.S \
arch-x86/atom/string/sse2-wcschr-atom.S \
arch-x86/atom/string/sse2-wcsrchr-atom.S \
arch-x86/atom/string/sse2-wcslen-atom.S \
arch-x86/atom/string/sse2-wcscmp-atom.S \
arch-x86/atom/string/ssse3-bcopy-atom.S \ arch-x86/atom/string/ssse3-bcopy-atom.S \
arch-x86/atom/string/ssse3-memcmp-atom.S \ arch-x86/atom/string/ssse3-memcmp-atom.S \
arch-x86/atom/string/ssse3-memcpy-atom.S \ arch-x86/atom/string/ssse3-memcpy-atom.S \
arch-x86/atom/string/ssse3-memmove-atom.S \ arch-x86/atom/string/ssse3-memmove-atom.S \
arch-x86/atom/string/ssse3-strcat-atom.S \
arch-x86/atom/string/ssse3-strcmp-atom.S \
arch-x86/atom/string/ssse3-strcpy-atom.S \ arch-x86/atom/string/ssse3-strcpy-atom.S \
arch-x86/atom/string/ssse3-strlcat-atom.S \
arch-x86/atom/string/ssse3-strlcpy-atom.S \
arch-x86/atom/string/ssse3-strncat-atom.S \
arch-x86/atom/string/ssse3-strncmp-atom.S \
arch-x86/atom/string/ssse3-strncpy-atom.S \ arch-x86/atom/string/ssse3-strncpy-atom.S \
arch-x86/atom/string/ssse3-wcscat-atom.S \
arch-x86/atom/string/ssse3-wcscpy-atom.S \
arch-x86/atom/string/ssse3-wmemcmp-atom.S arch-x86/atom/string/ssse3-wmemcmp-atom.S
libc_bionic_src_files_x86 += \ libc_bionic_src_files_exclude_x86 += \
arch-x86/silvermont/string/sse2-stpcpy-slm.S \ arch-x86/generic/string/memcmp.S \
arch-x86/silvermont/string/sse2-stpncpy-slm.S
libc_bionic_src_files_exclude_x86 += \
arch-x86/silvermont/string/sse2-bcopy-slm.S \
arch-x86/silvermont/string/sse2-bzero-slm.S \
arch-x86/silvermont/string/sse2-memcpy-slm.S \
arch-x86/silvermont/string/sse2-memmove-slm.S \
arch-x86/silvermont/string/sse2-memset-slm.S \
arch-x86/silvermont/string/sse2-strcpy-slm.S \
arch-x86/silvermont/string/sse2-strlen-slm.S \
arch-x86/silvermont/string/sse2-strncpy-slm.S \
libc_freebsd_src_files_exclude_x86 += \
upstream-freebsd/lib/libc/string/wmemcmp.c \

View File

@ -41,30 +41,49 @@
#define _JB_SIGMASK 6 #define _JB_SIGMASK 6
#define _JB_SIGFLAG 7 #define _JB_SIGFLAG 7
.macro m_mangle_registers reg
xorl \reg,%edx
xorl \reg,%ebx
xorl \reg,%esp
xorl \reg,%ebp
xorl \reg,%esi
xorl \reg,%edi
.endm
.macro m_unmangle_registers reg
m_mangle_registers \reg
.endm
ENTRY(setjmp) ENTRY(setjmp)
movl 4(%esp),%ecx movl 4(%esp),%ecx
movl $1,(_JB_SIGFLAG * 4)(%ecx) mov $1,%eax
jmp .L_sigsetjmp_signal_mask jmp .L_sigsetjmp
END(setjmp) END(setjmp)
ENTRY(_setjmp) ENTRY(_setjmp)
movl 4(%esp),%ecx movl 4(%esp),%ecx
movl $0,(_JB_SIGFLAG * 4)(%ecx) movl $0,%eax
jmp .L_sigsetjmp_no_signal_mask jmp .L_sigsetjmp
END(_setjmp) END(_setjmp)
ENTRY(sigsetjmp) ENTRY(sigsetjmp)
movl 4(%esp),%ecx movl 4(%esp),%ecx
movl 8(%esp),%eax movl 8(%esp),%eax
// Record whether or not the signal mask is valid. .L_sigsetjmp:
PIC_PROLOGUE
pushl %eax
call PIC_PLT(__bionic_setjmp_cookie_get)
addl $4,%esp
PIC_EPILOGUE
// Record the setjmp cookie and whether or not we're saving the signal mask.
movl %eax,(_JB_SIGFLAG * 4)(%ecx) movl %eax,(_JB_SIGFLAG * 4)(%ecx)
// Do we need to save the signal mask? // Do we need to save the signal mask?
testl %eax,%eax testl $1,%eax
jz 1f jz 1f
.L_sigsetjmp_signal_mask:
// Get the current signal mask. // Get the current signal mask.
PIC_PROLOGUE PIC_PROLOGUE
pushl $0 pushl $0
@ -76,16 +95,21 @@ ENTRY(sigsetjmp)
movl 4(%esp),%ecx movl 4(%esp),%ecx
movl %eax,(_JB_SIGMASK * 4)(%ecx) movl %eax,(_JB_SIGMASK * 4)(%ecx)
.L_sigsetjmp_no_signal_mask:
1: 1:
// Fetch the setjmp cookie and clear the signal flag bit.
movl (_JB_SIGFLAG * 4)(%ecx),%eax
andl $-2,%eax
// Save the callee-save registers. // Save the callee-save registers.
movl 0(%esp),%edx movl 0(%esp),%edx
m_mangle_registers %eax
movl %edx,(_JB_EDX * 4)(%ecx) movl %edx,(_JB_EDX * 4)(%ecx)
movl %ebx,(_JB_EBX * 4)(%ecx) movl %ebx,(_JB_EBX * 4)(%ecx)
movl %esp,(_JB_ESP * 4)(%ecx) movl %esp,(_JB_ESP * 4)(%ecx)
movl %ebp,(_JB_EBP * 4)(%ecx) movl %ebp,(_JB_EBP * 4)(%ecx)
movl %esi,(_JB_ESI * 4)(%ecx) movl %esi,(_JB_ESI * 4)(%ecx)
movl %edi,(_JB_EDI * 4)(%ecx) movl %edi,(_JB_EDI * 4)(%ecx)
m_unmangle_registers %eax
xorl %eax,%eax xorl %eax,%eax
ret ret
@ -94,7 +118,8 @@ END(sigsetjmp)
ENTRY(siglongjmp) ENTRY(siglongjmp)
// Do we have a signal mask to restore? // Do we have a signal mask to restore?
movl 4(%esp),%edx movl 4(%esp),%edx
cmpl $0,(_JB_SIGFLAG * 4)(%edx) movl (_JB_SIGFLAG * 4)(%edx), %eax
testl $1,%eax
jz 1f jz 1f
// Restore the signal mask. // Restore the signal mask.
@ -108,12 +133,31 @@ ENTRY(siglongjmp)
// Restore the callee-save registers. // Restore the callee-save registers.
movl 4(%esp),%edx movl 4(%esp),%edx
movl 8(%esp),%eax movl 8(%esp),%eax
movl (_JB_EDX * 4)(%edx),%ecx
movl (_JB_EBX * 4)(%edx),%ebx movl (_JB_SIGFLAG * 4)(%edx),%ecx
movl (_JB_ESP * 4)(%edx),%esp andl $-2,%ecx
movl (_JB_EBP * 4)(%edx),%ebp
movl (_JB_ESI * 4)(%edx),%esi movl %ecx,%ebx
movl (_JB_EDI * 4)(%edx),%edi movl %ecx,%esp
movl %ecx,%ebp
movl %ecx,%esi
movl %ecx,%edi
xorl (_JB_EDX * 4)(%edx),%ecx
xorl (_JB_EBX * 4)(%edx),%ebx
xorl (_JB_ESP * 4)(%edx),%esp
xorl (_JB_EBP * 4)(%edx),%ebp
xorl (_JB_ESI * 4)(%edx),%esi
xorl (_JB_EDI * 4)(%edx),%edi
PIC_PROLOGUE
pushl %eax
pushl %ecx
pushl (_JB_SIGFLAG * 4)(%edx)
call PIC_PLT(__bionic_setjmp_cookie_check)
addl $4,%esp
popl %ecx
popl %eax
PIC_EPILOGUE
testl %eax,%eax testl %eax,%eax
jnz 2f jnz 2f

View File

@ -34,6 +34,12 @@ ENTRY(vfork)
popl %ecx // Grab the return address. popl %ecx // Grab the return address.
.cfi_adjust_cfa_offset 4 .cfi_adjust_cfa_offset 4
.cfi_rel_offset ecx, 0 .cfi_rel_offset ecx, 0
// __get_tls()[TLS_SLOT_THREAD_ID]->cached_pid_ = 0
movl %gs:0, %eax
movl 4(%eax), %eax
movl $0, 12(%eax)
movl $__NR_vfork, %eax movl $__NR_vfork, %eax
int $0x80 int $0x80
cmpl $-MAX_ERRNO, %eax cmpl $-MAX_ERRNO, %eax

View File

@ -1,52 +0,0 @@
libc_bionic_src_files_x86 += \
arch-x86/atom/string/sse2-memchr-atom.S \
arch-x86/atom/string/sse2-memrchr-atom.S \
arch-x86/atom/string/sse2-strchr-atom.S \
arch-x86/atom/string/sse2-strnlen-atom.S \
arch-x86/atom/string/sse2-strrchr-atom.S \
arch-x86/atom/string/sse2-wcschr-atom.S \
arch-x86/atom/string/sse2-wcsrchr-atom.S \
arch-x86/atom/string/sse2-wcslen-atom.S \
arch-x86/atom/string/sse2-wcscmp-atom.S \
arch-x86/silvermont/string/sse2-bcopy-slm.S \
arch-x86/silvermont/string/sse2-bzero-slm.S \
arch-x86/silvermont/string/sse2-memcpy-slm.S \
arch-x86/silvermont/string/sse2-memmove-slm.S \
arch-x86/silvermont/string/sse2-memset-slm.S \
arch-x86/silvermont/string/sse2-stpcpy-slm.S \
arch-x86/silvermont/string/sse2-stpncpy-slm.S \
arch-x86/silvermont/string/sse2-strcpy-slm.S \
arch-x86/silvermont/string/sse2-strlen-slm.S \
arch-x86/silvermont/string/sse2-strncpy-slm.S
ifeq ($(ARCH_X86_HAVE_SSSE3),true)
libc_bionic_src_files_x86 += \
arch-x86/atom/string/ssse3-strncat-atom.S \
arch-x86/atom/string/ssse3-strlcat-atom.S \
arch-x86/atom/string/ssse3-strlcpy-atom.S \
arch-x86/atom/string/ssse3-strcmp-atom.S \
arch-x86/atom/string/ssse3-strncmp-atom.S \
arch-x86/atom/string/ssse3-strcat-atom.S \
arch-x86/atom/string/ssse3-wcscat-atom.S \
arch-x86/atom/string/ssse3-wcscpy-atom.S
else
libc_bionic_src_files_x86 += \
arch-x86/generic/string/strcmp.S \
arch-x86/generic/string/strncmp.S \
arch-x86/generic/string/strcat.S \
upstream-freebsd/lib/libc/string/wcscpy.c \
upstream-freebsd/lib/libc/string/wcscat.c \
upstream-openbsd/lib/libc/string/strlcat.c \
upstream-openbsd/lib/libc/string/strlcpy.c \
upstream-openbsd/lib/libc/string/strncat.c
endif
ifeq ($(ARCH_X86_HAVE_SSE4),true)
libc_bionic_src_files_x86 += \
arch-x86/silvermont/string/sse4-memcmp-slm.S \
arch-x86/silvermont/string/sse4-wmemcmp-slm.S
else
libc_bionic_src_files_x86 += \
arch-x86/generic/string/memcmp.S \
upstream-freebsd/lib/libc/string/wmemcmp.c
endif

View File

@ -1,32 +0,0 @@
libc_bionic_src_files_x86 += \
arch-x86/silvermont/string/sse2-bcopy-slm.S \
arch-x86/silvermont/string/sse2-bzero-slm.S \
arch-x86/silvermont/string/sse2-memcpy-slm.S \
arch-x86/silvermont/string/sse2-memmove-slm.S \
arch-x86/silvermont/string/sse2-memset-slm.S \
arch-x86/silvermont/string/sse2-stpcpy-slm.S \
arch-x86/silvermont/string/sse2-stpncpy-slm.S \
arch-x86/silvermont/string/sse2-strcpy-slm.S \
arch-x86/silvermont/string/sse2-strlen-slm.S \
arch-x86/silvermont/string/sse2-strncpy-slm.S \
arch-x86/silvermont/string/sse4-memcmp-slm.S \
arch-x86/silvermont/string/sse4-wmemcmp-slm.S
libc_bionic_src_files_x86 += \
arch-x86/atom/string/sse2-memchr-atom.S \
arch-x86/atom/string/sse2-memrchr-atom.S \
arch-x86/atom/string/sse2-strchr-atom.S \
arch-x86/atom/string/sse2-strrchr-atom.S \
arch-x86/atom/string/sse2-strnlen-atom.S \
arch-x86/atom/string/sse2-wcschr-atom.S \
arch-x86/atom/string/sse2-wcsrchr-atom.S \
arch-x86/atom/string/sse2-wcslen-atom.S \
arch-x86/atom/string/sse2-wcscmp-atom.S \
arch-x86/atom/string/ssse3-strncat-atom.S \
arch-x86/atom/string/ssse3-strlcat-atom.S \
arch-x86/atom/string/ssse3-strlcpy-atom.S \
arch-x86/atom/string/ssse3-strcmp-atom.S \
arch-x86/atom/string/ssse3-strncmp-atom.S \
arch-x86/atom/string/ssse3-strcat-atom.S \
arch-x86/atom/string/ssse3-wcscat-atom.S \
arch-x86/atom/string/ssse3-wcscpy-atom.S

View File

@ -2,7 +2,7 @@
#include <private/bionic_asm.h> #include <private/bionic_asm.h>
ENTRY(flistxattr) ENTRY(___flistxattr)
pushl %ebx pushl %ebx
.cfi_def_cfa_offset 8 .cfi_def_cfa_offset 8
.cfi_rel_offset ebx, 0 .cfi_rel_offset ebx, 0
@ -28,4 +28,5 @@ ENTRY(flistxattr)
popl %ecx popl %ecx
popl %ebx popl %ebx
ret ret
END(flistxattr) END(___flistxattr)
.hidden ___flistxattr

View File

@ -2,7 +2,7 @@
#include <private/bionic_asm.h> #include <private/bionic_asm.h>
ENTRY(mremap) ENTRY(___mremap)
pushl %ebx pushl %ebx
.cfi_def_cfa_offset 8 .cfi_def_cfa_offset 8
.cfi_rel_offset ebx, 0 .cfi_rel_offset ebx, 0
@ -15,10 +15,14 @@ ENTRY(mremap)
pushl %esi pushl %esi
.cfi_adjust_cfa_offset 4 .cfi_adjust_cfa_offset 4
.cfi_rel_offset esi, 0 .cfi_rel_offset esi, 0
mov 20(%esp), %ebx pushl %edi
mov 24(%esp), %ecx .cfi_adjust_cfa_offset 4
mov 28(%esp), %edx .cfi_rel_offset edi, 0
mov 32(%esp), %esi mov 24(%esp), %ebx
mov 28(%esp), %ecx
mov 32(%esp), %edx
mov 36(%esp), %esi
mov 40(%esp), %edi
movl $__NR_mremap, %eax movl $__NR_mremap, %eax
int $0x80 int $0x80
cmpl $-MAX_ERRNO, %eax cmpl $-MAX_ERRNO, %eax
@ -28,9 +32,11 @@ ENTRY(mremap)
call __set_errno_internal call __set_errno_internal
addl $4, %esp addl $4, %esp
1: 1:
popl %edi
popl %esi popl %esi
popl %edx popl %edx
popl %ecx popl %ecx
popl %ebx popl %ebx
ret ret
END(mremap) END(___mremap)
.hidden ___mremap

View File

@ -2,7 +2,7 @@
#include <private/bionic_asm.h> #include <private/bionic_asm.h>
ENTRY(clock_gettime) ENTRY(__clock_gettime)
pushl %ebx pushl %ebx
.cfi_def_cfa_offset 8 .cfi_def_cfa_offset 8
.cfi_rel_offset ebx, 0 .cfi_rel_offset ebx, 0
@ -23,4 +23,4 @@ ENTRY(clock_gettime)
popl %ecx popl %ecx
popl %ebx popl %ebx
ret ret
END(clock_gettime) END(__clock_gettime)

View File

@ -2,7 +2,7 @@
#include <private/bionic_asm.h> #include <private/bionic_asm.h>
ENTRY(gettimeofday) ENTRY(__gettimeofday)
pushl %ebx pushl %ebx
.cfi_def_cfa_offset 8 .cfi_def_cfa_offset 8
.cfi_rel_offset ebx, 0 .cfi_rel_offset ebx, 0
@ -23,4 +23,4 @@ ENTRY(gettimeofday)
popl %ecx popl %ecx
popl %ebx popl %ebx
ret ret
END(gettimeofday) END(__gettimeofday)

View File

@ -0,0 +1,41 @@
/* Generated by gensyscalls.py. Do not edit. */
#include <private/bionic_asm.h>
ENTRY(__preadv64)
pushl %ebx
.cfi_def_cfa_offset 8
.cfi_rel_offset ebx, 0
pushl %ecx
.cfi_adjust_cfa_offset 4
.cfi_rel_offset ecx, 0
pushl %edx
.cfi_adjust_cfa_offset 4
.cfi_rel_offset edx, 0
pushl %esi
.cfi_adjust_cfa_offset 4
.cfi_rel_offset esi, 0
pushl %edi
.cfi_adjust_cfa_offset 4
.cfi_rel_offset edi, 0
mov 24(%esp), %ebx
mov 28(%esp), %ecx
mov 32(%esp), %edx
mov 36(%esp), %esi
mov 40(%esp), %edi
movl $__NR_preadv, %eax
int $0x80
cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
call __set_errno_internal
addl $4, %esp
1:
popl %edi
popl %esi
popl %edx
popl %ecx
popl %ebx
ret
END(__preadv64)

View File

@ -0,0 +1,41 @@
/* Generated by gensyscalls.py. Do not edit. */
#include <private/bionic_asm.h>
ENTRY(__pwritev64)
pushl %ebx
.cfi_def_cfa_offset 8
.cfi_rel_offset ebx, 0
pushl %ecx
.cfi_adjust_cfa_offset 4
.cfi_rel_offset ecx, 0
pushl %edx
.cfi_adjust_cfa_offset 4
.cfi_rel_offset edx, 0
pushl %esi
.cfi_adjust_cfa_offset 4
.cfi_rel_offset esi, 0
pushl %edi
.cfi_adjust_cfa_offset 4
.cfi_rel_offset edi, 0
mov 24(%esp), %ebx
mov 28(%esp), %ecx
mov 32(%esp), %edx
mov 36(%esp), %esi
mov 40(%esp), %edi
movl $__NR_pwritev, %eax
int $0x80
cmpl $-MAX_ERRNO, %eax
jb 1f
negl %eax
pushl %eax
call __set_errno_internal
addl $4, %esp
1:
popl %edi
popl %esi
popl %edx
popl %ecx
popl %ebx
ret
END(__pwritev64)

View File

@ -1,17 +1,103 @@
# 32-bit x86. # 32-bit x86.
# #
# Default implementations of functions that are commonly optimized. # Generic x86 optimizations, may be overriden by CPU variants.
# #
libc_common_src_files_x86 += \ libc_bionic_src_files_x86 += \
bionic/__memcpy_chk.cpp \ arch-x86/atom/string/sse2-memchr-atom.S \
bionic/__memset_chk.cpp \ arch-x86/atom/string/sse2-memrchr-atom.S \
bionic/__strcpy_chk.cpp \ arch-x86/atom/string/sse2-strchr-atom.S \
bionic/__strcat_chk.cpp \ arch-x86/atom/string/sse2-strnlen-atom.S \
arch-x86/atom/string/sse2-strrchr-atom.S \
arch-x86/atom/string/sse2-wcschr-atom.S \
arch-x86/atom/string/sse2-wcsrchr-atom.S \
arch-x86/atom/string/sse2-wcslen-atom.S \
arch-x86/atom/string/sse2-wcscmp-atom.S \
arch-x86/silvermont/string/sse2-bcopy-slm.S \
arch-x86/silvermont/string/sse2-bzero-slm.S \
arch-x86/silvermont/string/sse2-memcpy-slm.S \
arch-x86/silvermont/string/sse2-memmove-slm.S \
arch-x86/silvermont/string/sse2-memset-slm.S \
arch-x86/silvermont/string/sse2-stpcpy-slm.S \
arch-x86/silvermont/string/sse2-stpncpy-slm.S \
arch-x86/silvermont/string/sse2-strcpy-slm.S \
arch-x86/silvermont/string/sse2-strlen-slm.S \
arch-x86/silvermont/string/sse2-strncpy-slm.S
libc_freebsd_src_files_x86 += \ libc_bionic_src_files_x86 += \
upstream-freebsd/lib/libc/string/wmemmove.c \ arch-x86/generic/string/memcmp.S \
arch-x86/generic/string/strcmp.S \
arch-x86/generic/string/strncmp.S \
arch-x86/generic/string/strcat.S
ifeq ($(ARCH_X86_HAVE_SSSE3),true)
libc_bionic_src_files_x86 += \
arch-x86/atom/string/ssse3-strncat-atom.S \
arch-x86/atom/string/ssse3-strlcat-atom.S \
arch-x86/atom/string/ssse3-strlcpy-atom.S \
arch-x86/atom/string/ssse3-strcmp-atom.S \
arch-x86/atom/string/ssse3-strncmp-atom.S \
arch-x86/atom/string/ssse3-strcat-atom.S \
arch-x86/atom/string/ssse3-wcscat-atom.S \
arch-x86/atom/string/ssse3-wcscpy-atom.S
libc_bionic_src_files_exclude_x86 += \
arch-x86/generic/string/strcmp.S \
arch-x86/generic/string/strncmp.S \
arch-x86/generic/string/strcat.S
endif
ifeq ($(ARCH_X86_HAVE_SSE4),true)
libc_bionic_src_files_x86 += \
arch-x86/silvermont/string/sse4-memcmp-slm.S \
arch-x86/silvermont/string/sse4-wmemcmp-slm.S
libc_bionic_src_files_exclude_x86 += \
arch-x86/generic/string/memcmp.S
endif
#
# Remove default implementations that we have optimized versions of.
#
libc_freebsd_src_files_exclude_x86 += \
upstream-freebsd/lib/libc/string/wcschr.c \
upstream-freebsd/lib/libc/string/wcscmp.c \
upstream-freebsd/lib/libc/string/wcslen.c \
upstream-freebsd/lib/libc/string/wcsrchr.c \
ifeq ($(ARCH_X86_HAVE_SSSE3),true)
libc_freebsd_src_files_exclude_x86 += \
upstream-freebsd/lib/libc/string/wcscat.c \
upstream-freebsd/lib/libc/string/wcscpy.c
endif
ifeq ($(ARCH_X86_HAVE_SSE4),true)
libc_freebsd_src_files_exclude_x86 += \
upstream-freebsd/lib/libc/string/wmemcmp.c
endif
libc_openbsd_src_files_exclude_x86 += \
upstream-openbsd/lib/libc/string/memchr.c \
upstream-openbsd/lib/libc/string/memmove.c \
upstream-openbsd/lib/libc/string/memrchr.c \
upstream-openbsd/lib/libc/string/stpcpy.c \
upstream-openbsd/lib/libc/string/stpncpy.c \
upstream-openbsd/lib/libc/string/strcat.c \
upstream-openbsd/lib/libc/string/strcpy.c \
upstream-openbsd/lib/libc/string/strncmp.c \
upstream-openbsd/lib/libc/string/strncpy.c \
ifeq ($(ARCH_X86_HAVE_SSSE3),true)
libc_openbsd_src_files_exclude_x86 += \
upstream-openbsd/lib/libc/string/strlcat.c \
upstream-openbsd/lib/libc/string/strlcpy.c \
upstream-openbsd/lib/libc/string/strncat.c
endif
libc_bionic_src_files_exclude_x86 += \
bionic/strchr.cpp \
bionic/strnlen.c \
bionic/strrchr.cpp \
# #
# Inherently architecture-specific functions. # Inherently architecture-specific functions.
@ -23,19 +109,20 @@ libc_bionic_src_files_x86 += \
arch-x86/bionic/libgcc_compat.c \ arch-x86/bionic/libgcc_compat.c \
arch-x86/bionic/__restore.S \ arch-x86/bionic/__restore.S \
arch-x86/bionic/setjmp.S \ arch-x86/bionic/setjmp.S \
arch-x86/bionic/__set_tls.c \
arch-x86/bionic/syscall.S \ arch-x86/bionic/syscall.S \
arch-x86/bionic/vfork.S \ arch-x86/bionic/vfork.S \
## ARCH variant specific source files ## ARCH variant specific source files
arch_variant_mk := $(LOCAL_PATH)/arch-x86/$(TARGET_ARCH_VARIANT)/$(TARGET_ARCH_VARIANT).mk arch_variant_mk := $(LOCAL_PATH)/arch-x86/$(TARGET_ARCH_VARIANT)/$(TARGET_ARCH_VARIANT).mk
ifeq ($(wildcard $(arch_variant_mk)),) ifeq ($(wildcard $(arch_variant_mk)),)
arch_variant_mk := $(LOCAL_PATH)/arch-x86/generic/generic.mk arch_variant_mk :=
endif endif
ifneq ($(arch_variant_mk),)
include $(arch_variant_mk) include $(arch_variant_mk)
libc_common_additional_dependencies += $(arch_variant_mk) libc_common_additional_dependencies += $(arch_variant_mk)
arch_variant_mk := arch_variant_mk :=
endif
libc_crt_target_cflags_x86 := \ libc_crt_target_cflags_x86 := \
-m32 \ -m32 \

View File

@ -50,6 +50,25 @@
#define _JB_SIGMASK 9 #define _JB_SIGMASK 9
#define _JB_SIGMASK_RT 10 // sigprocmask will write here too. #define _JB_SIGMASK_RT 10 // sigprocmask will write here too.
#define MANGLE_REGISTERS 1
.macro m_mangle_registers reg
#if MANGLE_REGISTERS
xorq \reg,%rbx
xorq \reg,%rbp
xorq \reg,%r12
xorq \reg,%r13
xorq \reg,%r14
xorq \reg,%r15
xorq \reg,%rsp
xorq \reg,%r11
#endif
.endm
.macro m_unmangle_registers reg
m_mangle_registers \reg
.endm
ENTRY(setjmp) ENTRY(setjmp)
movl $1,%esi movl $1,%esi
jmp PIC_PLT(sigsetjmp) jmp PIC_PLT(sigsetjmp)
@ -62,11 +81,17 @@ END(_setjmp)
// int sigsetjmp(sigjmp_buf env, int save_signal_mask); // int sigsetjmp(sigjmp_buf env, int save_signal_mask);
ENTRY(sigsetjmp) ENTRY(sigsetjmp)
// Record whether or not we're saving the signal mask. pushq %rdi
movl %esi,(_JB_SIGFLAG * 8)(%rdi) movq %rsi,%rdi
call PIC_PLT(__bionic_setjmp_cookie_get)
popq %rdi
// Record setjmp cookie and whether or not we're saving the signal mask.
movq %rax,(_JB_SIGFLAG * 8)(%rdi)
pushq %rax
// Do we need to save the signal mask? // Do we need to save the signal mask?
testl %esi,%esi testq $1,%rax
jz 2f jz 2f
// Save current signal mask. // Save current signal mask.
@ -79,7 +104,10 @@ ENTRY(sigsetjmp)
2: 2:
// Save the callee-save registers. // Save the callee-save registers.
popq %rax
andq $-2,%rax
movq (%rsp),%r11 movq (%rsp),%r11
m_mangle_registers %rax
movq %rbx,(_JB_RBX * 8)(%rdi) movq %rbx,(_JB_RBX * 8)(%rdi)
movq %rbp,(_JB_RBP * 8)(%rdi) movq %rbp,(_JB_RBP * 8)(%rdi)
movq %r12,(_JB_R12 * 8)(%rdi) movq %r12,(_JB_R12 * 8)(%rdi)
@ -88,6 +116,7 @@ ENTRY(sigsetjmp)
movq %r15,(_JB_R15 * 8)(%rdi) movq %r15,(_JB_R15 * 8)(%rdi)
movq %rsp,(_JB_RSP * 8)(%rdi) movq %rsp,(_JB_RSP * 8)(%rdi)
movq %r11,(_JB_PC * 8)(%rdi) movq %r11,(_JB_PC * 8)(%rdi)
m_unmangle_registers %rax
xorl %eax,%eax xorl %eax,%eax
ret ret
@ -99,7 +128,9 @@ ENTRY(siglongjmp)
pushq %rsi // Push 'value'. pushq %rsi // Push 'value'.
// Do we need to restore the signal mask? // Do we need to restore the signal mask?
cmpl $0,(_JB_SIGFLAG * 8)(%rdi) movq (_JB_SIGFLAG * 8)(%rdi), %rdi
pushq %rdi // Push cookie
testq $1, %rdi
jz 2f jz 2f
// Restore the signal mask. // Restore the signal mask.
@ -109,6 +140,10 @@ ENTRY(siglongjmp)
call PIC_PLT(sigprocmask) call PIC_PLT(sigprocmask)
2: 2:
// Fetch the setjmp cookie and clear the signal flag bit.
popq %rcx
andq $-2, %rcx
popq %rax // Pop 'value'. popq %rax // Pop 'value'.
// Restore the callee-save registers. // Restore the callee-save registers.
@ -120,7 +155,17 @@ ENTRY(siglongjmp)
movq (_JB_RSP * 8)(%r12),%rsp movq (_JB_RSP * 8)(%r12),%rsp
movq (_JB_PC * 8)(%r12),%r11 movq (_JB_PC * 8)(%r12),%r11
movq (_JB_R12 * 8)(%r12),%r12 movq (_JB_R12 * 8)(%r12),%r12
m_unmangle_registers %rcx
// Check the cookie.
pushq %rax
pushq %r11
movq %rcx, %rdi
call PIC_PLT(__bionic_setjmp_cookie_check)
popq %r11
popq %rax
// Return 1 if value is 0.
testl %eax,%eax testl %eax,%eax
jnz 1f jnz 1f
incl %eax incl %eax

View File

@ -32,6 +32,12 @@
ENTRY(vfork) ENTRY(vfork)
popq %rdi // Grab the return address. popq %rdi // Grab the return address.
// __get_tls()[TLS_SLOT_THREAD_ID]->cached_pid_ = 0
mov %fs:0, %rax
mov 8(%rax), %rax
movl $0, 20(%rax)
movl $__NR_vfork, %eax movl $__NR_vfork, %eax
syscall syscall
pushq %rdi // Restore the return address. pushq %rdi // Restore the return address.

View File

@ -91,9 +91,6 @@ name: \
.section .text.sse2,"ax",@progbits .section .text.sse2,"ax",@progbits
ENTRY (MEMMOVE) ENTRY (MEMMOVE)
ENTRANCE ENTRANCE
#ifdef USE_AS_BCOPY
xchg %rsi, %rdi
#endif
mov %rdi, %rax mov %rdi, %rax
/* Check whether we should copy backward or forward. */ /* Check whether we should copy backward or forward. */

Some files were not shown because too many files have changed in this diff Show More