Commit Graph

12947 Commits

Author SHA1 Message Date
Yabin Cui
d2cf59d463 Merge "Hide content of pthread_rwlock_t in pthread_rwlock_internal_t." 2015-03-14 02:38:32 +00:00
Yabin Cui
2fabea47ac Hide content of pthread_rwlock_t in pthread_rwlock_internal_t.
Bug: 19249079
Change-Id: Ifbe634c716b6793bef897ec5134b55eb44c6b8d5
2015-03-13 19:35:05 -07:00
Christopher Ferris
81c31bdd43 Merge "Add some GNU specific elf constants." 2015-03-13 21:12:07 +00:00
Dmitriy Ivanov
d7e091efc4 Merge "Switch libc and libm to sysv-only hash style" 2015-03-13 21:04:08 +00:00
Dmitriy Ivanov
2e16d2cf1e Switch libc and libm to sysv-only hash style
Bug: 19059885
Change-Id: I60a23dc5f9c756994d566818332ca42b305b4a05
2015-03-13 19:48:03 +00:00
Christopher Ferris
c94c7ff2bb Add some GNU specific elf constants.
Change-Id: I6c668463a27a641c9a280ce1937857d622344ff8
2015-03-13 10:32:45 -07:00
Christopher Ferris
f074b531d2 Merge "Add the optimized implementation of 18 math functions for x86 and x86_64 respectively" 2015-03-13 17:18:21 +00:00
Yabin Cui
5507dedaeb Merge "Make gtest_main exit 1 when some test are failed." 2015-03-13 17:02:19 +00:00
Yabin Cui
64a9c4f697 Make gtest_main exit 1 when some test are failed.
This is the gtest behavior, which I think can make test status
judgement more convenient.

Change-Id: I7d3c210d1744b954a4148cd905dd5c353207fce8
2015-03-12 23:36:29 -07:00
Yabin Cui
5b8e7cd957 Remove duplication in pthread_mutex.cpp.
Also add unit tests about thread woken up by pthread_mutex_unlock.

Bug: 19216648

Change-Id: I8bde8105b00186c52a2f41d92458ae4a5eb90426
2015-03-12 21:54:41 -07:00
Yabin Cui
58cf31b506 Make pthread join_state not protected by g_thread_list_lock.
1. Move the representation of thread join_state from pthread.attr.flag
   to pthread.join_state. This clarifies thread state change.
2. Use atomic operations for pthread.join_state. So we don't need to
   protect it by g_thread_list_lock. g_thread_list_lock will be reduced
   to only protect g_thread_list or even removed in further changes.

Bug: 19636317
Change-Id: I31fb143a7c69508c7287307dd3b0776993ec0f43
2015-03-12 21:39:49 -07:00
Mark Salyzyn
f6f96df5b0 Merge "syslog.h: missing LOG_MAKEPRI definition" 2015-03-12 20:33:25 +00:00
Mark Salyzyn
c4a586da49 syslog.h: missing LOG_MAKEPRI definition
Bug: 19681572
Change-Id: Ice5f5cb1f71522ffc47b2243a8dc4c277c2a288f
2015-03-12 13:21:35 -07:00
Elliott Hughes
be86f87711 Merge "Add the UMOUNT_NOFOLLOW flag to <sys/mount.h>." 2015-03-11 16:42:49 +00:00
Elliott Hughes
ba87fe5145 Add the UMOUNT_NOFOLLOW flag to <sys/mount.h>.
Change-Id: I2b81cfc3147d9a0a6ac2a8f064e6d9864fa7e04d
2015-03-11 09:32:25 -07:00
Dmitriy Ivanov
e8107b66c5 Merge "Rename LinkerAllocator and LinkerAllocatorPage" 2015-03-11 00:38:49 +00:00
Dmitriy Ivanov
57e800d534 Merge "Refactoring: rename linker_allocator files" 2015-03-11 00:35:22 +00:00
Dmitriy Ivanov
600bc3cb93 Rename LinkerAllocator and LinkerAllocatorPage
Change-Id: I87d80fbcd4ec26c0ee4f601b9c4c64f600418dd9
2015-03-10 15:43:50 -07:00
Dmitriy Ivanov
c9ce70d783 Refactoring: rename linker_allocator files
Change-Id: Ifc08e64b3a85205f072b7abab1149c7ab71e2f75
2015-03-10 15:30:26 -07:00
Dimitry Ivanov
e842dc0de5 am c16c8368: Merge "Generate gnu hash for arm only"
* commit 'c16c8368773452e2d18d761a7b3ea6f249dc2ac5':
  Generate gnu hash for arm only
2015-03-10 17:41:18 +00:00
Dimitry Ivanov
c16c836877 Merge "Generate gnu hash for arm only" 2015-03-10 17:34:51 +00:00
Goran Jakovljevic
1156508265 Generate gnu hash for arm only
Fixes build failure caused by:
https://android-review.googlesource.com/#/c/139660

As previously discussed [1], MIPS does not support GNU-style ELF hashes.

[1] https://android-review.googlesource.com/#/c/49282/2/tests/Android.mk

Change-Id: I9a7966eebfd1ef0a587a20b71faefde38e84ab62
2015-03-10 10:01:50 -07:00
Dmitriy Ivanov
dca2fadd82 am a94cf791: Merge "Generate sysv hash for libc, libstdc++ and libm"
* commit 'a94cf791c1c9b93d49f5573716de93348757ae15':
  Generate sysv hash for libc, libstdc++ and libm
2015-03-10 15:03:35 +00:00
Yabin Cui
50119cec8d am 37c71b14: Merge "Loosen fchmodat AT_SYMLINK_NOFOLLOW test on symlink."
* commit '37c71b14e51c53b0cb5daa19bf38559d063453dc':
  Loosen fchmodat AT_SYMLINK_NOFOLLOW test on symlink.
2015-03-10 15:03:34 +00:00
Dmitriy Ivanov
a94cf791c1 Merge "Generate sysv hash for libc, libstdc++ and libm" 2015-03-10 04:41:02 +00:00
Yabin Cui
37c71b14e5 Merge "Loosen fchmodat AT_SYMLINK_NOFOLLOW test on symlink." 2015-03-10 04:14:12 +00:00
Dmitriy Ivanov
4a55c46d30 Generate sysv hash for libc, libstdc++ and libm
Bug: 19059885
Change-Id: I35e2a9cd0bb3914d9d0c82d163bfaf0fff844667
2015-03-09 19:38:56 -07:00
Yabin Cui
c6e5874a4c Loosen fchmodat AT_SYMLINK_NOFOLLOW test on symlink.
It has been reported in b2/19657449 and b2/19381040 that fchmodat
AT_SYMLINK_NOFOLLOW operation on symlink can succeed. It seems to be
controlled by kernel(version or configuration) or user configuration
whether chmod is allowed on symlinks. Unless we can disable chmod on
symlinks in bionic explicitly, we can not guarantee that the test can
pass. But it seems reasonable to allow chmod on symlink if kernel allows
to. So We prefer to loosen the test here, accepting both success and
failure when doing chmod operation on symlinks.

Bug: 19657449
Bug: 19381040
Change-Id: I780e84f0b50d0412fbac9f1c240d07e984892a28
2015-03-09 18:13:15 -07:00
Dmitriy Ivanov
8af6a7b38e am 017f94d3: Merge "Store fields for gnu_hash separately"
* commit '017f94d34eedfaca1c62cb35a65b8436f04b8f62':
  Store fields for gnu_hash separately
2015-03-09 21:11:02 +00:00
Dmitriy Ivanov
017f94d34e Merge "Store fields for gnu_hash separately" 2015-03-09 21:05:52 +00:00
Dmitriy Ivanov
3597b8055d Store fields for gnu_hash separately
Kindle app relies on soinfo's sysv hash
  fields while linking native libraries.

  This change allows to keep sysv hash fields
  intact for the libraries linked with --hash-style=both.

Bug: 19059885
Change-Id: I12528652955638f1a6586bda99e111bb1c8aa7a3
2015-03-09 21:01:01 +00:00
Jingwei Zhang
5d4f0e6a26 Add the optimized implementation of 18 math functions for x86 and x86_64 respectively
Change-Id: I31bf601448a9427f825517f3a0ff24de47f49bfa
Signed-off-by: Jingwei Zhang <jingwei.zhang@intel.com>
Signed-off-by: Mingwei Shi <mingwei.shi@intel.com>
2015-03-09 13:19:08 -07:00
Nick Kralevich
9e08606c83 am edc1d3e3: Merge "linker: Allow an app to update it\'s own LD_LIBRARY_PATH"
* commit 'edc1d3e3c6266eadcd05a9aa7bcdec701ba060aa':
  linker: Allow an app to update it's own LD_LIBRARY_PATH
2015-03-07 23:38:35 +00:00
Nick Kralevich
edc1d3e3c6 Merge "linker: Allow an app to update it's own LD_LIBRARY_PATH" 2015-03-07 23:31:32 +00:00
Nick Kralevich
6bb01b6e63 linker: Allow an app to update it's own LD_LIBRARY_PATH
When the kernel executes a program which is setuid, setgid, has
file capabilities, or causes an SELinux domain transition, the
AT_SECURE flag is set. This flag instructs the dynamic linker to
prune any dangerous environment variables passed across security
boundaries.

For SELinux in particular, whether this flag is set depends on the
the "noatsecure" process permission. If that permission does not
exist, then AT_SECURE=1 whenever a domain transition occurs.

In https://android-review.googlesource.com/129971 , Android stopped
using noatsecure when executing init services. In
https://android-review.googlesource.com/130610 , init was flipped
back into SELinux enforcing mode, making ag/129971 active. The
combination of those two changes ensured that AT_SECURE=1 was
set when executing init spawned services.

In particular, AT_SECURE=1 is set when init executes zygote. Due to
the forking nature of zygote, AT_SECURE remains untouched when
executing zygote's children.

This causes problems for the code added in
https://android-review.googlesource.com/48409 . Specifically, if
AT_SECURE=1, an attempt to call android_update_LD_LIBRARY_PATH()
is silently ignored. This causes problems when art tries to adjust
the LD_LIBRARY_PATH for Android apps. Ultimately, apps are unable
to find shared libraries they depend on.

As discussed in bug 7896159, there's no security reason for
preventing an application from updating it's own LD_LIBRARY_PATH.
We only need to prune LD_LIBRARY_PATH when transitioning across
security boundaries, but not when we're entirely within a security
boundary.

Remove the AT_SECURE check within do_android_update_LD_LIBRARY_PATH().
It's unneeded and prevents an application from modifying it's own
LD_LIBRARY_PATH. This allows an application to specify a location
where it's dlopen()ed shared libraries should be loaded from.

There is no change to AT_SECURE handling in
__sanitize_environment_variables(). We continue to honor it there
to prevent using security sensitive environment variables across
an exec boundary.

Bug: 19559835
Change-Id: If4af2ee8e84265aaa0c93de8b281208b20d7942a
2015-03-07 13:37:05 -08:00
Christopher Ferris
5c329e45dc am 9afb08dd: Merge "libm: Add hardware sqrt, ceil, floor and trunc for x86 & x86_64"
* commit '9afb08dd0984acea49da5aae21b41522cb805dac':
  libm: Add hardware sqrt, ceil, floor and trunc for x86 & x86_64
2015-03-07 17:13:22 +00:00
Dmitriy Ivanov
2bf9f30a3a am 536ec735: Merge changes I796a4ce8,I6165d062,I66c95d90,Ia67fa11d
* commit '536ec7359eb951655e389443aa918a4bb16b2d8b':
  Add support for packed relocations.
  Refactoring: introduce reloc_iterators
  Generalize compression tool
  Import relocation packer from chromium repo
2015-03-07 17:13:21 +00:00
Yabin Cui
2bb873aee9 am e86a86f9: Merge "Remove PTHREAD_ATTR_FLAG_MAIN_THREAD."
* commit 'e86a86f9f24df7028d2596c69ff008cf88e039e4':
  Remove PTHREAD_ATTR_FLAG_MAIN_THREAD.
2015-03-07 17:13:21 +00:00
Christopher Ferris
9afb08dd09 Merge "libm: Add hardware sqrt, ceil, floor and trunc for x86 & x86_64" 2015-03-07 16:46:27 +00:00
Dmitriy Ivanov
536ec7359e Merge changes I796a4ce8,I6165d062,I66c95d90,Ia67fa11d
* changes:
  Add support for packed relocations.
  Refactoring: introduce reloc_iterators
  Generalize compression tool
  Import relocation packer from chromium repo
2015-03-07 07:08:51 +00:00
Dmitriy Ivanov
18a6956b76 Add support for packed relocations.
Change-Id: I796a4ce86d3fccb8361c19889419c96147ee3c9f
2015-03-06 17:12:47 -08:00
James Rose
45789b63db libm: Add hardware sqrt, ceil, floor and trunc for x86 & x86_64
Add hardware implementations for sqrt, ceil, floor and trunc for
x86 and x86_64. These routines, and in particular sqrt are much
faster than the BSD C language versions of these functions.

Fixed whitespace errors.

Revised x86 versions with respect to alignment.
Rebased for Android 5.0

Change-Id: I86bdb520ce5e589b0cf63778f353fbd3263c8f0e
Author: James Rose <james.rose@intel.com>
Signed-off-by: James Rose <james.rose@intel.com>
2015-03-06 16:48:30 -08:00
Yabin Cui
e86a86f9f2 Merge "Remove PTHREAD_ATTR_FLAG_MAIN_THREAD." 2015-03-06 23:21:12 +00:00
Yabin Cui
9d0c79304d Remove PTHREAD_ATTR_FLAG_MAIN_THREAD.
Make this change because I think it is more reasonable to check stack info
in pthread_getattr_np. I believe pthread_attr_t is not tied with any thread,
and can't have a flag saying who using it is the main thread.
This change also helps refactor of g_thread_list_lock.

Bug: 19636317
Change-Id: Iedbb85a391ac3e1849dd036d01445dac4bc63db9
2015-03-06 15:16:44 -08:00
Dmitriy Ivanov
fa26eee776 Refactoring: introduce reloc_iterators
Replace rel/rela array with reloc_iterators.

Change-Id: I6165d062e0390b6bc60da2e8279aabbedf828ec9
2015-03-06 13:01:08 -08:00
Dmitriy Ivanov
f8ff6b103b Generalize compression tool
1. One binary for all architectures
 2. Generalize (and slightly improve) compression
 2.1 works on all relocation types (rela?.dyn section only so far)
 2.2 Uses same format to encode ElfW(Rel) as well as ElfW(Rela) tables

Bug: 18051137
Change-Id: I66c95d9076954ca115816fc577d0f5ef274e5e72
2015-03-06 13:01:08 -08:00
Dmitriy Ivanov
87a0617ebe Import relocation packer from chromium repo
Bug: 18051137
Change-Id: Ia67fa11da8247e3f86f70a8ce99e6695f2c05423
2015-03-06 13:01:08 -08:00
Yabin Cui
a1d1f658b5 am 45ee73a7: Merge "Rename fortify_sprintf_warnings.cpp to fortify_compilation_test.cpp."
* commit '45ee73a7fbe98cba2ccb007b60c027d27dfca1cb':
  Rename fortify_sprintf_warnings.cpp to fortify_compilation_test.cpp.
2015-03-06 21:00:16 +00:00
Yabin Cui
45ee73a7fb Merge "Rename fortify_sprintf_warnings.cpp to fortify_compilation_test.cpp." 2015-03-06 20:52:31 +00:00
Yabin Cui
af1ad42208 am fe4f2a67: Merge "Use pthread_once for g_uselocale_key creation."
* commit 'fe4f2a6734ed3ace50606900143e84993f450caf':
  Use pthread_once for g_uselocale_key creation.
2015-03-06 05:34:31 +00:00