14083 Commits

Author SHA1 Message Date
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
7a507ba202 am 563fd91a: am 9e08606c: am edc1d3e3: Merge "linker: Allow an app to update it\'s own LD_LIBRARY_PATH"
* commit '563fd91a314958ae0fec09471056e6071e71f72a':
  linker: Allow an app to update it's own LD_LIBRARY_PATH
2015-03-08 00:18:04 +00:00
Christopher Ferris
da597738d8 am 0e2b8b80: am 5c329e45: am 9afb08dd: Merge "libm: Add hardware sqrt, ceil, floor and trunc for x86 & x86_64"
* commit '0e2b8b800036c79bf05760e28896041028a2fa3c':
  libm: Add hardware sqrt, ceil, floor and trunc for x86 & x86_64
2015-03-08 00:18:03 +00:00
Dmitriy Ivanov
5e05683975 am 7d62778c: am 2bf9f30a: am 536ec735: Merge changes I796a4ce8,I6165d062,I66c95d90,Ia67fa11d
* commit '7d62778c0f7b404961361e0a1745ff8f880ec805':
  Add support for packed relocations.
  Refactoring: introduce reloc_iterators
  Generalize compression tool
  Import relocation packer from chromium repo
2015-03-08 00:18:02 +00:00
Yabin Cui
a01387a16b am 7db2acbb: am 2bb873ae: am e86a86f9: Merge "Remove PTHREAD_ATTR_FLAG_MAIN_THREAD."
* commit '7db2acbb694871da2b02ccf2261c01e0faf812ae':
  Remove PTHREAD_ATTR_FLAG_MAIN_THREAD.
2015-03-08 00:18:01 +00:00
Yabin Cui
a2d3511e36 am 39416d70: am a1d1f658: am 45ee73a7: Merge "Rename fortify_sprintf_warnings.cpp to fortify_compilation_test.cpp."
* commit '39416d701cdbcff68d7ed11720b61d8a4a9e66bd':
  Rename fortify_sprintf_warnings.cpp to fortify_compilation_test.cpp.
2015-03-08 00:18:00 +00:00
Yabin Cui
1493be412e am 185d511b: am af1ad422: am fe4f2a67: Merge "Use pthread_once for g_uselocale_key creation."
* commit '185d511bf827d864397e8ac2dd886ae19618f71d':
  Use pthread_once for g_uselocale_key creation.
2015-03-08 00:17:59 +00:00
Nick Kralevich
563fd91a31 am 9e08606c: am edc1d3e3: Merge "linker: Allow an app to update it\'s own LD_LIBRARY_PATH"
* commit '9e08606c8353b543f414625a475aaab390de161f':
  linker: Allow an app to update it's own LD_LIBRARY_PATH
2015-03-08 00:08:43 +00:00
Christopher Ferris
0e2b8b8000 am 5c329e45: am 9afb08dd: Merge "libm: Add hardware sqrt, ceil, floor and trunc for x86 & x86_64"
* commit '5c329e45dc5b4216be673459bcc7c5abcce5f2d3':
  libm: Add hardware sqrt, ceil, floor and trunc for x86 & x86_64
2015-03-08 00:08:32 +00:00
Dmitriy Ivanov
7d62778c0f am 2bf9f30a: am 536ec735: Merge changes I796a4ce8,I6165d062,I66c95d90,Ia67fa11d
* commit '2bf9f30a3ae9892660b7f7f64fd4d60bae712ed6':
  Add support for packed relocations.
  Refactoring: introduce reloc_iterators
  Generalize compression tool
  Import relocation packer from chromium repo
2015-03-08 00:08:30 +00:00
Yabin Cui
7db2acbb69 am 2bb873ae: am e86a86f9: Merge "Remove PTHREAD_ATTR_FLAG_MAIN_THREAD."
* commit '2bb873aee94db4f317a62480b07f6d4d1d33da6d':
  Remove PTHREAD_ATTR_FLAG_MAIN_THREAD.
2015-03-08 00:08:29 +00:00
Yabin Cui
39416d701c am a1d1f658: am 45ee73a7: Merge "Rename fortify_sprintf_warnings.cpp to fortify_compilation_test.cpp."
* commit 'a1d1f658b5ed0508a21c87008a13830530660eba':
  Rename fortify_sprintf_warnings.cpp to fortify_compilation_test.cpp.
2015-03-08 00:07:50 +00:00
Yabin Cui
185d511bf8 am af1ad422: am fe4f2a67: Merge "Use pthread_once for g_uselocale_key creation."
* commit 'af1ad4220885bc37a347086cac15863fe9bbe16e':
  Use pthread_once for g_uselocale_key creation.
2015-03-08 00:07:22 +00: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
Yabin Cui
fe4f2a6734 Merge "Use pthread_once for g_uselocale_key creation." 2015-03-06 05:28:24 +00:00
Yabin Cui
f7e3b3e48a Use pthread_once for g_uselocale_key creation.
Bug: 19625804
Change-Id: I57ec4c965067dc0c157c795c1f7217a3ca403286
2015-03-05 20:39:10 -08:00
Christopher Ferris
bef6cbbe79 am 35e88f9b: am e953f3cf: am 71bf8379: Merge "libm: arm: add arm specific sqrt and sqrtf"
* commit '35e88f9b8bf51b75bb4fe7a72d43875bfed228f6':
  libm: arm: add arm specific sqrt and sqrtf
2015-03-05 22:43:24 +00:00
Christopher Ferris
35e88f9b8b am e953f3cf: am 71bf8379: Merge "libm: arm: add arm specific sqrt and sqrtf"
* commit 'e953f3cf985e810071d707bcc296b20ec6e2e8dd':
  libm: arm: add arm specific sqrt and sqrtf
2015-03-05 22:35:46 +00:00
Christopher Ferris
e953f3cf98 am 71bf8379: Merge "libm: arm: add arm specific sqrt and sqrtf"
* commit '71bf837982446b31f435031ed2d10aa1c8c15988':
  libm: arm: add arm specific sqrt and sqrtf
2015-03-05 21:59:08 +00:00
Christopher Ferris
71bf837982 Merge "libm: arm: add arm specific sqrt and sqrtf" 2015-03-05 21:55:21 +00:00
Yabin Cui
120a29749d am 807c623b: am 9ecb7f40: am c3307dc4: Merge "Better control of pthread keys used in bionic."
* commit '807c623b58c7020e8419057fac0c58f0a7099bbe':
  Better control of pthread keys used in bionic.
2015-03-05 19:26:31 +00:00
Yabin Cui
807c623b58 am 9ecb7f40: am c3307dc4: Merge "Better control of pthread keys used in bionic."
* commit '9ecb7f40d01d7ee258d11277944cc2415635ea17':
  Better control of pthread keys used in bionic.
2015-03-05 18:39:22 +00:00
Yabin Cui
9ecb7f40d0 am c3307dc4: Merge "Better control of pthread keys used in bionic."
* commit 'c3307dc43b2526c4031837738b139d22831c5d09':
  Better control of pthread keys used in bionic.
2015-03-05 18:33:31 +00:00
Yabin Cui
c3307dc43b Merge "Better control of pthread keys used in bionic." 2015-03-05 18:26:44 +00:00
Yabin Cui
93e094f9c3 am 4710b5fb: am 917cb395: am 5d400204: Merge "Fix fortify compilation test in x86_64."
* commit '4710b5fb5d0939c2212769b054d700152f7fd885':
  Fix fortify compilation test in x86_64.
2015-03-05 08:59:33 +00:00
Yabin Cui
4710b5fb5d am 917cb395: am 5d400204: Merge "Fix fortify compilation test in x86_64."
* commit '917cb395bc7c71b34d3a4feca0c619d2aaf89fd8':
  Fix fortify compilation test in x86_64.
2015-03-05 08:53:16 +00:00
Yabin Cui
917cb395bc am 5d400204: Merge "Fix fortify compilation test in x86_64."
* commit '5d400204589ceb781fa11864c2e8f3001e5dc96f':
  Fix fortify compilation test in x86_64.
2015-03-05 08:47:12 +00:00
Yabin Cui
24e8871faa Rename fortify_sprintf_warnings.cpp to fortify_compilation_test.cpp.
Bug: 19234260
Change-Id: Ife27ca13eeae317739eda25b40dd2a08606d6d6f
2015-03-05 00:46:18 -08:00
Yabin Cui
5d40020458 Merge "Fix fortify compilation test in x86_64." 2015-03-05 08:40:58 +00:00
Yabin Cui
d9647594de Fix fortify compilation test in x86_64.
Change-Id: Ic243f6583e4f435899d01c7845dddacacbfc916e
2015-03-05 00:39:09 -08:00
Yabin Cui
97bd338e55 am 3801fb1e: am f9b3f25e: am 1c78181a: Merge "Fix fortify compilation test on x86."
* commit '3801fb1e8bbaeef23f6a0cf8709ecd60d4ec5f6a':
  Fix fortify compilation test on x86.
2015-03-05 06:51:36 +00:00
Yabin Cui
3801fb1e8b am f9b3f25e: am 1c78181a: Merge "Fix fortify compilation test on x86."
* commit 'f9b3f25e0ba641cc59a741492737f4712f2d798a':
  Fix fortify compilation test on x86.
2015-03-05 06:44:02 +00:00