OSDN Git Service

android-x86/bionic.git
9 years agoMake all labels local.
Christopher Ferris [Thu, 23 Jul 2015 19:12:55 +0000 (12:12 -0700)]
Make all labels local.

Change the non-local labels to .L labels.

Change-Id: I720e894f2e311af8f4a0970303d8b86575fb69a5

9 years agoMerge "Don't abort when failed to write tracing message."
Yabin Cui [Thu, 23 Jul 2015 17:20:30 +0000 (17:20 +0000)]
Merge "Don't abort when failed to write tracing message."

9 years agoDon't abort when failed to write tracing message.
Yabin Cui [Wed, 22 Jul 2015 00:27:54 +0000 (17:27 -0700)]
Don't abort when failed to write tracing message.

Also make the code thread-safe with lock.

Bug: 20666100
Change-Id: I0f331a617b75280f36179c187418450230d713ef

9 years agoMerge "Add getgrgid_r/getgrnam_r."
Yabin Cui [Wed, 22 Jul 2015 03:22:26 +0000 (03:22 +0000)]
Merge "Add getgrgid_r/getgrnam_r."

9 years agoAdd getgrgid_r/getgrnam_r.
Yabin Cui [Tue, 21 Jul 2015 02:46:26 +0000 (19:46 -0700)]
Add getgrgid_r/getgrnam_r.

Bug: 22568551
Change-Id: I3c0772d119d6041063c6be53f5bcc5ea1768f0d5

9 years agoMerge "libc: arch-x86: implement kernel vdso time functions"
Elliott Hughes [Wed, 22 Jul 2015 01:51:00 +0000 (01:51 +0000)]
Merge "libc: arch-x86: implement kernel vdso time functions"

9 years agolibc: arch-x86: implement kernel vdso time functions
Robert Jarzmik [Wed, 15 Jul 2015 13:26:43 +0000 (15:26 +0200)]
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>
9 years agoMerge "We don't have CXX_BARE any more"
Ying Wang [Tue, 21 Jul 2015 21:10:22 +0000 (21:10 +0000)]
Merge "We don't have CXX_BARE any more"

9 years agoWe don't have CXX_BARE any more
Ying Wang [Tue, 21 Jul 2015 01:51:30 +0000 (18:51 -0700)]
We don't have CXX_BARE any more

Now we have split CXX_WRAPPER from TARGET_CXX and CXX_BARE isn't needed
any more.

Bug: 22612634
Change-Id: I52c78b0d1b325910e875a786d17f780731778b4b
(cherry-pick from commit 9d11a7087c860195bf23f2825a7fe70d43ff7b78)

9 years agoMerge "Use a less misleading name for the code that sets up the main thread."
Elliott Hughes [Tue, 21 Jul 2015 20:28:15 +0000 (20:28 +0000)]
Merge "Use a less misleading name for the code that sets up the main thread."

9 years agoUse a less misleading name for the code that sets up the main thread.
Elliott Hughes [Tue, 21 Jul 2015 18:57:09 +0000 (11:57 -0700)]
Use a less misleading name for the code that sets up the main thread.

Change-Id: I50c1b0a3b633cf8bc40a6bd86f12adb6b91e2888

9 years agoMerge "Add support for non-zero vaddr in maps."
Christopher Ferris [Tue, 21 Jul 2015 17:29:09 +0000 (17:29 +0000)]
Merge "Add support for non-zero vaddr in maps."

9 years agoMerge "Revert "Revert "make vdso function pointers read-only at runtime"""
Elliott Hughes [Tue, 21 Jul 2015 02:15:19 +0000 (02:15 +0000)]
Merge "Revert "Revert "make vdso function pointers read-only at runtime"""

9 years agoMerge "Revert "Stop libc from cross-referencing unwind symbols""
Dan Albert [Tue, 21 Jul 2015 00:22:20 +0000 (00:22 +0000)]
Merge "Revert "Stop libc from cross-referencing unwind symbols""

9 years agoRevert "Stop libc from cross-referencing unwind symbols"
Dan Albert [Mon, 20 Jul 2015 23:56:51 +0000 (16:56 -0700)]
Revert "Stop libc from cross-referencing unwind symbols"

This reverts commit cd13b14e98d4921af126667fae0cf6613a5615c5.

Bug: http://b/19958712
Change-Id: I7cc7f69728c42c37e129aee30d761c4cd7e30e94

9 years agoRevert "Revert "make vdso function pointers read-only at runtime""
Elliott Hughes [Mon, 20 Jul 2015 22:34:27 +0000 (22:34 +0000)]
Revert "Revert "make vdso function pointers read-only at runtime""

This reverts commit 1946856b1f18a27c51ba30bb9e304f25b722ee05.

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

Bug: http://b/22568628
Change-Id: I3e7241c8b54c27ea4a898bc952375c1e9ae38c80

9 years agoMerge "Fix dt_runpath test."
Dmitriy Ivanov [Mon, 20 Jul 2015 18:31:07 +0000 (18:31 +0000)]
Merge "Fix dt_runpath test."

9 years agoFix dt_runpath test.
Dmitriy Ivanov [Mon, 20 Jul 2015 17:47:49 +0000 (10:47 -0700)]
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

9 years agoMerge "<sys/time.h> should include [most of] <sys/select.h>."
Elliott Hughes [Mon, 20 Jul 2015 17:36:52 +0000 (17:36 +0000)]
Merge "<sys/time.h> should include [most of] <sys/select.h>."

9 years agoMerge "Revert "make vdso function pointers read-only at runtime""
Elliott Hughes [Mon, 20 Jul 2015 17:30:49 +0000 (17:30 +0000)]
Merge "Revert "make vdso function pointers read-only at runtime""

9 years agoRevert "make vdso function pointers read-only at runtime"
Elliott Hughes [Mon, 20 Jul 2015 17:30:33 +0000 (17:30 +0000)]
Revert "make vdso function pointers read-only at runtime"

This reverts commit df1a3c6d21702e3e96cfcddadee4a50bfac82110.

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

Change-Id: I071d6d6a0ae7881d65641839e665acdcf58462b4

9 years ago<sys/time.h> should include [most of] <sys/select.h>.
Elliott Hughes [Sat, 18 Jul 2015 02:10:24 +0000 (19:10 -0700)]
<sys/time.h> should include [most of] <sys/select.h>.

Found by trying to build c-ares with bionic.

Change-Id: I38684abcb806ef1e8806c68b4a6dd9200f48849e

9 years agoMerge "Add all the glibc one-line "synonym" header files."
Elliott Hughes [Fri, 17 Jul 2015 21:42:03 +0000 (21:42 +0000)]
Merge "Add all the glibc one-line "synonym" header files."

9 years agoAdd all the glibc one-line "synonym" header files.
Elliott Hughes [Fri, 17 Jul 2015 20:59:36 +0000 (13:59 -0700)]
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

9 years agoMerge "make vdso function pointers read-only at runtime"
Elliott Hughes [Fri, 17 Jul 2015 18:13:31 +0000 (18:13 +0000)]
Merge "make vdso function pointers read-only at runtime"

9 years agomake vdso function pointers read-only at runtime
Daniel Micay [Fri, 17 Jul 2015 16:13:27 +0000 (12:13 -0400)]
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

9 years agoMerge "Fix potential race condition on dlopen"
Dmitriy Ivanov [Fri, 17 Jul 2015 17:49:20 +0000 (17:49 +0000)]
Merge "Fix potential race condition on dlopen"

9 years agoFix potential race condition on dlopen
Dmitriy Ivanov [Fri, 17 Jul 2015 17:36:10 +0000 (10:36 -0700)]
Fix potential race condition on dlopen

  Call to find_containing_library should be guarded.

Change-Id: I985a903da48b83bcd35e957a979158eb9b80e70b

9 years agoAdd support for non-zero vaddr in maps.
Christopher Ferris [Thu, 16 Jul 2015 21:49:17 +0000 (14:49 -0700)]
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

9 years agoMerge "Add timespec/timeval conversion helpers."
Bertrand SIMONNET [Thu, 16 Jul 2015 21:53:25 +0000 (21:53 +0000)]
Merge "Add timespec/timeval conversion helpers."

9 years agoAdd timespec/timeval conversion helpers.
Bertrand SIMONNET [Thu, 16 Jul 2015 18:50:39 +0000 (11:50 -0700)]
Add timespec/timeval conversion helpers.

TIMESPEC_TO_TIMEVAL and TIMEVAL_TO_TIMESPEC are usually provided by
sys/time.h.

BUG: 22532790

Change-Id: I8b9d7298e3250323faa20b1adf9a7514954c6096

9 years agoMerge "Add constant for zip separator"
Dmitriy Ivanov [Thu, 16 Jul 2015 15:59:15 +0000 (15:59 +0000)]
Merge "Add constant for zip separator"

9 years agoAdd constant for zip separator
Dmitriy Ivanov [Thu, 16 Jul 2015 11:52:06 +0000 (04:52 -0700)]
Add constant for zip separator

Change-Id: I1dcbb15ac612fc28e922eb3de8148fcaebbc0820

9 years agoMerge "Replace spaces with tabs in a Makefile."
Evgenii Stepanov [Wed, 15 Jul 2015 23:22:38 +0000 (23:22 +0000)]
Merge "Replace spaces with tabs in a Makefile."

9 years agoReplace spaces with tabs in a Makefile.
Evgenii Stepanov [Wed, 15 Jul 2015 23:19:59 +0000 (16:19 -0700)]
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

9 years agoMerge "A special linker for ASan executables."
Evgenii Stepanov [Wed, 15 Jul 2015 17:24:19 +0000 (17:24 +0000)]
Merge "A special linker for ASan executables."

9 years agoA special linker for ASan executables.
Evgenii Stepanov [Sat, 11 Jul 2015 00:54:01 +0000 (17:54 -0700)]
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

9 years agoMerge "Add test for an Android kernel bug about prctl."
Yabin Cui [Tue, 14 Jul 2015 02:48:44 +0000 (02:48 +0000)]
Merge "Add test for an Android kernel bug about prctl."

9 years agoAdd test for an Android kernel bug about prctl.
Yabin Cui [Mon, 13 Jul 2015 23:54:29 +0000 (16:54 -0700)]
Add test for an Android kernel bug about prctl.

Bug: 20017123

Change-Id: I8c109a06999a8bffcc8e8298b04ee637bb67d878

9 years agoMerge "Update to v3.18.18 kernel headers."
Christopher Ferris [Tue, 14 Jul 2015 01:29:46 +0000 (01:29 +0000)]
Merge "Update to v3.18.18 kernel headers."

9 years agoUpdate to v3.18.18 kernel headers.
Christopher Ferris [Tue, 14 Jul 2015 00:21:18 +0000 (17:21 -0700)]
Update to v3.18.18 kernel headers.

Change-Id: I0a0f423bda89500ad8e13a80582f05ec8bc756ea

9 years agoMerge "Do not hold hash table lock while backtracing."
Christopher Ferris [Mon, 13 Jul 2015 20:27:37 +0000 (20:27 +0000)]
Merge "Do not hold hash table lock while backtracing."

9 years agoDo not hold hash table lock while backtracing.
Christopher Ferris [Sun, 12 Jul 2015 05:47:06 +0000 (22:47 -0700)]
Do not hold hash table lock while backtracing.

There is a deadlock if holding the hash table lock while trying to do
a backtrace. Change the code so that the hash table lock is only held
while actually modifying either g_hash_table, or while modifying an
entry from g_hash_table.

Bug: 22423683
(cherry picked from commit 9fee99b06013787054a312449b94115038e2ad7c)

Change-Id: I72173bfe6f824ceaceea625c24e7851b87467135

9 years agoMerge "Prevent user-defined basename_r from breaking basename(3)."
Elliott Hughes [Sat, 11 Jul 2015 07:03:53 +0000 (07:03 +0000)]
Merge "Prevent user-defined basename_r from breaking basename(3)."

9 years agoPrevent user-defined basename_r from breaking basename(3).
Elliott Hughes [Sat, 11 Jul 2015 06:58:59 +0000 (23:58 -0700)]
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

9 years agoMerge "Fix memory-leak on soinfo_free()"
Dmitriy Ivanov [Thu, 9 Jul 2015 23:32:18 +0000 (23:32 +0000)]
Merge "Fix memory-leak on soinfo_free()"

9 years agoMerge "Use delete[] to de-allocate pointers from new[]"
Pirama Arumuga Nainar [Thu, 9 Jul 2015 22:40:50 +0000 (22:40 +0000)]
Merge "Use delete[] to de-allocate pointers from new[]"

9 years agoUse delete[] to de-allocate pointers from new[]
Pirama Arumuga Nainar [Thu, 9 Jul 2015 17:15:15 +0000 (10:15 -0700)]
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

9 years agoFix memory-leak on soinfo_free()
Dmitriy Ivanov [Wed, 8 Jul 2015 22:26:46 +0000 (15:26 -0700)]
Fix memory-leak on soinfo_free()

Bug: http://b/22290728
Change-Id: I00747056db2cd3ff8b33936278464daed7236536

9 years agoMerge "libc: Add sys/fcntl.h for compatibility."
Daniel Erat [Wed, 8 Jul 2015 21:15:22 +0000 (21:15 +0000)]
Merge "libc: Add sys/fcntl.h for compatibility."

9 years agolibc: Add sys/fcntl.h for compatibility.
Daniel Erat [Wed, 8 Jul 2015 21:01:50 +0000 (15:01 -0600)]
libc: Add sys/fcntl.h for compatibility.

Add a /usr/include/sys/fcntl.h file that includes <fcntl.h>.

Change-Id: Ie34bf7519607c5aae1fbea7c7dca249c9b7801cc

9 years agoMerge "Respect caller DT_RUNPATH in dlopen()."
Evgenii Stepanov [Wed, 8 Jul 2015 19:50:02 +0000 (19:50 +0000)]
Merge "Respect caller DT_RUNPATH in dlopen()."

9 years agoMerge "Replace bx lr with update of pc from the stack."
Christopher Ferris [Wed, 8 Jul 2015 19:15:37 +0000 (19:15 +0000)]
Merge "Replace bx lr with update of pc from the stack."

9 years agoReplace bx lr with update of pc from the stack.
Christopher Ferris [Mon, 6 Jul 2015 19:03:40 +0000 (12:03 -0700)]
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

9 years agoRespect caller DT_RUNPATH in dlopen().
Evgenii Stepanov [Tue, 7 Jul 2015 00:56:31 +0000 (17:56 -0700)]
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

9 years agoMerge "Add some glibc-like #defines for libchrome."
Elliott Hughes [Tue, 7 Jul 2015 16:56:52 +0000 (16:56 +0000)]
Merge "Add some glibc-like #defines for libchrome."

9 years agoAdd some glibc-like #defines for libchrome.
Elliott Hughes [Tue, 7 Jul 2015 16:22:32 +0000 (09:22 -0700)]
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

9 years agoMerge "Fix alignment after variable-length data."
Elliott Hughes [Mon, 6 Jul 2015 21:44:31 +0000 (21:44 +0000)]
Merge "Fix alignment after variable-length data."

9 years agoFix alignment after variable-length data.
Elliott Hughes [Mon, 6 Jul 2015 21:16:12 +0000 (14:16 -0700)]
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

9 years agoMerge "Name the thread stack and signal stack guard pages."
Elliott Hughes [Mon, 6 Jul 2015 19:59:42 +0000 (19:59 +0000)]
Merge "Name the thread stack and signal stack guard pages."

9 years agoName the thread stack and signal stack guard pages.
Elliott Hughes [Thu, 2 Jul 2015 06:48:39 +0000 (23:48 -0700)]
Name the thread stack and signal stack guard pages.

Bug: http://b/22228722
Change-Id: I1dae672e386e404fb304a34496a29fe21134c784

9 years agoMerge "Fixed uchar.h for clang3.6"
Elliott Hughes [Wed, 1 Jul 2015 15:32:57 +0000 (15:32 +0000)]
Merge "Fixed uchar.h for clang3.6"

9 years agoMerge "Update timezone data to 2015e"
Neil Fuller [Wed, 1 Jul 2015 09:42:18 +0000 (09:42 +0000)]
Merge "Update timezone data to 2015e"

9 years agoMerge "Improve personality initialization"
Dmitriy Ivanov [Wed, 1 Jul 2015 02:12:52 +0000 (02:12 +0000)]
Merge "Improve personality initialization"

9 years agoImprove personality initialization
Dmitriy Ivanov [Tue, 30 Jun 2015 22:10:51 +0000 (15:10 -0700)]
Improve personality initialization

1. Personality parameter should be unsigned int (not long)
2. Do not reset bits outside of PER_MASK when setting
   personality value.
3. Set personality for static executables.

Bug: http://b/21900686
Change-Id: I4c7e34079cbd59b818ce221eed325c05b9bb2303
(cherry picked from commit f643eb38c36eb63f612e20dea09fd43ac6a6b360)

9 years agoUpdate timezone data to 2015e
Neil Fuller [Tue, 30 Jun 2015 13:48:06 +0000 (14:48 +0100)]
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

9 years agoMerge "Pass around struct android_net_context for better behaviour"
Erik Kline [Tue, 30 Jun 2015 02:21:00 +0000 (02:21 +0000)]
Merge "Pass around struct android_net_context for better behaviour"

9 years agoMerge "Lock on dl_interate_phdr"
Dmitriy Ivanov [Mon, 29 Jun 2015 22:15:07 +0000 (22:15 +0000)]
Merge "Lock on dl_interate_phdr"

9 years agoLock on dl_interate_phdr
Dmitriy Ivanov [Mon, 29 Jun 2015 21:48:25 +0000 (14:48 -0700)]
Lock on dl_interate_phdr

There is possibility of someone dlclosing a library
while dl_iterate_phdr in progress which can lead to
dl_iterate_phdr calling callback with invalid address
if it was unmapped by dlclose.

Bug: http://b/22047255
Change-Id: I3fc0d9fd2c51fb36fd34cb035f37271fa893a7be
(cherry picked from commit f7d5bf334dc4bc5b7399d4c8268e1b0bf676548f)

9 years agoMerge "Replace NULL with nullptr"
Dmitriy Ivanov [Mon, 29 Jun 2015 21:08:48 +0000 (21:08 +0000)]
Merge "Replace NULL with nullptr"

9 years agoMerge "Add <sysexits.h>."
Elliott Hughes [Mon, 29 Jun 2015 21:01:05 +0000 (21:01 +0000)]
Merge "Add <sysexits.h>."

9 years agoAdd <sysexits.h>.
Elliott Hughes [Mon, 29 Jun 2015 20:44:34 +0000 (13:44 -0700)]
Add <sysexits.h>.

Taken from current upstream OpenBSD.

Bug: http://b/22172963
Change-Id: Ic899e08541335777296fa8ec99e518f35a100144

9 years agoMerge "Rename ZipEntryName to ZipString"
Yusuke Sato [Mon, 29 Jun 2015 17:49:28 +0000 (17:49 +0000)]
Merge "Rename ZipEntryName to ZipString"

9 years agoFixed uchar.h for clang3.6
egor.kochetov [Thu, 25 Jun 2015 13:52:36 +0000 (16:52 +0300)]
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>
9 years agoPass around struct android_net_context for better behaviour
Erik Kline [Thu, 25 Jun 2015 05:27:34 +0000 (14:27 +0900)]
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

9 years agoMerge "Fix crash when trying to load invalid ELF file."
Dmitriy Ivanov [Fri, 26 Jun 2015 03:51:21 +0000 (03:51 +0000)]
Merge "Fix crash when trying to load invalid ELF file."

9 years agoFix crash when trying to load invalid ELF file.
Dmitriy Ivanov [Thu, 25 Jun 2015 22:51:41 +0000 (15:51 -0700)]
Fix crash when trying to load invalid ELF file.

Bug: http://b/22047255
Bug: http://b/22091640
Change-Id: I6c51cff43287a6ac4b25fa9ce6a6fc3d232fd047
(cherry picked from commit 06700b2b5e92a365505b15d0d05e2d5b0706c511)

9 years agoRename ZipEntryName to ZipString
Yusuke Sato [Thu, 25 Jun 2015 21:56:07 +0000 (14:56 -0700)]
Rename ZipEntryName to ZipString

This is for https://android-review.googlesource.com/#/c/156771/.

Bug: 21957428
Change-Id: Ida30c28c0fff0b2dadddbdb1aa1999ae3250610b

9 years agoMerge "Fix x86 gdbserver build."
Elliott Hughes [Thu, 25 Jun 2015 14:30:21 +0000 (14:30 +0000)]
Merge "Fix x86 gdbserver build."

9 years agoMerge "[MIPS] Support FR=0 emulation on FR=1 64-bit FP registers"
Dimitry Ivanov [Thu, 25 Jun 2015 01:02:18 +0000 (01:02 +0000)]
Merge "[MIPS] Support FR=0 emulation on FR=1 64-bit FP registers"

9 years agoFix x86 gdbserver build.
Elliott Hughes [Thu, 25 Jun 2015 00:31:24 +0000 (17:31 -0700)]
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

9 years ago[MIPS] Support FR=0 emulation on FR=1 64-bit FP registers
Duane Sand [Mon, 1 Jun 2015 23:29:14 +0000 (16:29 -0700)]
[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

9 years agoMerge "Revert "[MIPS] Support FR=0 emulation on FR=1 64-bit FP registers""
Dimitry Ivanov [Wed, 24 Jun 2015 20:44:36 +0000 (20:44 +0000)]
Merge "Revert "[MIPS] Support FR=0 emulation on FR=1 64-bit FP registers""

9 years agoRevert "[MIPS] Support FR=0 emulation on FR=1 64-bit FP registers"
Dimitry Ivanov [Wed, 24 Jun 2015 20:43:33 +0000 (20:43 +0000)]
Revert "[MIPS] Support FR=0 emulation on FR=1 64-bit FP registers"

This reverts commit d02ec08427b006e80191ce60690ce48a788fb832.

Bug: http://b/22045439
Change-Id: Iaf10ff1e2948083cce0098f29d5b87b32bfae1b7

9 years agoMerge "Use gcc to build and test x86_64 long double code."
Chih-Hung Hsieh [Wed, 24 Jun 2015 00:15:50 +0000 (00:15 +0000)]
Merge "Use gcc to build and test x86_64 long double code."

9 years agoUse gcc to build and test x86_64 long double code.
Chih-Hung Hsieh [Tue, 23 Jun 2015 21:18:14 +0000 (14:18 -0700)]
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

9 years agoMerge "Work around compiler optimization"
Dmitriy Ivanov [Tue, 23 Jun 2015 21:51:35 +0000 (21:51 +0000)]
Merge "Work around compiler optimization"

9 years agoReplace NULL with nullptr
Dmitriy Ivanov [Tue, 23 Jun 2015 20:58:22 +0000 (13:58 -0700)]
Replace NULL with nullptr

Change-Id: If66d0c5ae1ea1ed371b44e067d4ae59ac54a8842

9 years agoWork around compiler optimization
Dmitriy Ivanov [Tue, 23 Jun 2015 20:44:18 +0000 (13:44 -0700)]
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

9 years agoMerge "Remove text-relocs support for apps targeting M+"
Dmitriy Ivanov [Mon, 22 Jun 2015 19:27:34 +0000 (19:27 +0000)]
Merge "Remove text-relocs support for apps targeting M+"

9 years agoRemove text-relocs support for apps targeting M+
Dmitriy Ivanov [Fri, 12 Jun 2015 22:00:31 +0000 (15:00 -0700)]
Remove text-relocs support for apps targeting M+

Remove support of text-relocations for apps targeting sdk version > 22

Bug: http://b/20013628
Change-Id: I2127739544480c747315e32df15dfbd1b79de4f5
(cherry picked from commit 3e6f7807541bab8157f9c26e55829fd193683349)

9 years agoMerge "Remove libdl* tests from bionic-unit-tests-static"
Dmitriy Ivanov [Mon, 22 Jun 2015 19:24:15 +0000 (19:24 +0000)]
Merge "Remove libdl* tests from bionic-unit-tests-static"

9 years agoRemove libdl* tests from bionic-unit-tests-static
Dmitriy Ivanov [Mon, 22 Jun 2015 18:54:58 +0000 (11:54 -0700)]
Remove libdl* tests from bionic-unit-tests-static

Bug: http://b/21900592
Change-Id: I907cc15684b121ec2fbdeca49fc584bb6d2eaacc

9 years agoMerge "[MIPS] Support FR=0 emulation on FR=1 64-bit FP registers"
Dimitry Ivanov [Sun, 21 Jun 2015 21:25:53 +0000 (21:25 +0000)]
Merge "[MIPS] Support FR=0 emulation on FR=1 64-bit FP registers"

9 years ago[MIPS] Support FR=0 emulation on FR=1 64-bit FP registers
Duane Sand [Mon, 1 Jun 2015 23:29:14 +0000 (16:29 -0700)]
[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

9 years agoMerge "Don't use TIMER_ABSTIME in time_test."
Yabin Cui [Fri, 19 Jun 2015 17:56:51 +0000 (17:56 +0000)]
Merge "Don't use TIMER_ABSTIME in time_test."

9 years agoDon't use TIMER_ABSTIME in time_test.
Yabin Cui [Fri, 19 Jun 2015 00:01:11 +0000 (17:01 -0700)]
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

9 years agoMerge "Improve library lookup logic"
Dmitriy Ivanov [Thu, 18 Jun 2015 00:30:47 +0000 (00:30 +0000)]
Merge "Improve library lookup logic"

9 years agoImprove library lookup logic
Dmitriy Ivanov [Tue, 16 Jun 2015 22:38:21 +0000 (15:38 -0700)]
Improve library lookup logic

Linker tries to open a library even if it can
be found by soname. This only happens if the
library was previously opened under different
target sdk version.

Bug: http://b/21876587
Bug: http://b/21153477
Bug: http://b/21171302
Bug: https://code.google.com/p/android/issues/detail?id=160921
Change-Id: I7dbbcc3b49933bffd89ca0af55371e1a1f2bf4c2
(cherry picked from commit 28154f5c56dc4a64270cae2374b47a168d1bd7fa)

9 years agoMerge "[MIPS] Add optimized string functions"
Christopher Ferris [Wed, 17 Jun 2015 23:50:55 +0000 (23:50 +0000)]
Merge "[MIPS] Add optimized string functions"