Compare commits

...

921 Commits

Author SHA1 Message Date
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
75dd3710e7 Merge "Generate libdl.so per-architecture version script" 2015-10-31 18:17: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
c36be975ce Merge "Add prlimit to LP32." 2015-10-30 23:35:40 +00:00
Elliott Hughes
bdac9ec142 Merge "Remove <sys/shm.h>." 2015-10-30 22:06:26 +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
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
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
578d949e8d Merge "Generate per-architecture version scripts." 2015-10-28 23:44:03 +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
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
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
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
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
6a4ddeb56e Merge "Implement Library Load Order Randomization" 2015-10-26 22:30:35 +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
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
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
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
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 9185e04f72 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
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
d29ba55513 Merge "Opt Brillo out of the ndk cruft." 2015-10-17 03:06:41 +00: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
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 cf92738fa5)
2015-10-14 18:24:54 -07:00
Josh Gao
c433a36fb5 Merge "Move malloc dispatch table to __libc_globals." 2015-10-14 23:47:41 +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
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 f32b689d3d)
2015-10-13 15:48:57 -07: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
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
fb7f45b6a3 Merge "Update timezone data to 2015g" 2015-10-13 08:26:44 +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
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
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
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
c6f704bf77 Merge "utmp.h: add more ut_type defines" 2015-10-09 23:33:37 +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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
c121e179a2 am a992004c: Merge "Regenerate NOTICE files."
* commit 'a992004c9edf4db0c11aae8610cce6ebf13d53b4':
  Regenerate NOTICE files.
2015-08-29 04:07:20 +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
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
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
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
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
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
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
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
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
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
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 c5deb0f883.

Change-Id: If7abdb351f5a5549d6a331b33af408e8fcfa9868
2015-08-24 16:05:48 -07: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 d76f16973a.

Change-Id: I995d0d38c3776f5c50b060f16770741c92a2acac
2015-08-24 21:08:13 +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
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
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
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 96dd2b6e85.

Bug: 23470962
Change-Id: I056f1d8668f52d31412868975f2143249fc7e8f0
2015-08-24 06:58:39 +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
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
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
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
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
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
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
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
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
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
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
f2985ed840 Merge "Fix test steps for 64-bit bionic" 2015-08-12 01:58:18 +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
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
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
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
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
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
b3db7764d0 Merge "name the arc4random structure mappings" 2015-08-04 00:58:57 +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
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
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 89a121d43a.

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
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
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
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
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
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
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
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
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
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
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
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 de0fb393ae)
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
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
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
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
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
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
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
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
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 9d11a7087c)
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
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
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
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
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 cd13b14e98.

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 1946856b1f.

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
8bdf8ab97c am e70d7a78: Merge "Fix dt_runpath test."
* commit 'e70d7a78f0bfba8b09d37c145769cb8d1d7c5fb6':
  Fix dt_runpath test.
2015-07-20 19:17:02 +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 df1a3c6d21.

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
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
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
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
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
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
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
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
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
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 9fee99b060)

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
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
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
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
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
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
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
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
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
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
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
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 f643eb38c3)
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 f7d5bf334d)
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 06700b2b5e)
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 d02ec08427.

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 64e9e71cdb.
* commit '2b028f5ce47b8d27ca6d3b86e135f7d9b0359547':
  Fix bad merge of 64e9e71cdb.
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 3e6f780754)
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 28154f5c56)
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 455c145e3c.

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 ea4ef52fa4)
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 3cec6eca92.
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 524f1f1efe)
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 79b3877a13)
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 511cfd9dc8)

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 2825f10b7f.

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 5edb0f40f6)

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 04f7e3e955)
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 38c37d6705)
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 69a5fb951d)
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 be0e43b776

Change-Id: I99e220328aff985facb920ebcd84ac1a016759b5
(cherry picked from commit d7ad443cfd)
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 76e1cbca75.
2015-05-07 15:12:24 -07:00
Dan Albert
6f0d7005f9 Revert "Fix clang build."
Bug: http://b/20065774
This reverts commit 0975a5d9d2.
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 dffd3c5838.

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 8264afb377)
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 064a9800f3)
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 452742d2bf)

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
350 changed files with 24137 additions and 6487 deletions

14
.clang-format Normal file
View File

@@ -0,0 +1,14 @@
BasedOnStyle: Google
AllowShortBlocksOnASingleLine: false
AllowShortFunctionsOnASingleLine: false
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

@@ -194,14 +194,15 @@ The tests are all built from the tests/ directory.
### Device tests
$ mma
$ adb remount
$ adb sync
$ adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests32
$ adb shell \
/data/nativetest/bionic-unit-tests-static/bionic-unit-tests-static32
# 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 \
/data/nativetest/bionic-unit-tests-static/bionic-unit-tests-static64
/data/nativetest64/bionic-unit-tests-static/bionic-unit-tests-static64
### Host tests
@@ -256,6 +257,17 @@ First, build and run the host tests as usual (see above).
The coverage report is now available at `covreport/index.html`.
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`.
LP32 ABI bugs
-------------

View File

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

View File

@@ -65,6 +65,50 @@ void BM_math_logb::Run(int iters) {
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;
void BM_math_isinf::Run(int iters, double value) {
StartBenchmarkTiming();
@@ -78,6 +122,60 @@ void BM_math_isinf::Run(int iters, double value) {
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);
void BM_math_sin_fast::Run(int iters) {
StartBenchmarkTiming();
@@ -134,3 +232,55 @@ void BM_math_fpclassify::Run(int iters, double value) {
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_ext.h>
#include <stdlib.h>
#include <benchmark/Benchmark.h>
@@ -73,7 +74,7 @@ static void FopenFgetsFclose(int iters, bool no_locking) {
for (int i = 0; i < iters; ++i) {
FILE* fp = fopen("/proc/version", "re");
if (no_locking) __fsetlocking(fp, FSETLOCKING_BYCALLER);
fgets(buf, sizeof(buf), fp);
if (fgets(buf, sizeof(buf), fp) == nullptr) abort();
fclose(fp);
}
}

View File

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

View File

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

2350
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)
bionic_coverage := false
bionic_coverage ?= false
# Make everything depend on any changes to included makefiles.
libc_common_additional_dependencies := $(LOCAL_PATH)/Android.mk
@@ -59,6 +59,7 @@ libc_common_src_files := \
bionic/system_properties_compat.c \
stdio/findfp.c \
stdio/fread.c \
stdio/refill.c \
stdio/snprintf.c\
stdio/sprintf.c \
stdio/stdio.c \
@@ -70,12 +71,17 @@ libc_common_src_files := \
libc_common_src_files += \
bionic/__FD_chk.cpp \
bionic/__fgets_chk.cpp \
bionic/__fread_chk.cpp \
bionic/__fwrite_chk.cpp \
bionic/__getcwd_chk.cpp \
bionic/__memchr_chk.cpp \
bionic/__memmove_chk.cpp \
bionic/__memrchr_chk.cpp \
bionic/__poll_chk.cpp \
bionic/__pread64_chk.cpp \
bionic/__pread_chk.cpp \
bionic/__pwrite64_chk.cpp \
bionic/__pwrite_chk.cpp \
bionic/__read_chk.cpp \
bionic/__readlink_chk.cpp \
bionic/__readlinkat_chk.cpp \
@@ -92,12 +98,14 @@ libc_common_src_files += \
bionic/__umask_chk.cpp \
bionic/__vsnprintf_chk.cpp \
bionic/__vsprintf_chk.cpp \
bionic/__write_chk.cpp
libc_bionic_ndk_src_files := \
bionic/abort.cpp \
bionic/accept.cpp \
bionic/accept4.cpp \
bionic/access.cpp \
bionic/arpa_inet.cpp \
bionic/assert.cpp \
bionic/atof.cpp \
bionic/bionic_systrace.cpp \
@@ -130,6 +138,7 @@ libc_bionic_ndk_src_files := \
bionic/fchmodat.cpp \
bionic/ffs.cpp \
bionic/fgetxattr.cpp \
bionic/flistxattr.cpp \
bionic/flockfile.cpp \
bionic/fpclassify.cpp \
bionic/fsetxattr.cpp \
@@ -207,6 +216,7 @@ libc_bionic_ndk_src_files := \
bionic/socket.cpp \
bionic/stat.cpp \
bionic/statvfs.cpp \
bionic/strchrnul.cpp \
bionic/strerror.cpp \
bionic/strerror_r.cpp \
bionic/strsignal.cpp \
@@ -242,10 +252,20 @@ libc_bionic_src_files += bionic/fork.cpp
# dereferences.
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/sysconf.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 := \
bionic/__cxa_guard.cpp \
@@ -256,30 +276,33 @@ libc_upstream_freebsd_src_files := \
upstream-freebsd/lib/libc/gen/ldexp.c \
upstream-freebsd/lib/libc/gen/sleep.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/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/quick_exit.c \
upstream-freebsd/lib/libc/stdlib/realpath.c \
upstream-freebsd/lib/libc/string/wcpcpy.c \
upstream-freebsd/lib/libc/string/wcpncpy.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/wcsdup.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/wcsncat.c \
upstream-freebsd/lib/libc/string/wcsncmp.c \
upstream-freebsd/lib/libc/string/wcsncpy.c \
upstream-freebsd/lib/libc/string/wcsnlen.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/wcstok.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 \
libc_upstream_netbsd_src_files := \
@@ -309,6 +332,7 @@ libc_upstream_netbsd_src_files := \
upstream-netbsd/lib/libc/stdlib/nrand48.c \
upstream-netbsd/lib/libc/stdlib/_rand48.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/srand48.c \
upstream-netbsd/lib/libc/string/memccpy.c \
@@ -343,11 +367,25 @@ libc_upstream_openbsd_gdtoa_src_files_64 := \
$(libc_upstream_openbsd_gdtoa_src_files) \
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 := \
upstream-openbsd/lib/libc/crypt/arc4random.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 := \
upstream-openbsd/lib/libc/compat-43/killpg.c \
upstream-openbsd/lib/libc/gen/alarm.c \
@@ -390,11 +428,9 @@ libc_upstream_openbsd_ndk_src_files := \
upstream-openbsd/lib/libc/locale/wctomb.c \
upstream-openbsd/lib/libc/net/htonl.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_makeaddr.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_ntop.c \
upstream-openbsd/lib/libc/net/inet_pton.c \
@@ -454,7 +490,6 @@ libc_upstream_openbsd_ndk_src_files := \
upstream-openbsd/lib/libc/stdio/puts.c \
upstream-openbsd/lib/libc/stdio/putwc.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/rewind.c \
upstream-openbsd/lib/libc/stdio/rget.c \
@@ -488,11 +523,16 @@ libc_upstream_openbsd_ndk_src_files := \
upstream-openbsd/lib/libc/stdio/wprintf.c \
upstream-openbsd/lib/libc/stdio/wscanf.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/atol.c \
upstream-openbsd/lib/libc/stdlib/atoll.c \
upstream-openbsd/lib/libc/stdlib/getenv.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/reallocarray.c \
upstream-openbsd/lib/libc/stdlib/remque.c \
@@ -574,11 +614,14 @@ libc_common_cflags := \
-D_LIBC=1 \
-Wall -Wextra -Wunused \
ifneq ($(TARGET_USES_LOGD),false)
libc_common_cflags += -DTARGET_USES_LOGD
use_clang := $(USE_CLANG_PLATFORM_BUILD)
# 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
use_clang := $(USE_CLANG_PLATFORM_BUILD)
ifeq ($(use_clang),)
use_clang := false
endif
@@ -616,7 +659,6 @@ libc_common_conlyflags := \
# Define some common cppflags
libc_common_cppflags := \
-std=gnu++11
# Define some common includes
# ========================================================
@@ -657,7 +699,7 @@ LOCAL_CLANG := $(use_clang)
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
LOCAL_CXX_STL := none
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))
@@ -676,11 +718,13 @@ LOCAL_SRC_FILES += upstream-openbsd/lib/libc/time/wcsftime.c
LOCAL_CFLAGS := $(libc_common_cflags) \
-fvisibility=hidden \
-Wno-unused-parameter \
# Don't use ridiculous amounts of stack.
LOCAL_CFLAGS += -DALL_STATE
# Include tzsetwall, timelocal, timegm, time2posix, and posix2time.
LOCAL_CFLAGS += -DSTD_INSPIRED
LOCAL_CFLAGS += -DTHREAD_SAFE
# The name of the tm_gmtoff field in our struct tm.
LOCAL_CFLAGS += -DTM_GMTOFF=tm_gmtoff
# Where we store our tzdata.
@@ -698,7 +742,7 @@ LOCAL_CLANG := $(use_clang)
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
LOCAL_CXX_STL := none
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))
@@ -744,7 +788,7 @@ LOCAL_CLANG := $(use_clang)
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
LOCAL_CXX_STL := none
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))
@@ -777,11 +821,11 @@ LOCAL_CLANG := $(use_clang)
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
LOCAL_CXX_STL := none
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))
$(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)
@@ -812,7 +856,7 @@ LOCAL_CLANG := $(use_clang)
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
LOCAL_CXX_STL := none
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))
@@ -853,7 +897,7 @@ LOCAL_MODULE := libc_openbsd_ndk
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
LOCAL_CXX_STL := none
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))
@@ -891,11 +935,11 @@ LOCAL_MODULE := libc_openbsd
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
LOCAL_CXX_STL := none
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))
$(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)
@@ -929,7 +973,7 @@ LOCAL_MODULE := libc_gdtoa
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
LOCAL_CXX_STL := none
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))
@@ -954,11 +998,12 @@ LOCAL_CLANG := $(use_clang)
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
LOCAL_CXX_STL := none
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))
$(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)
@@ -982,7 +1027,7 @@ LOCAL_CLANG := $(use_clang)
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
LOCAL_CXX_STL := none
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))
@@ -1003,7 +1048,7 @@ LOCAL_CLANG := false
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
LOCAL_CXX_STL := none
LOCAL_SYSTEM_SHARED_LIBRARIES :=
LOCAL_ADDRESS_SANITIZER := false
LOCAL_SANITIZE := never
LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
include $(BUILD_STATIC_LIBRARY)
@@ -1030,7 +1075,7 @@ LOCAL_CLANG := $(use_clang)
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
LOCAL_CXX_STL := none
LOCAL_SYSTEM_SHARED_LIBRARIES :=
LOCAL_ADDRESS_SANITIZER := false
LOCAL_SANITIZE := never
LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
include $(BUILD_STATIC_LIBRARY)
@@ -1054,7 +1099,7 @@ LOCAL_CLANG := true # GCC refuses to hide new/delete
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
LOCAL_CXX_STL := none
LOCAL_SYSTEM_SHARED_LIBRARIES :=
LOCAL_ADDRESS_SANITIZER := false
LOCAL_SANITIZE := never
# 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
# libprofile_rt when it is linked into the final binary. Since the final binary
@@ -1082,7 +1127,7 @@ LOCAL_CLANG := $(use_clang)
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
LOCAL_CXX_STL := none
LOCAL_SYSTEM_SHARED_LIBRARIES :=
LOCAL_ADDRESS_SANITIZER := false
LOCAL_SANITIZE := never
LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
include $(BUILD_STATIC_LIBRARY)
@@ -1104,7 +1149,7 @@ LOCAL_CFLAGS := $(libc_common_cflags) -fno-builtin
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
LOCAL_CXX_STL := none
LOCAL_SYSTEM_SHARED_LIBRARIES :=
LOCAL_ADDRESS_SANITIZER := false
LOCAL_SANITIZE := never
LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
include $(BUILD_STATIC_LIBRARY)
@@ -1130,7 +1175,7 @@ LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
LOCAL_CFLAGS := $(libc_common_cflags) -fvisibility=hidden -O0
LOCAL_CPPFLAGS := $(libc_common_cppflags)
LOCAL_C_INCLUDES := $(libc_common_c_includes)
LOCAL_ADDRESS_SANITIZER := false
LOCAL_SANITIZE := never
LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
LOCAL_SYSTEM_SHARED_LIBRARIES :=
@@ -1214,7 +1259,7 @@ LOCAL_SYSTEM_SHARED_LIBRARIES :=
# TODO: split out the asflags.
LOCAL_ASFLAGS := $(LOCAL_CFLAGS)
LOCAL_ADDRESS_SANITIZER := false
LOCAL_SANITIZE := never
LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags))
@@ -1252,7 +1297,7 @@ LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
LOCAL_WHOLE_STATIC_LIBRARIES := libc_common
LOCAL_CXX_STL := none
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))
@@ -1275,7 +1320,7 @@ LOCAL_C_INCLUDES := $(libc_common_c_includes)
LOCAL_MODULE := libc_malloc
LOCAL_CLANG := $(use_clang)
LOCAL_CXX_STL := none
LOCAL_ADDRESS_SANITIZER := false
LOCAL_SANITIZE := never
LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
include $(BUILD_STATIC_LIBRARY)
@@ -1308,7 +1353,7 @@ endif
LOCAL_CXX_STL := none
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))
@@ -1340,7 +1385,12 @@ LOCAL_CLANG := $(use_clang)
LOCAL_REQUIRED_MODULES := tzdata
LOCAL_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 \
# Leave the symbols in the shared library so that stack unwinders can produce
# meaningful name resolution.
@@ -1367,17 +1417,26 @@ endif
LOCAL_CXX_STL := none
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.
LOCAL_LDFLAGS := -Wl,--version-script,$(LOCAL_PATH)/libc.map
LOCAL_LDFLAGS_arm += -Wl,--version-script,$(LOCAL_PATH)/libc.arm.map
LOCAL_LDFLAGS_arm64 += -Wl,--version-script,$(LOCAL_PATH)/libc.arm64.map
LOCAL_LDFLAGS_mips += -Wl,--version-script,$(LOCAL_PATH)/libc.mips.map
LOCAL_LDFLAGS_mips64 += -Wl,--version-script,$(LOCAL_PATH)/libc.mips64.map
LOCAL_LDFLAGS_x86 += -Wl,--version-script,$(LOCAL_PATH)/libc.x86.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
# before, these symbols must continue to be exported on LP32 for binary
# compatibility.
LOCAL_LDFLAGS_64 := -Wl,--exclude-libs,libgcc.a
# TODO: This is to work around b/19059885. Remove after root cause is fixed
LOCAL_LDFLAGS_arm := -Wl,--hash-style=both
LOCAL_LDFLAGS_x86 := -Wl,--hash-style=both
# Unfortunately --exclude-libs clobbers our version script, so we have to
# prevent the build system from using this flag.
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_SRC_FILES,libc_arch_dynamic_src_files))
@@ -1390,7 +1449,7 @@ LOCAL_CFLAGS_arm += -DCRT_LEGACY_WORKAROUND
LOCAL_SRC_FILES_arm += \
arch-arm/bionic/atexit_legacy.c
LOCAL_ADDRESS_SANITIZER := false
LOCAL_SANITIZE := never
LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
include $(BUILD_SHARED_LIBRARY)
@@ -1418,8 +1477,8 @@ LOCAL_C_INCLUDES := \
$(libc_common_c_includes) \
LOCAL_SRC_FILES := \
bionic/debug_backtrace.cpp \
bionic/debug_mapinfo.cpp \
bionic/debug_stacktrace.cpp \
bionic/libc_logging.cpp \
bionic/malloc_debug_leak.cpp \
bionic/malloc_debug_check.cpp \
@@ -1436,15 +1495,20 @@ LOCAL_SYSTEM_SHARED_LIBRARIES :=
# Only need this for arm since libc++ uses its own unwind code that
# doesn't mix with the other default unwind code.
LOCAL_STATIC_LIBRARIES_arm := libunwind_llvm
LOCAL_LDFLAGS_arm := -Wl,--exclude-libs,libunwind_llvm.a
LOCAL_STATIC_LIBRARIES += libc++abi
LOCAL_ALLOW_UNDEFINED_SYMBOLS := true
# 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
# 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
LOCAL_MODULE_TAGS := eng debug
LOCAL_ADDRESS_SANITIZER := false
LOCAL_SANITIZE := never
LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags))
@@ -1482,9 +1546,13 @@ LOCAL_SYSTEM_SHARED_LIBRARIES :=
# 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
# 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
LOCAL_MODULE_TAGS := eng debug
LOCAL_ADDRESS_SANITIZER := false
LOCAL_SANITIZE := never
LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
$(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags))
@@ -1506,7 +1574,7 @@ LOCAL_C_INCLUDES := $(libc_common_c_includes) bionic/libstdc++/include
LOCAL_CFLAGS := $(libc_common_cflags)
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_x86 := -Wl,--hash-style=both
@@ -1515,7 +1583,7 @@ LOCAL_MODULE:= libstdc++
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_CXX_STL := none
LOCAL_SYSTEM_SHARED_LIBRARIES := libc
LOCAL_ADDRESS_SANITIZER := false
LOCAL_SANITIZE := never
LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
include $(BUILD_SHARED_LIBRARY)
@@ -1531,7 +1599,7 @@ LOCAL_MODULE:= libstdc++
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_CXX_STL := none
LOCAL_SYSTEM_SHARED_LIBRARIES := libc
LOCAL_ADDRESS_SANITIZER := false
LOCAL_SANITIZE := never
LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
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
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>
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
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 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:setgroups(int, const gid_t*) arm64,mips,mips64,x86_64
int setpgid(pid_t, pid_t) all
pid_t vfork(void) arm
int setregid:setregid32(gid_t, gid_t) arm,x86
int setregid:setregid(gid_t, gid_t) arm64,mips,mips64,x86_64
int chroot(const char*) all
@@ -95,6 +94,16 @@ 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 pwrite64(int, void*, size_t, off64_t) arm,mips,x86
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
pid_t __getpid:getpid() all
int munmap(void*, size_t) all
@@ -124,7 +133,7 @@ int fchown:fchown(int, uid_t, gid_t) arm64,mips,mips64,x86_64
void sync(void) 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 flistxattr(int, char*, size_t) all
ssize_t ___flistxattr:flistxattr(int, char*, size_t) all
int fremovexattr(int, const char*) all
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
# vdso stuff.
int clock_gettime(clockid_t, timespec*) arm,mips,mips64,x86
int __clock_gettime:clock_gettime(clockid_t, timespec*) arm64,x86_64
int gettimeofday(timeval*, timezone*) arm,mips,mips64,x86
int __gettimeofday:gettimeofday(timeval*, timezone*) arm64,x86_64
int clock_gettime(clockid_t, timespec*) arm,mips,mips64
int __clock_gettime:clock_gettime(clockid_t, timespec*) arm64,x86,x86_64
int gettimeofday(timeval*, timezone*) arm,mips,mips64
int __gettimeofday:gettimeofday(timeval*, timezone*) arm64,x86,x86_64

View File

@@ -1,33 +1,19 @@
# 32-bit arm.
#
# Default implementations of functions that are commonly optimized.
#
libc_bionic_src_files_arm += \
bionic/strchr.cpp \
bionic/strnlen.c \
bionic/strrchr.cpp \
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 \
libc_freebsd_src_files_arm += \
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_bionic_src_files_exclude_arm += \
bionic/__memcpy_chk.cpp \
bionic/__memset_chk.cpp \
libc_openbsd_src_files_arm += \
upstream-openbsd/lib/libc/string/memchr.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 \
libc_openbsd_src_files_exclude_arm += \
upstream-openbsd/lib/libc/string/strcpy.c \
#
# Inherently architecture-specific code.
@@ -39,9 +25,11 @@ libc_bionic_src_files_arm += \
arch-arm/bionic/__bionic_clone.S \
arch-arm/bionic/_exit_with_stack_teardown.S \
arch-arm/bionic/libgcc_compat.c \
arch-arm/bionic/popcount_tab.c \
arch-arm/bionic/__restore.S \
arch-arm/bionic/setjmp.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_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)),)
$(warning TARGET_$(my_2nd_arch_prefix)ARCH is arm, but TARGET_$(my_2nd_arch_prefix)CPU_VARIANT is not defined)
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
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.")
@@ -58,6 +47,7 @@ include $(cpu_variant_mk)
libc_common_additional_dependencies += $(cpu_variant_mk)
cpu_variant_mk :=
endif
libc_crt_target_cflags_arm := \

View File

@@ -34,7 +34,9 @@
// __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
// 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).
#undef __bionic_asm_custom_entry
@@ -44,18 +46,18 @@
.save {r0-r15}
.pad #32
nop
ENTRY_PRIVATE(__restore)
ENTRY_PRIVATE_NO_DWARF(__restore)
// This function must have exactly this instruction sequence.
mov r7, #__NR_sigreturn
swi #0
END(__restore)
END_NO_DWARF(__restore)
.fnstart
.save {r0-r15}
.pad #160
nop
ENTRY_PRIVATE(__restore_rt)
ENTRY_PRIVATE_NO_DWARF(__restore_rt)
// This function must have exactly this instruction sequence.
mov r7, #__NR_rt_sigreturn
swi #0
END(__restore_rt)
END_NO_DWARF(__restore_rt)

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.
// Current layout (may change in the future):
//
// word name description
// 0 magic magic number
// 1 sigmask signal mask (not used with _setjmp / _longjmp)
// 2 float_base base of float registers (d8 to d15)
// 18 float_state floating-point status and control register
// 19 core_base base of core registers (r4 to r14)
// 30 reserved reserved entries (room to grow)
// word name description
// 0 sigflag/cookie setjmp cookie in top 31 bits, signal mask flag in low bit
// 1 sigmask signal mask (not used with _setjmp / _longjmp)
// 2 float_base base of float registers (d8 to d15)
// 18 float_state floating-point status and control register
// 19 core_base base of core registers (r4 to r14)
// 30 reserved reserved entries (room to grow)
// 64
//
// NOTE: float_base must be at an even word index, since the
@@ -80,33 +80,82 @@ ENTRY(_setjmp)
b sigsetjmp
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);
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)]
// Do we need to save the signal mask?
teq r1, #0
tst r1, #1
beq 1f
// Get current signal mask.
stmfd sp!, {r0, r14}
.cfi_def_cfa_offset 8
.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
// Align the stack.
sub sp, #4
.cfi_adjust_cfa_offset 4
// Save the signal mask.
str r1, [r0, #(_JB_SIGMASK * 4)]
// Save the current signal mask.
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:
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.
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.
add r1, r0, #(_JB_FLOAT_BASE * 4)
@@ -122,29 +171,30 @@ END(sigsetjmp)
// void siglongjmp(sigjmp_buf env, int value);
ENTRY(siglongjmp)
// Do we need to restore the signal mask?
ldr r2, [r0, #(_JB_SIGFLAG * 4)]
teq r2, #0
beq 1f
// Restore the signal mask.
stmfd sp!, {r0, r1, r14}
stmfd sp!, {r0, r1, lr}
.cfi_def_cfa_offset 12
.cfi_rel_offset r0, 0
.cfi_rel_offset r1, 4
.cfi_rel_offset r14, 8
sub sp, sp, #4 // Align the stack.
.cfi_adjust_cfa_offset 4
.cfi_rel_offset lr, 8
// 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)]
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:
ldmfd sp!, {r0, r1, lr}
.cfi_adjust_cfa_offset -12
.cfi_restore r0
.cfi_restore r1
.cfi_restore lr
// Restore floating-point registers.
add r2, r0, #(_JB_FLOAT_BASE * 4)
vldmia r2, {d8-d15}
@@ -154,16 +204,27 @@ ENTRY(siglongjmp)
fmxr fpscr, r2
// Restore core registers.
ldr r3, [r0, #(_JB_SIGFLAG * 4)]
bic r3, r3, #1
add r2, r0, #(_JB_CORE_BASE * 4)
ldmia r2, {r4-r14}
// Validate sp and r14.
teq sp, #0
teqne r14, #0
bleq longjmperror
// ARM deprecates using sp in the register list for ldmia.
ldmia r2, {r4-r12, lr}
ldr sp, [r2, #(10 * 4)]
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
moveq r0, #1
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.
*
* Redistribution and use in source and binary forms, with or without
@@ -26,191 +26,7 @@
* SUCH DAMAGE.
*/
#include <private/bionic_asm.h>
#include <private/libc_events.h>
// Indicate which memcpy base file to include.
#define MEMCPY_BASE "memcpy_base.S"
.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 __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"
#include "__strcat_chk_common.S"

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.
*
* Redistribution and use in source and binary forms, with or without
@@ -26,155 +26,7 @@
* SUCH DAMAGE.
*/
#include <private/bionic_asm.h>
#include <private/libc_events.h>
// Indicate which memcpy base file to include.
#define MEMCPY_BASE "memcpy_base.S"
.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 __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"
#include "__strcpy_chk_common.S"

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.
*
* 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
* 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 <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"
#include "memcpy_common.S"

View File

@@ -53,11 +53,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
ENTRY_PRIVATE(MEMCPY_BASE)
.cfi_def_cfa_offset 8
.cfi_rel_offset r0, 0
.cfi_rel_offset lr, 4
.L_memcpy_base:
// Assumes that n >= 0, and dst, src are valid pointers.
// For any sizes less than 832 use the neon code that doesn't
// care about the src alignment. This avoids any checks
@@ -168,12 +164,6 @@ ENTRY_PRIVATE(MEMCPY_BASE)
eor r3, r0, r1
ands r3, r3, #0x3
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,
// i.e., not keeping the stack looking like users expect
@@ -185,7 +175,7 @@ ENTRY_PRIVATE(MEMCPY_BASE_ALIGNED)
strd r6, r7, [sp, #-8]!
.cfi_adjust_cfa_offset 8
.cfi_rel_offset r6, 0
.cfi_rel_offset r7, 0
.cfi_rel_offset r7, 4
strd r8, r9, [sp, #-8]!
.cfi_adjust_cfa_offset 8
.cfi_rel_offset r8, 0
@@ -291,10 +281,28 @@ ENTRY_PRIVATE(MEMCPY_BASE_ALIGNED)
// Restore registers: optimized pop {r0, pc}
ldrd r8, r9, [sp], #8
.cfi_adjust_cfa_offset -8
.cfi_restore r8
.cfi_restore r9
ldrd r6, r7, [sp], #8
.cfi_adjust_cfa_offset -8
.cfi_restore r6
.cfi_restore r7
ldrd r4, r5, [sp], #8
.cfi_adjust_cfa_offset -8
.cfi_restore r4
.cfi_restore r5
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:
// Align dst to word.
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.
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
ldrb r3, [r0]
cbz r3, strcat_r0_scan_done
cbz r3, .L_strcat_r0_scan_done
add r0, #1
.endm // m_scan_byte
@@ -84,10 +84,10 @@ ENTRY(strcat)
// Quick check to see if src is empty.
ldrb r2, [r1]
pld [r1, #0]
cbnz r2, strcat_continue
cbnz r2, .L_strcat_continue
bx lr
strcat_continue:
.L_strcat_continue:
// To speed up really small dst strings, unroll checking the first 4 bytes.
m_push
m_scan_byte
@@ -96,95 +96,102 @@ strcat_continue:
m_scan_byte
ands r3, r0, #7
beq strcat_mainloop
beq .L_strcat_mainloop
// Align to a double word (64 bits).
rsb r3, r3, #8
lsls ip, r3, #31
beq strcat_align_to_32
beq .L_strcat_align_to_32
ldrb r5, [r0]
cbz r5, strcat_r0_scan_done
cbz r5, .L_strcat_r0_scan_done
add r0, r0, #1
strcat_align_to_32:
bcc strcat_align_to_64
.L_strcat_align_to_32:
bcc .L_strcat_align_to_64
ldrb r2, [r0]
cbz r2, strcat_r0_scan_done
cbz r2, .L_strcat_r0_scan_done
add r0, r0, #1
ldrb r4, [r0]
cbz r4, strcat_r0_scan_done
cbz r4, .L_strcat_r0_scan_done
add r0, r0, #1
strcat_align_to_64:
.L_strcat_align_to_64:
tst r3, #4
beq strcat_mainloop
beq .L_strcat_mainloop
ldr r3, [r0], #4
sub ip, r3, #0x01010101
bic ip, ip, r3
ands ip, ip, #0x80808080
bne strcat_zero_in_second_register
b strcat_mainloop
bne .L_strcat_zero_in_second_register
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
// new code doesn't win until after about 8 bytes.
m_copy_byte reg=r2, cmd=cbz, label=strcpy_finish
m_copy_byte reg=r3, cmd=cbz, label=strcpy_finish
m_copy_byte reg=r4, cmd=cbz, label=strcpy_finish
m_copy_byte reg=r5, cmd=cbz, label=strcpy_finish
m_copy_byte reg=r2, cmd=cbz, label=strcpy_finish
m_copy_byte reg=r3, cmd=cbz, label=strcpy_finish
m_copy_byte reg=r4, cmd=cbz, label=strcpy_finish
m_copy_byte reg=r5, cmd=cbnz, label=strcpy_continue
m_copy_byte reg=r2, cmd=cbz, label=.L_strcpy_finish
m_copy_byte reg=r3, cmd=cbz, label=.L_strcpy_finish
m_copy_byte reg=r4, cmd=cbz, label=.L_strcpy_finish
m_copy_byte reg=r5, cmd=cbz, label=.L_strcpy_finish
m_copy_byte reg=r2, cmd=cbz, label=.L_strcpy_finish
m_copy_byte reg=r3, cmd=cbz, label=.L_strcpy_finish
m_copy_byte reg=r4, cmd=cbz, label=.L_strcpy_finish
m_copy_byte reg=r5, cmd=cbnz, label=.L_strcpy_continue
strcpy_finish:
.L_strcpy_finish:
m_pop
strcpy_continue:
.L_strcpy_continue:
ands r3, r0, #7
beq strcpy_check_src_align
beq .L_strcpy_check_src_align
// Align to a double word (64 bits).
rsb r3, r3, #8
lsls ip, r3, #31
beq strcpy_align_to_32
beq .L_strcpy_align_to_32
ldrb r2, [r1], #1
strb r2, [r0], #1
cbz r2, strcpy_complete
cbz r2, .L_strcpy_complete
strcpy_align_to_32:
bcc strcpy_align_to_64
.L_strcpy_align_to_32:
bcc .L_strcpy_align_to_64
ldrb r2, [r1], #1
strb r2, [r0], #1
cbz r2, strcpy_complete
cbz r2, .L_strcpy_complete
ldrb r2, [r1], #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
beq strcpy_check_src_align
ldr r2, [r1], #4
beq .L_strcpy_check_src_align
// 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
bic ip, ip, r2
ands ip, ip, #0x80808080
bne strcpy_zero_in_first_register
str r2, [r0], #4
strcpy_check_src_align:
.L_strcpy_check_src_align:
// At this point dst is aligned to a double word, check if src
// is also aligned to a double word.
ands r3, r1, #7
bne strcpy_unaligned_copy
bne .L_strcpy_unaligned_copy
.p2align 2
strcpy_mainloop:
.L_strcpy_mainloop:
ldrd r2, r3, [r1], #8
pld [r1, #64]
@@ -192,128 +199,128 @@ strcpy_mainloop:
sub ip, r2, #0x01010101
bic ip, ip, r2
ands ip, ip, #0x80808080
bne strcpy_zero_in_first_register
bne .L_strcpy_zero_in_first_register
sub ip, r3, #0x01010101
bic ip, ip, r3
ands ip, ip, #0x80808080
bne strcpy_zero_in_second_register
bne .L_strcpy_zero_in_second_register
strd r2, r3, [r0], #8
b strcpy_mainloop
b .L_strcpy_mainloop
strcpy_complete:
.L_strcpy_complete:
m_pop
strcpy_zero_in_first_register:
.L_strcpy_zero_in_first_register:
lsls lr, ip, #17
bne strcpy_copy1byte
bcs strcpy_copy2bytes
bne .L_strcpy_copy1byte
bcs .L_strcpy_copy2bytes
lsls ip, ip, #1
bne strcpy_copy3bytes
bne .L_strcpy_copy3bytes
strcpy_copy4bytes:
.L_strcpy_copy4bytes:
// Copy 4 bytes to the destiniation.
str r2, [r0]
m_pop
strcpy_copy1byte:
.L_strcpy_copy1byte:
strb r2, [r0]
m_pop
strcpy_copy2bytes:
.L_strcpy_copy2bytes:
strh r2, [r0]
m_pop
strcpy_copy3bytes:
.L_strcpy_copy3bytes:
strh r2, [r0], #2
lsr r2, #16
strb r2, [r0]
m_pop
strcpy_zero_in_second_register:
.L_strcpy_zero_in_second_register:
lsls lr, ip, #17
bne strcpy_copy5bytes
bcs strcpy_copy6bytes
bne .L_strcpy_copy5bytes
bcs .L_strcpy_copy6bytes
lsls ip, ip, #1
bne strcpy_copy7bytes
bne .L_strcpy_copy7bytes
// Copy 8 bytes to the destination.
strd r2, r3, [r0]
m_pop
strcpy_copy5bytes:
.L_strcpy_copy5bytes:
str r2, [r0], #4
strb r3, [r0]
m_pop
strcpy_copy6bytes:
.L_strcpy_copy6bytes:
str r2, [r0], #4
strh r3, [r0]
m_pop
strcpy_copy7bytes:
.L_strcpy_copy7bytes:
str r2, [r0], #4
strh r3, [r0], #2
lsr r3, #16
strb r3, [r0]
m_pop
strcpy_unaligned_copy:
.L_strcpy_unaligned_copy:
// Dst is aligned to a double word, while src is at an unknown alignment.
// There are 7 different versions of the unaligned copy code
// 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
// be read without potentially crossing a page boundary.
tbb [pc, r3]
strcpy_unaligned_branchtable:
.L_strcpy_unaligned_branchtable:
.byte 0
.byte ((strcpy_unalign7 - strcpy_unaligned_branchtable)/2)
.byte ((strcpy_unalign6 - strcpy_unaligned_branchtable)/2)
.byte ((strcpy_unalign5 - strcpy_unaligned_branchtable)/2)
.byte ((strcpy_unalign4 - strcpy_unaligned_branchtable)/2)
.byte ((strcpy_unalign3 - strcpy_unaligned_branchtable)/2)
.byte ((strcpy_unalign2 - strcpy_unaligned_branchtable)/2)
.byte ((strcpy_unalign1 - strcpy_unaligned_branchtable)/2)
.byte ((.L_strcpy_unalign7 - .L_strcpy_unaligned_branchtable)/2)
.byte ((.L_strcpy_unalign6 - .L_strcpy_unaligned_branchtable)/2)
.byte ((.L_strcpy_unalign5 - .L_strcpy_unaligned_branchtable)/2)
.byte ((.L_strcpy_unalign4 - .L_strcpy_unaligned_branchtable)/2)
.byte ((.L_strcpy_unalign3 - .L_strcpy_unaligned_branchtable)/2)
.byte ((.L_strcpy_unalign2 - .L_strcpy_unaligned_branchtable)/2)
.byte ((.L_strcpy_unalign1 - .L_strcpy_unaligned_branchtable)/2)
.p2align 2
// Can read 7 bytes before possibly crossing a page.
strcpy_unalign7:
.L_strcpy_unalign7:
ldr r2, [r1], #4
sub ip, r2, #0x01010101
bic ip, ip, r2
ands ip, ip, #0x80808080
bne strcpy_zero_in_first_register
bne .L_strcpy_zero_in_first_register
ldrb r3, [r1]
cbz r3, strcpy_unalign7_copy5bytes
cbz r3, .L_strcpy_unalign7_copy5bytes
ldrb r4, [r1, #1]
cbz r4, strcpy_unalign7_copy6bytes
cbz r4, .L_strcpy_unalign7_copy6bytes
ldrb r5, [r1, #2]
cbz r5, strcpy_unalign7_copy7bytes
cbz r5, .L_strcpy_unalign7_copy7bytes
ldr r3, [r1], #4
pld [r1, #64]
lsrs ip, r3, #24
strd r2, r3, [r0], #8
beq strcpy_unalign_return
b strcpy_unalign7
beq .L_strcpy_unalign_return
b .L_strcpy_unalign7
strcpy_unalign7_copy5bytes:
.L_strcpy_unalign7_copy5bytes:
str r2, [r0], #4
strb r3, [r0]
strcpy_unalign_return:
.L_strcpy_unalign_return:
m_pop
strcpy_unalign7_copy6bytes:
.L_strcpy_unalign7_copy6bytes:
str r2, [r0], #4
strb r3, [r0], #1
strb r4, [r0], #1
m_pop
strcpy_unalign7_copy7bytes:
.L_strcpy_unalign7_copy7bytes:
str r2, [r0], #4
strb r3, [r0], #1
strb r4, [r0], #1
@@ -322,41 +329,41 @@ strcpy_unalign7_copy7bytes:
.p2align 2
// Can read 6 bytes before possibly crossing a page.
strcpy_unalign6:
.L_strcpy_unalign6:
ldr r2, [r1], #4
sub ip, r2, #0x01010101
bic ip, ip, r2
ands ip, ip, #0x80808080
bne strcpy_zero_in_first_register
bne .L_strcpy_zero_in_first_register
ldrb r4, [r1]
cbz r4, strcpy_unalign_copy5bytes
cbz r4, .L_strcpy_unalign_copy5bytes
ldrb r5, [r1, #1]
cbz r5, strcpy_unalign_copy6bytes
cbz r5, .L_strcpy_unalign_copy6bytes
ldr r3, [r1], #4
pld [r1, #64]
tst r3, #0xff0000
beq strcpy_copy7bytes
beq .L_strcpy_copy7bytes
lsrs ip, r3, #24
strd r2, r3, [r0], #8
beq strcpy_unalign_return
b strcpy_unalign6
beq .L_strcpy_unalign_return
b .L_strcpy_unalign6
.p2align 2
// Can read 5 bytes before possibly crossing a page.
strcpy_unalign5:
.L_strcpy_unalign5:
ldr r2, [r1], #4
sub ip, r2, #0x01010101
bic ip, ip, r2
ands ip, ip, #0x80808080
bne strcpy_zero_in_first_register
bne .L_strcpy_zero_in_first_register
ldrb r4, [r1]
cbz r4, strcpy_unalign_copy5bytes
cbz r4, .L_strcpy_unalign_copy5bytes
ldr r3, [r1], #4
@@ -365,17 +372,17 @@ strcpy_unalign5:
sub ip, r3, #0x01010101
bic ip, ip, r3
ands ip, ip, #0x80808080
bne strcpy_zero_in_second_register
bne .L_strcpy_zero_in_second_register
strd r2, r3, [r0], #8
b strcpy_unalign5
b .L_strcpy_unalign5
strcpy_unalign_copy5bytes:
.L_strcpy_unalign_copy5bytes:
str r2, [r0], #4
strb r4, [r0]
m_pop
strcpy_unalign_copy6bytes:
.L_strcpy_unalign_copy6bytes:
str r2, [r0], #4
strb r4, [r0], #1
strb r5, [r0]
@@ -383,13 +390,13 @@ strcpy_unalign_copy6bytes:
.p2align 2
// Can read 4 bytes before possibly crossing a page.
strcpy_unalign4:
.L_strcpy_unalign4:
ldr r2, [r1], #4
sub ip, r2, #0x01010101
bic ip, ip, r2
ands ip, ip, #0x80808080
bne strcpy_zero_in_first_register
bne .L_strcpy_zero_in_first_register
ldr r3, [r1], #4
pld [r1, #64]
@@ -397,20 +404,20 @@ strcpy_unalign4:
sub ip, r3, #0x01010101
bic ip, ip, r3
ands ip, ip, #0x80808080
bne strcpy_zero_in_second_register
bne .L_strcpy_zero_in_second_register
strd r2, r3, [r0], #8
b strcpy_unalign4
b .L_strcpy_unalign4
.p2align 2
// Can read 3 bytes before possibly crossing a page.
strcpy_unalign3:
.L_strcpy_unalign3:
ldrb r2, [r1]
cbz r2, strcpy_unalign3_copy1byte
cbz r2, .L_strcpy_unalign3_copy1byte
ldrb r3, [r1, #1]
cbz r3, strcpy_unalign3_copy2bytes
cbz r3, .L_strcpy_unalign3_copy2bytes
ldrb r4, [r1, #2]
cbz r4, strcpy_unalign3_copy3bytes
cbz r4, .L_strcpy_unalign3_copy3bytes
ldr r2, [r1], #4
ldr r3, [r1], #4
@@ -418,26 +425,26 @@ strcpy_unalign3:
pld [r1, #64]
lsrs lr, r2, #24
beq strcpy_copy4bytes
beq .L_strcpy_copy4bytes
sub ip, r3, #0x01010101
bic ip, ip, r3
ands ip, ip, #0x80808080
bne strcpy_zero_in_second_register
bne .L_strcpy_zero_in_second_register
strd r2, r3, [r0], #8
b strcpy_unalign3
b .L_strcpy_unalign3
strcpy_unalign3_copy1byte:
.L_strcpy_unalign3_copy1byte:
strb r2, [r0]
m_pop
strcpy_unalign3_copy2bytes:
.L_strcpy_unalign3_copy2bytes:
strb r2, [r0], #1
strb r3, [r0]
m_pop
strcpy_unalign3_copy3bytes:
.L_strcpy_unalign3_copy3bytes:
strb r2, [r0], #1
strb r3, [r0], #1
strb r4, [r0]
@@ -445,34 +452,34 @@ strcpy_unalign3_copy3bytes:
.p2align 2
// Can read 2 bytes before possibly crossing a page.
strcpy_unalign2:
.L_strcpy_unalign2:
ldrb r2, [r1]
cbz r2, strcpy_unalign_copy1byte
cbz r2, .L_strcpy_unalign_copy1byte
ldrb r4, [r1, #1]
cbz r4, strcpy_unalign_copy2bytes
cbz r4, .L_strcpy_unalign_copy2bytes
ldr r2, [r1], #4
ldr r3, [r1], #4
pld [r1, #64]
tst r2, #0xff0000
beq strcpy_copy3bytes
beq .L_strcpy_copy3bytes
lsrs ip, r2, #24
beq strcpy_copy4bytes
beq .L_strcpy_copy4bytes
sub ip, r3, #0x01010101
bic ip, ip, r3
ands ip, ip, #0x80808080
bne strcpy_zero_in_second_register
bne .L_strcpy_zero_in_second_register
strd r2, r3, [r0], #8
b strcpy_unalign2
b .L_strcpy_unalign2
.p2align 2
// Can read 1 byte before possibly crossing a page.
strcpy_unalign1:
.L_strcpy_unalign1:
ldrb r2, [r1]
cbz r2, strcpy_unalign_copy1byte
cbz r2, .L_strcpy_unalign_copy1byte
ldr r2, [r1], #4
ldr r3, [r1], #4
@@ -482,27 +489,27 @@ strcpy_unalign1:
sub ip, r2, #0x01010101
bic ip, ip, r2
ands ip, ip, #0x80808080
bne strcpy_zero_in_first_register
bne .L_strcpy_zero_in_first_register
sub ip, r3, #0x01010101
bic ip, ip, r3
ands ip, ip, #0x80808080
bne strcpy_zero_in_second_register
bne .L_strcpy_zero_in_second_register
strd r2, r3, [r0], #8
b strcpy_unalign1
b .L_strcpy_unalign1
strcpy_unalign_copy1byte:
.L_strcpy_unalign_copy1byte:
strb r2, [r0]
m_pop
strcpy_unalign_copy2bytes:
.L_strcpy_unalign_copy2bytes:
strb r2, [r0], #1
strb r4, [r0]
m_pop
.p2align 2
strcat_mainloop:
.L_strcat_mainloop:
ldrd r2, r3, [r0], #8
pld [r0, #64]
@@ -510,59 +517,59 @@ strcat_mainloop:
sub ip, r2, #0x01010101
bic ip, ip, r2
ands ip, ip, #0x80808080
bne strcat_zero_in_first_register
bne .L_strcat_zero_in_first_register
sub ip, r3, #0x01010101
bic ip, ip, r3
ands ip, ip, #0x80808080
bne strcat_zero_in_second_register
b strcat_mainloop
bne .L_strcat_zero_in_second_register
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.
pld [r1, #0]
lsls lr, ip, #17
bne strcat_sub8
bcs strcat_sub7
bne .L_strcat_sub8
bcs .L_strcat_sub7
lsls ip, ip, #1
bne strcat_sub6
bne .L_strcat_sub6
sub r0, r0, #5
b strcat_r0_scan_done
b .L_strcat_r0_scan_done
strcat_sub8:
.L_strcat_sub8:
sub r0, r0, #8
b strcat_r0_scan_done
b .L_strcat_r0_scan_done
strcat_sub7:
.L_strcat_sub7:
sub r0, r0, #7
b strcat_r0_scan_done
b .L_strcat_r0_scan_done
strcat_sub6:
.L_strcat_sub6:
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.
pld [r1, #0]
lsls lr, ip, #17
bne strcat_sub4
bcs strcat_sub3
bne .L_strcat_sub4
bcs .L_strcat_sub3
lsls ip, ip, #1
bne strcat_sub2
bne .L_strcat_sub2
sub r0, r0, #1
b strcat_r0_scan_done
b .L_strcat_r0_scan_done
strcat_sub4:
.L_strcat_sub4:
sub r0, r0, #4
b strcat_r0_scan_done
b .L_strcat_r0_scan_done
strcat_sub3:
.L_strcat_sub3:
sub r0, r0, #3
b strcat_r0_scan_done
b .L_strcat_r0_scan_done
strcat_sub2:
.L_strcat_sub2:
sub r0, r0, #2
b strcat_r0_scan_done
b .L_strcat_r0_scan_done
END(strcat)

View File

@@ -149,13 +149,20 @@ ENTRY(strcpy)
.Lstringcopy_align_to_64:
tst r3, #4
beq .Lstringcopy_check_src_align
ldr r2, [r1], #4
sub ip, r2, #0x01010101
bic ip, ip, r2
ands ip, ip, #0x80808080
bne .Lstringcopy_zero_in_first_register
str r2, [r0], #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.
ldrb r2, [r1], #1
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
ldrb r2, [r1], #1
strb r2, [r0], #1
cbz r2, .Lstringcopy_complete
.Lstringcopy_check_src_align:
// At this point dst is aligned to a double word, check if src

View File

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

@@ -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/__strcat_chk_common.S"

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.
*
* Redistribution and use in source and binary forms, with or without
@@ -26,9 +26,7 @@
* SUCH DAMAGE.
*/
#ifndef _SYS_SHM_H_
#define _SYS_SHM_H_
// Indicate which memcpy base file to include.
#define MEMCPY_BASE "arch-arm/cortex-a53/bionic/memcpy_base.S"
#include <linux/shm.h>
#endif /* _SYS_SHM_H_ */
#include "arch-arm/cortex-a15/bionic/memcpy_common.S"

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 */
eor r3, r0, r1
ands r3, r3, #0x3
beq __memcpy_base_aligned
beq MEMCPY_BASE_ALIGNED
/* Check the upper size limit for Neon unaligned memory access in memcpy */
cmp r2, #224
@@ -133,8 +133,7 @@ ENTRY_PRIVATE(MEMCPY_BASE)
strbcs ip, [r0], #1
strbcs lr, [r0], #1
ldmfd sp!, {r0, lr}
bx lr
ldmfd sp!, {r0, pc}
END(MEMCPY_BASE)
ENTRY_PRIVATE(MEMCPY_BASE_ALIGNED)

View File

@@ -69,12 +69,9 @@ END(bzero)
ENTRY(memset)
// The neon memset only wins for less than 132.
cmp r2, #132
bhi __memset_large_copy
stmfd sp!, {r0}
.cfi_def_cfa_offset 4
.cfi_rel_offset r0, 0
bhi .L_memset_large_copy
mov r3, r0
vdup.8 q0, r1
/* 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 */
subs r2, r2, #32
vst1.8 {d0 - d3}, [r0]!
vst1.8 {d0 - d3}, [r3]!
bhs 1b
2: /* less than 32 left */
@@ -93,22 +90,20 @@ ENTRY(memset)
beq 3f
// 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) */
movs ip, r2, lsl #29
bcc 1f
vst1.8 {d0}, [r0]!
vst1.8 {d0}, [r3]!
1: bge 2f
vst1.32 {d0[0]}, [r0]!
vst1.32 {d0[0]}, [r3]!
2: movs ip, r2, lsl #31
strbmi r1, [r0], #1
strbcs r1, [r0], #1
strbcs r1, [r0], #1
ldmfd sp!, {r0}
strbmi r1, [r3], #1
strbcs r1, [r3], #1
strbcs r1, [r3], #1
bx lr
END(memset)
ENTRY_PRIVATE(__memset_large_copy)
.L_memset_large_copy:
/* compute the offset to align the destination
* offset = (4-(src&3))&3 = -src & 3
*/
@@ -136,8 +131,7 @@ ENTRY_PRIVATE(__memset_large_copy)
strbcs r1, [r0], #1
strbmi r1, [r0], #1
subs r2, r2, r3
popls {r0, r4-r7, lr} /* return */
bxls lr
popls {r0, r4-r7, pc} /* return */
/* align the destination to a cache-line */
mov r12, r1
@@ -180,9 +174,8 @@ ENTRY_PRIVATE(__memset_large_copy)
strhmi r1, [r0], #2
movs r2, r2, lsl #2
strbcs r1, [r0]
ldmfd sp!, {r0, r4-r7, lr}
bx lr
END(__memset_large_copy)
ldmfd sp!, {r0, r4-r7, pc}
END(memset)
.data
error_string:

View File

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

View File

@@ -244,13 +244,20 @@ ENTRY(strcpy)
.Lstringcopy_align_to_64:
tst r3, #4
beq .Lstringcopy_check_src_align
ldr r2, [r1], #4
sub ip, r2, #0x01010101
bic ip, ip, r2
ands ip, ip, #0x80808080
bne .Lstringcopy_zero_in_first_register
stmia r0!, {r2}
// 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.
ldrb r2, [r1], #1
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
ldrb r2, [r1], #1
strb r2, [r0], #1
cbz r2, .Lstringcopy_complete
b .Lstringcopy_check_src_align
.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 += \
arch-arm/cortex-a9/bionic/memcpy.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/strlen.S \
libc_bionic_src_files_arm += \
arch-arm/generic/bionic/memcmp.S \
libc_bionic_src_files_arm += \
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 += \
arch-arm/generic/bionic/memcmp.S \
arch-arm/denver/bionic/memcpy.S \
arch-arm/denver/bionic/memmove.S \
arch-arm/denver/bionic/memset.S \

View File

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

View File

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

View File

@@ -82,8 +82,7 @@ ENTRY(memset)
strbcs r1, [r0], #1
strbmi r1, [r0], #1
subs r2, r2, r3
popls {r0, r4-r7, lr} /* return */
bxls lr
popls {r0, r4-r7, pc} /* return */
/* align the destination to a cache-line */
mov r12, r1
@@ -126,8 +125,7 @@ ENTRY(memset)
strhmi r1, [r0], #2
movs r2, r2, lsl #2
strbcs r1, [r0]
ldmfd sp!, {r0, r4-r7, lr}
bx lr
ldmfd sp!, {r0, r4-r7, pc}
END(memset)
.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)
pld [r0, #0]
push {r0, lr}
.cfi_def_cfa_offset 8
.cfi_adjust_cfa_offset 8
.cfi_rel_offset r0, 0
.cfi_rel_offset lr, 4
push {r4, r5}
@@ -177,7 +177,7 @@ ENTRY(__strcat_chk)
.L_strlen_done:
add r2, r3, r4
cmp r2, lr
bhi __strcat_chk_failed
bhi .L_strcat_chk_failed
// Set up the registers for the memcpy code.
mov r1, r5
@@ -185,20 +185,17 @@ ENTRY(__strcat_chk)
mov r2, r4
add r0, r0, r3
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"
ENTRY_PRIVATE(__strcat_chk_failed)
.cfi_def_cfa_offset 8
.cfi_rel_offset r0, 0
.cfi_rel_offset lr, 4
// 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:
@@ -208,7 +205,7 @@ error_code:
.word BIONIC_EVENT_STRCAT_BUFFER_OVERFLOW
error_message:
.word error_string-(1b+4)
END(__strcat_chk_failed)
END(__strcat_chk)
.data
error_string:

View File

@@ -39,7 +39,7 @@
ENTRY(__strcpy_chk)
pld [r0, #0]
push {r0, lr}
.cfi_def_cfa_offset 8
.cfi_adjust_cfa_offset 8
.cfi_rel_offset r0, 0
.cfi_rel_offset lr, 4
@@ -149,21 +149,14 @@ ENTRY(__strcpy_chk)
pld [r1, #64]
ldr r0, [sp]
cmp r3, lr
bhs __strcpy_chk_failed
bhs .L_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
.L_strcpy_chk_failed:
ldr r0, error_message
ldr r1, error_code
1:
@@ -173,7 +166,7 @@ error_code:
.word BIONIC_EVENT_STRCPY_BUFFER_OVERFLOW
error_message:
.word error_string-(1b+4)
END(__strcpy_chk_failed)
END(__strcpy_chk)
.data
error_string:

View File

@@ -45,7 +45,7 @@
ENTRY(__memcpy_chk)
cmp r2, r3
bhi __memcpy_chk_fail
bhi .L_memcpy_chk_fail
// Fall through to memcpy...
END(__memcpy_chk)
@@ -53,19 +53,20 @@ END(__memcpy_chk)
ENTRY(memcpy)
pld [r1, #64]
stmfd sp!, {r0, lr}
.cfi_def_cfa_offset 8
.cfi_adjust_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)
// 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.
push {lr}
.cfi_def_cfa_offset 4
.cfi_adjust_cfa_offset 4
.cfi_rel_offset lr, 0
ldr r0, error_message
@@ -77,7 +78,7 @@ error_code:
.word BIONIC_EVENT_MEMCPY_BUFFER_OVERFLOW
error_message:
.word error_string-(1b+4)
END(__memcpy_chk_fail)
END(memcpy)
.data
error_string:

View File

@@ -1,123 +1,191 @@
/*
* 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.
*/
/***************************************************************************
Copyright (c) 2009-2013 The Linux Foundation. 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.
* 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 code assumes it is running on a processor that supports all arm v7
* instructions, that supports neon instructions, and that has a 32 byte
* cache line.
*/
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 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)
.cfi_def_cfa_offset 8
.cfi_rel_offset r0, 0
.cfi_rel_offset lr, 4
#include <machine/cpu-features.h>
#include <machine/asm.h>
/* do we have at least 16-bytes to copy (needed for alignment below) */
cmp r2, #16
blo 5f
#define PLDOFFS (10)
#define PLDTHRESH (PLDOFFS)
#define BBTHRESH (4096/64)
#define PLDSIZE (64)
/* align destination to cache-line for the write-buffer */
rsb r3, r0, #0
ands r3, r3, #0xF
beq 2f
#if (PLDOFFS < 1)
#error Routine does not support offsets less than 1
#endif
/* 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, 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]!
#if (PLDTHRESH < PLDOFFS)
#error PLD threshold must be greater than or equal to the PLD offset
#endif
2: /* make sure we have at least 64 bytes to copy */
subs r2, r2, #64
blo 2f
.text
.fpu neon
1: /* The main loop copies 64 bytes at a time */
vld1.8 {d0 - d3}, [r1]!
vld1.8 {d4 - d7}, [r1]!
pld [r1, #(32*8)]
subs r2, r2, #64
vst1.8 {d0 - d3}, [r0, :128]!
vst1.8 {d4 - d7}, [r0, :128]!
bhs 1b
.L_memcpy_base:
cmp r2, #4
blt .L_neon_lt4
cmp r2, #16
blt .L_neon_lt16
cmp r2, #32
blt .L_neon_16
cmp r2, #64
blt .L_neon_copy_32_a
2: /* fix-up the remaining count and make sure we have >= 32 bytes left */
adds r2, r2, #32
blo 4f
mov r12, r2, lsr #6
cmp r12, #PLDTHRESH
ble .L_neon_copy_64_loop_nopld
/* Copy 32 bytes. These cache lines were already preloaded */
vld1.8 {d0 - d3}, [r1]!
sub r2, r2, #32
vst1.8 {d0 - d3}, [r0, :128]!
push {r9, r10}
.cfi_adjust_cfa_offset 8
.cfi_rel_offset r9, 0
.cfi_rel_offset r10, 4
4: /* less than 32 left */
add r2, r2, #32
tst r2, #0x10
beq 5f
// copies 16 bytes, 128-bits aligned
vld1.8 {d0, d1}, [r1]!
vst1.8 {d0, d1}, [r0, :128]!
cmp r12, #BBTHRESH
ble .L_neon_prime_pump
5: /* 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: 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
add lr, r0, #0x400
add r9, r1, #(PLDOFFS*PLDSIZE)
sub lr, lr, r9
lsl lr, lr, #21
lsr lr, lr, #21
add lr, lr, #(PLDOFFS*PLDSIZE)
cmp r12, lr, lsr #6
ble .L_neon_prime_pump
ldmfd sp!, {r0, lr}
bx lr
END(MEMCPY_BASE)
itt gt
movgt r9, #(PLDOFFS)
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. */
ENTRY(memset)
stmfd sp!, {r0}
.cfi_def_cfa_offset 4
.cfi_rel_offset r0, 0
mov r3, r0
vdup.8 q0, r1
/* 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 */
subs r2, r2, #32
vst1.8 {d0 - d3}, [r0]!
vst1.8 {d0 - d3}, [r3]!
bhs 1b
2: /* less than 32 left */
@@ -91,18 +88,17 @@ ENTRY(memset)
beq 3f
// 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) */
movs ip, r2, lsl #29
bcc 1f
vst1.8 {d0}, [r0]!
vst1.8 {d0}, [r3]!
1: bge 2f
vst1.32 {d0[0]}, [r0]!
vst1.32 {d0[0]}, [r3]!
2: movs ip, r2, lsl #31
strbmi r1, [r0], #1
strbcs r1, [r0], #1
strbcs r1, [r0], #1
ldmfd sp!, {r0}
strbmi r1, [r3], #1
strbcs r1, [r3], #1
strbcs r1, [r3], #1
bx lr
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 += \
arch-arm/krait/bionic/memcpy.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/strlen.S \
libc_bionic_src_files_arm += \
arch-arm/generic/bionic/memcmp.S \
libc_bionic_src_files_arm += \
arch-arm/denver/bionic/memmove.S \

View File

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

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(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.
#
# Default implementations of functions that are commonly optimized.
# Generic arm64 optimizations, may be overriden by CPU variants.
#
libc_bionic_src_files_arm64 += \
bionic/__memset_chk.cpp \
bionic/__strcpy_chk.cpp \
bionic/__strcat_chk.cpp \
bionic/strrchr.cpp \
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 \
libc_freebsd_src_files_arm64 += \
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 \
libc_bionic_src_files_exclude_arm64 += \
bionic/__memcpy_chk.cpp \
bionic/strchr.cpp \
bionic/strnlen.c \
libc_openbsd_src_files_arm64 += \
upstream-openbsd/lib/libc/string/memrchr.c \
upstream-openbsd/lib/libc/string/stpncpy.c \
upstream-openbsd/lib/libc/string/strcat.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/strncpy.c \
libc_freebsd_src_files_exclude_arm64 += \
upstream-freebsd/lib/libc/string/wmemmove.c \
libc_openbsd_src_files_exclude_arm64 += \
upstream-openbsd/lib/libc/string/memchr.c \
upstream-openbsd/lib/libc/string/memmove.c \
upstream-openbsd/lib/libc/string/stpcpy.c \
upstream-openbsd/lib/libc/string/strcpy.c \
upstream-openbsd/lib/libc/string/strncmp.c \
#
# Inherently architecture-specific code.
@@ -54,6 +60,7 @@ libc_crt_target_crtbegin_so_file_arm64 := \
ifeq ($(strip $(TARGET_CPU_VARIANT)),)
$(warning TARGET_ARCH is arm64, but TARGET_CPU_VARIANT is not defined)
endif
ifneq ($(TARGET_CPU_VARIANT),generic)
cpu_variant_mk := $(LOCAL_PATH)/arch-arm64/$(TARGET_CPU_VARIANT)/$(TARGET_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.")
@@ -62,3 +69,4 @@ include $(cpu_variant_mk)
libc_common_additional_dependencies += $(cpu_variant_mk)
cpu_variant_mk :=
endif

View File

@@ -52,6 +52,29 @@
#define _JB_D10_D11 (_JB_D12_D13 + 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)
mov w1, #1
b sigsetjmp
@@ -64,23 +87,47 @@ END(_setjmp)
// int sigsetjmp(sigjmp_buf env, int save_signal_mask);
ENTRY(sigsetjmp)
// Record whether or not we're saving the signal mask.
str w1, [x0, #(_JB_SIGFLAG * 8)]
stp x0, x30, [sp, #-16]!
.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?
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.
stp x0, x30, [sp, #-16]!
// The 'how' argument is ignored if new_mask is NULL.
mov x1, #0 // NULL.
add x2, x0, #(_JB_SIGMASK * 8) // old_mask.
bl sigprocmask
ldp x0, x30, [sp], #16
ldp x1, xzr, [sp], #16
.cfi_adjust_cfa_offset -16
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.
mov x10, sp
m_mangle_registers x1, sp_reg=x10
stp x30, x10, [x0, #(_JB_X30_SP * 8)]
stp x28, x29, [x0, #(_JB_X28_X29 * 8)]
stp x26, x27, [x0, #(_JB_X26_X27 * 8)]
@@ -88,6 +135,7 @@ ENTRY(sigsetjmp)
stp x22, x23, [x0, #(_JB_X22_X23 * 8)]
stp x20, x21, [x0, #(_JB_X20_X21 * 8)]
str x19, [x0, #(_JB_X19 * 8)]
m_unmangle_registers x1, sp_reg=x10
// Save floating point registers.
stp d14, d15, [x0, #(_JB_D14_D15 * 8)]
@@ -102,30 +150,60 @@ END(sigsetjmp)
// void siglongjmp(sigjmp_buf env, int value);
ENTRY(siglongjmp)
// Do we need to restore the signal mask?
ldr w9, [x0, #(_JB_SIGFLAG * 8)]
cbz w9, 1f
ldr x2, [x0, #(_JB_SIGFLAG * 8)]
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.
stp x0, x30, [sp, #-16]!
mov x19, x1 // Save 'value'.
mov x2, x0
mov x0, #2 // SIG_SETMASK
add x1, x2, #(_JB_SIGMASK * 8) // new_mask.
mov x2, #0 // NULL.
bl sigprocmask
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:
// Restore core registers.
bic x2, x2, #1
ldp x30, x10, [x0, #(_JB_X30_SP * 8)]
mov sp, x10
ldp x28, x29, [x0, #(_JB_X28_X29 * 8)]
ldp x26, x27, [x0, #(_JB_X26_X27 * 8)]
ldp x24, x25, [x0, #(_JB_X24_X25 * 8)]
ldp x22, x23, [x0, #(_JB_X22_X23 * 8)]
ldp x20, x21, [x0, #(_JB_X20_X21 * 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.
ldp d14, d15, [x0, #(_JB_D14_D15 * 8)]
@@ -133,13 +211,6 @@ ENTRY(siglongjmp)
ldp d10, d11, [x0, #(_JB_D10_D11 * 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.
cmp w1, wzr
csinc w0, w1, wzr, ne

View File

@@ -31,6 +31,11 @@
#include <linux/sched.h>
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 x1, 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 += \
arch-arm64/generic/bionic/memchr.S \
arch-arm64/generic/bionic/memcmp.S \
arch-arm64/denver64/bionic/memcpy.S \
arch-arm64/generic/bionic/memmove.S \
arch-arm64/denver64/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_bionic_src_files_exclude_arm64 += \
arch-arm64/generic/bionic/memcpy.S \
arch-arm64/generic/bionic/memset.S \

View File

@@ -35,10 +35,6 @@
#include <private/bionic_asm.h>
/* Parameters and result. */
#ifdef BCOPY
#define origdstin x1
#define origsrc x0
#endif
#define dstin x0
#define src x1
#define count x2
@@ -59,13 +55,7 @@
#define D_l x13
#define D_h x14
#ifdef BCOPY
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)
#if defined(WMEMMOVE)
ENTRY(wmemmove)
lsl count, count, #2
#else
@@ -332,9 +322,7 @@ ENTRY(memmove)
tst count, #0x3f
b.ne .Ltail63down
ret
#ifdef BCOPY
END(bcopy)
#elif defined(WMEMMOVE)
#if defined(WMEMMOVE)
END(wmemmove)
#else
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>
ENTRY(flistxattr)
ENTRY(___flistxattr)
mov x8, __NR_flistxattr
svc #0
@@ -11,4 +11,5 @@ ENTRY(flistxattr)
b.hi __set_errno_internal
ret
END(flistxattr)
END(___flistxattr)
.hidden ___flistxattr

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: */
/* dynam filler (0*4) 0-4 bytes of rounddown filler, DON'T TOUCH!!
often overlays user storage!! */
#define SC_MAGIC_OFFSET (1*4) /* 4 bytes, identify jmpbuf, first actual field */
#define SC_FLAG_OFFSET (2*4) /* 4 bytes, savesigs flag */
#define SC_FPSR_OFFSET (3*4) /* 4 bytes, floating point control/status reg */
#define SC_FPSR_OFFSET (1*4) /* 4 bytes, floating point control/status reg */
/* 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_SPARE_OFFSET (8*4) /* 8 bytes, reserved for future uses */
@@ -166,6 +165,16 @@
#error _JBLEN is too small
#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
@@ -190,36 +199,46 @@ setjmp_common:
li t0, ~7
and a0, t0 # round jmpbuf addr DOWN to 8-byte boundary
#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 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)):
LA a2, SC_MASK_OFFSET(a0) # gets current signal mask
li a0, 0 # how; ignored when new mask is null
li a1, 0 # null new mask
jal sigprocmask # get current signal mask
REG_L a0, A0OFF(sp)
REG_L ra, RAOFF(sp)
1:
li v0, 0xACEDBADE # sigcontext magic number
sw v0, SC_MAGIC_OFFSET(a0)
REG_L gp, GPOFF(sp) # restore spills
REG_L ra, RAOFF(sp)
REG_L t0, SC_FLAG_OFFSET(a0) # move cookie to temp reg
# callee-saved long-sized regs:
REG_S ra, SC_REGS+0*REGSZ(a0)
REG_S s0, SC_REGS+1*REGSZ(a0)
REG_S s1, SC_REGS+2*REGSZ(a0)
REG_S s2, SC_REGS+3*REGSZ(a0)
REG_S s3, SC_REGS+4*REGSZ(a0)
REG_S s4, SC_REGS+5*REGSZ(a0)
REG_S s5, SC_REGS+6*REGSZ(a0)
REG_S s6, SC_REGS+7*REGSZ(a0)
REG_S s7, SC_REGS+8*REGSZ(a0)
REG_S s8, SC_REGS+9*REGSZ(a0)
REG_L v0, GPOFF(sp)
REG_S v0, SC_REGS+10*REGSZ(a0) # save gp
PTR_ADDU v0, sp, FRAMESZ
REG_S v0, SC_REGS+11*REGSZ(a0) # save orig sp
PTR_ADDU v1, sp, FRAMESZ # save orig sp
# m_mangle_reg_and_store reg, cookie, temp, offset
m_mangle_reg_and_store ra, t0, t1, SC_REGS+0*REGSZ(a0)
m_mangle_reg_and_store s0, t0, t2, SC_REGS+1*REGSZ(a0)
m_mangle_reg_and_store s1, t0, t3, SC_REGS+2*REGSZ(a0)
m_mangle_reg_and_store s2, t0, t1, SC_REGS+3*REGSZ(a0)
m_mangle_reg_and_store s3, t0, t2, SC_REGS+4*REGSZ(a0)
m_mangle_reg_and_store s4, t0, t3, SC_REGS+5*REGSZ(a0)
m_mangle_reg_and_store s5, t0, t1, SC_REGS+6*REGSZ(a0)
m_mangle_reg_and_store s6, t0, t2, SC_REGS+7*REGSZ(a0)
m_mangle_reg_and_store s7, t0, t3, SC_REGS+8*REGSZ(a0)
m_mangle_reg_and_store s8, t0, t1, SC_REGS+9*REGSZ(a0)
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
@@ -288,36 +307,41 @@ NON_LEAF(siglongjmp, FRAMESZ, ra)
li t0, ~7
and a0, t0 # round jmpbuf addr DOWN to 8-byte boundary
#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?
REG_S a1, A1OFF(sp) # temp spill
REG_S a0, A0OFF(sp)
# call sigprocmask(int how SIG_SETMASK, sigset_t* SC_MASK(a0), sigset_t* null):
LA a1, SC_MASK_OFFSET(a0) # signals being restored
# call sigprocmask(int how SIG_SETMASK, sigset_t* SC_MASK(a0), sigset_t* null):
LA a1, SC_MASK_OFFSET(s0) # signals being restored
li a0, 3 # mips SIG_SETMASK
li a2, 0 # null
jal sigprocmask # restore signal mask
REG_L a0, A0OFF(sp)
REG_L a1, A1OFF(sp)
1:
move t0, s2 # get cookie to temp reg
move a1, s1
move a0, s0
# callee-saved long-sized regs:
REG_L ra, SC_REGS+0*REGSZ(a0)
REG_L s0, SC_REGS+1*REGSZ(a0)
REG_L s1, SC_REGS+2*REGSZ(a0)
REG_L s2, SC_REGS+3*REGSZ(a0)
REG_L s3, SC_REGS+4*REGSZ(a0)
REG_L s4, SC_REGS+5*REGSZ(a0)
REG_L s5, SC_REGS+6*REGSZ(a0)
REG_L s6, SC_REGS+7*REGSZ(a0)
REG_L s7, SC_REGS+8*REGSZ(a0)
REG_L s8, SC_REGS+9*REGSZ(a0)
REG_L gp, SC_REGS+10*REGSZ(a0)
REG_L sp, SC_REGS+11*REGSZ(a0)
# m_unmangle_reg_and_load reg, cookie, temp, offset
# don't restore gp yet, old value is needed for cookie_check call
m_unmangle_reg_and_load ra, t0, t1, SC_REGS+0*REGSZ(a0)
m_unmangle_reg_and_load s0, t0, t2, SC_REGS+1*REGSZ(a0)
m_unmangle_reg_and_load s1, t0, t3, SC_REGS+2*REGSZ(a0)
m_unmangle_reg_and_load s2, t0, t1, SC_REGS+3*REGSZ(a0)
m_unmangle_reg_and_load s3, t0, t2, SC_REGS+4*REGSZ(a0)
m_unmangle_reg_and_load s4, t0, t3, SC_REGS+5*REGSZ(a0)
m_unmangle_reg_and_load s5, t0, t1, SC_REGS+6*REGSZ(a0)
m_unmangle_reg_and_load s6, t0, t2, SC_REGS+7*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)
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 $f30, SC_FPREGS+5*REGSZ_FP(a0)
#endif
bne a1, zero, 1f
li a1, 1 # never return 0!
1:
move v0, a1
j ra # return to setjmp call site
longjmp_botch:
jal longjmperror
jal abort
# check cookie
PTR_SUBU sp, FRAMESZ
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)
ALIAS_SYMBOL(longjmp, siglongjmp)

View File

@@ -37,6 +37,14 @@ ENTRY(vfork)
.set noreorder
.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 a1, 0
li a2, 0

View File

@@ -1,45 +1,10 @@
# 32-bit mips.
#
# Default implementations of functions that are commonly optimized.
#
libc_bionic_src_files_mips += \
arch-mips/string/memcmp.c \
arch-mips/string/memcpy.S \
arch-mips/string/memset.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.

View File

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

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
#endif
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)
move a1, $0
move a2, $0

View File

@@ -1,46 +1,11 @@
# 64-bit mips.
#
# Default implementations of functions that are commonly optimized.
#
libc_bionic_src_files_mips64 += \
arch-mips/string/memcmp.c \
arch-mips/string/memcpy.S \
arch-mips/string/memset.S \
arch-mips/string/strcmp.S \
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.

View File

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

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 += \
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-strchr-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-memcmp-atom.S \
arch-x86/atom/string/ssse3-memcpy-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-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-wcscat-atom.S \
arch-x86/atom/string/ssse3-wcscpy-atom.S \
arch-x86/atom/string/ssse3-wmemcmp-atom.S
libc_bionic_src_files_x86 += \
arch-x86/silvermont/string/sse2-stpcpy-slm.S \
arch-x86/silvermont/string/sse2-stpncpy-slm.S
libc_bionic_src_files_exclude_x86 += \
arch-x86/generic/string/memcmp.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_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)
movl 4(%esp),%ecx
movl $1,(_JB_SIGFLAG * 4)(%ecx)
jmp .L_sigsetjmp_signal_mask
mov $1,%eax
jmp .L_sigsetjmp
END(setjmp)
ENTRY(_setjmp)
movl 4(%esp),%ecx
movl $0,(_JB_SIGFLAG * 4)(%ecx)
jmp .L_sigsetjmp_no_signal_mask
movl $0,%eax
jmp .L_sigsetjmp
END(_setjmp)
ENTRY(sigsetjmp)
movl 4(%esp),%ecx
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)
// Do we need to save the signal mask?
testl %eax,%eax
testl $1,%eax
jz 1f
.L_sigsetjmp_signal_mask:
// Get the current signal mask.
PIC_PROLOGUE
pushl $0
@@ -76,16 +95,21 @@ ENTRY(sigsetjmp)
movl 4(%esp),%ecx
movl %eax,(_JB_SIGMASK * 4)(%ecx)
.L_sigsetjmp_no_signal_mask:
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.
movl 0(%esp),%edx
m_mangle_registers %eax
movl %edx,(_JB_EDX * 4)(%ecx)
movl %ebx,(_JB_EBX * 4)(%ecx)
movl %esp,(_JB_ESP * 4)(%ecx)
movl %ebp,(_JB_EBP * 4)(%ecx)
movl %esi,(_JB_ESI * 4)(%ecx)
movl %edi,(_JB_EDI * 4)(%ecx)
m_unmangle_registers %eax
xorl %eax,%eax
ret
@@ -94,7 +118,8 @@ END(sigsetjmp)
ENTRY(siglongjmp)
// Do we have a signal mask to restore?
movl 4(%esp),%edx
cmpl $0,(_JB_SIGFLAG * 4)(%edx)
movl (_JB_SIGFLAG * 4)(%edx), %eax
testl $1,%eax
jz 1f
// Restore the signal mask.
@@ -108,12 +133,31 @@ ENTRY(siglongjmp)
// Restore the callee-save registers.
movl 4(%esp),%edx
movl 8(%esp),%eax
movl (_JB_EDX * 4)(%edx),%ecx
movl (_JB_EBX * 4)(%edx),%ebx
movl (_JB_ESP * 4)(%edx),%esp
movl (_JB_EBP * 4)(%edx),%ebp
movl (_JB_ESI * 4)(%edx),%esi
movl (_JB_EDI * 4)(%edx),%edi
movl (_JB_SIGFLAG * 4)(%edx),%ecx
andl $-2,%ecx
movl %ecx,%ebx
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
jnz 2f

View File

@@ -34,6 +34,12 @@ ENTRY(vfork)
popl %ecx // Grab the return address.
.cfi_adjust_cfa_offset 4
.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
int $0x80
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>
ENTRY(flistxattr)
ENTRY(___flistxattr)
pushl %ebx
.cfi_def_cfa_offset 8
.cfi_rel_offset ebx, 0
@@ -28,4 +28,5 @@ ENTRY(flistxattr)
popl %ecx
popl %ebx
ret
END(flistxattr)
END(___flistxattr)
.hidden ___flistxattr

View File

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

View File

@@ -2,7 +2,7 @@
#include <private/bionic_asm.h>
ENTRY(gettimeofday)
ENTRY(__gettimeofday)
pushl %ebx
.cfi_def_cfa_offset 8
.cfi_rel_offset ebx, 0
@@ -23,4 +23,4 @@ ENTRY(gettimeofday)
popl %ecx
popl %ebx
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.
#
# Default implementations of functions that are commonly optimized.
# Generic x86 optimizations, may be overriden by CPU variants.
#
libc_common_src_files_x86 += \
bionic/__memcpy_chk.cpp \
bionic/__memset_chk.cpp \
bionic/__strcpy_chk.cpp \
bionic/__strcat_chk.cpp \
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
libc_freebsd_src_files_x86 += \
upstream-freebsd/lib/libc/string/wmemmove.c \
libc_bionic_src_files_x86 += \
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.
@@ -30,12 +116,14 @@ libc_bionic_src_files_x86 += \
## ARCH variant specific source files
arch_variant_mk := $(LOCAL_PATH)/arch-x86/$(TARGET_ARCH_VARIANT)/$(TARGET_ARCH_VARIANT).mk
ifeq ($(wildcard $(arch_variant_mk)),)
arch_variant_mk := $(LOCAL_PATH)/arch-x86/generic/generic.mk
arch_variant_mk :=
endif
ifneq ($(arch_variant_mk),)
include $(arch_variant_mk)
libc_common_additional_dependencies += $(arch_variant_mk)
arch_variant_mk :=
endif
libc_crt_target_cflags_x86 := \
-m32 \

View File

@@ -50,6 +50,25 @@
#define _JB_SIGMASK 9
#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)
movl $1,%esi
jmp PIC_PLT(sigsetjmp)
@@ -62,11 +81,17 @@ END(_setjmp)
// int sigsetjmp(sigjmp_buf env, int save_signal_mask);
ENTRY(sigsetjmp)
// Record whether or not we're saving the signal mask.
movl %esi,(_JB_SIGFLAG * 8)(%rdi)
pushq %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?
testl %esi,%esi
testq $1,%rax
jz 2f
// Save current signal mask.
@@ -79,7 +104,10 @@ ENTRY(sigsetjmp)
2:
// Save the callee-save registers.
popq %rax
andq $-2,%rax
movq (%rsp),%r11
m_mangle_registers %rax
movq %rbx,(_JB_RBX * 8)(%rdi)
movq %rbp,(_JB_RBP * 8)(%rdi)
movq %r12,(_JB_R12 * 8)(%rdi)
@@ -88,6 +116,7 @@ ENTRY(sigsetjmp)
movq %r15,(_JB_R15 * 8)(%rdi)
movq %rsp,(_JB_RSP * 8)(%rdi)
movq %r11,(_JB_PC * 8)(%rdi)
m_unmangle_registers %rax
xorl %eax,%eax
ret
@@ -99,7 +128,9 @@ ENTRY(siglongjmp)
pushq %rsi // Push 'value'.
// 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
// Restore the signal mask.
@@ -109,6 +140,10 @@ ENTRY(siglongjmp)
call PIC_PLT(sigprocmask)
2:
// Fetch the setjmp cookie and clear the signal flag bit.
popq %rcx
andq $-2, %rcx
popq %rax // Pop 'value'.
// Restore the callee-save registers.
@@ -120,7 +155,17 @@ ENTRY(siglongjmp)
movq (_JB_RSP * 8)(%r12),%rsp
movq (_JB_PC * 8)(%r12),%r11
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
jnz 1f
incl %eax

View File

@@ -32,6 +32,12 @@
ENTRY(vfork)
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
syscall
pushq %rdi // Restore the return address.

View File

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

View File

@@ -2,7 +2,7 @@
#include <private/bionic_asm.h>
ENTRY(flistxattr)
ENTRY(___flistxattr)
movl $__NR_flistxattr, %eax
syscall
cmpq $-MAX_ERRNO, %rax
@@ -12,4 +12,5 @@ ENTRY(flistxattr)
call __set_errno_internal
1:
ret
END(flistxattr)
END(___flistxattr)
.hidden ___flistxattr

View File

@@ -0,0 +1,18 @@
/* Generated by gensyscalls.py. Do not edit. */
#include <private/bionic_asm.h>
ENTRY(preadv)
movq %rcx, %r10
movl $__NR_preadv, %eax
syscall
cmpq $-MAX_ERRNO, %rax
jb 1f
negl %eax
movl %eax, %edi
call __set_errno_internal
1:
ret
END(preadv)
ALIAS_SYMBOL(preadv64, preadv)

View File

@@ -0,0 +1,18 @@
/* Generated by gensyscalls.py. Do not edit. */
#include <private/bionic_asm.h>
ENTRY(pwritev)
movq %rcx, %r10
movl $__NR_pwritev, %eax
syscall
cmpq $-MAX_ERRNO, %rax
jb 1f
negl %eax
movl %eax, %edi
call __set_errno_internal
1:
ret
END(pwritev)
ALIAS_SYMBOL(pwritev64, pwritev)

View File

@@ -1,31 +1,20 @@
# 64-bit x86.
#
# Default implementations of functions that are commonly optimized.
# Remove default implementations that we have optimized versions of.
#
libc_bionic_src_files_x86_64 += \
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_x86_64 += \
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_x86_64 += \
upstream-openbsd/lib/libc/string/memchr.c \
upstream-openbsd/lib/libc/string/memrchr.c \
libc_openbsd_src_files_exclude_x86_64 += \
upstream-openbsd/lib/libc/string/memmove.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.

View File

@@ -0,0 +1,47 @@
/*
* 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.
*/
#undef _FORTIFY_SOURCE
#include <stdio.h>
#include <sys/cdefs.h>
#include "private/libc_logging.h"
extern "C" size_t __fread_chk(void * __restrict buf, size_t size, size_t count,
FILE * __restrict stream, size_t buf_size) {
size_t total;
if (__predict_false(__size_mul_overflow(size, count, &total))) {
// overflow: trigger the error path in fread
return fread(buf, size, count, stream);
}
if (__predict_false(total > buf_size)) {
__fortify_chk_fail("fread: prevented write past end of buffer", 0);
}
return fread(buf, size, count, stream);
}

View File

@@ -0,0 +1,47 @@
/*
* 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.
*/
#undef _FORTIFY_SOURCE
#include <stdio.h>
#include <sys/cdefs.h>
#include "private/libc_logging.h"
extern "C" size_t __fwrite_chk(const void * __restrict buf, size_t size, size_t count,
FILE * __restrict stream, size_t buf_size) {
size_t total;
if (__predict_false(__size_mul_overflow(size, count, &total))) {
// overflow: trigger the error path in fwrite
return fwrite(buf, size, count, stream);
}
if (__predict_false(total > buf_size)) {
__fortify_chk_fail("fwrite: prevented read past end of buffer", 0);
}
return fwrite(buf, size, count, stream);
}

View File

@@ -0,0 +1,40 @@
/*
* 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.
*/
#undef _FORTIFY_SOURCE
#include <unistd.h>
#include "private/libc_logging.h"
extern char* __getcwd_chk(char* buf, size_t len, size_t buflen) {
if (__predict_false(len > buflen)) {
__fortify_chk_fail("getcwd: prevented write past end of buffer", 0);
}
return getcwd(buf, len);
}

View File

@@ -0,0 +1,44 @@
/*
* 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.
*/
#undef _FORTIFY_SOURCE
#include <unistd.h>
#include "private/libc_logging.h"
extern "C" ssize_t __pwrite64_chk(int fd, const void* buf, size_t count, off64_t offset,
size_t buf_size) {
if (__predict_false(count > buf_size)) {
__fortify_chk_fail("pwrite64: prevented read past end of buffer", 0);
}
if (__predict_false(count > SSIZE_MAX)) {
__fortify_chk_fail("pwrite64: count > SSIZE_MAX", 0);
}
return pwrite64(fd, buf, count, offset);
}

View File

@@ -0,0 +1,44 @@
/*
* 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.
*/
#undef _FORTIFY_SOURCE
#include <unistd.h>
#include "private/libc_logging.h"
extern "C" ssize_t __pwrite_chk(int fd, const void* buf, size_t count, off_t offset,
size_t buf_size) {
if (__predict_false(count > buf_size)) {
__fortify_chk_fail("pwrite: prevented read past end of buffer", 0);
}
if (__predict_false(count > SSIZE_MAX)) {
__fortify_chk_fail("pwrite: count > SSIZE_MAX", 0);
}
return pwrite(fd, buf, count, offset);
}

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