Commit Graph

12828 Commits

Author SHA1 Message Date
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
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
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
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
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
f9b3f25e0b am 1c78181a: Merge "Fix fortify compilation test on x86."
* commit '1c78181a9da19778dbbcc162854f9564a51243bf':
  Fix fortify compilation test on x86.
2015-03-05 06:39:55 +00:00
Yabin Cui
1c78181a9d Merge "Fix fortify compilation test on x86." 2015-03-05 06:36:47 +00:00
Yabin Cui
94545eba37 Fix fortify compilation test on x86.
Change-Id: I9b88cbcec51b6f1dbac2780a9bf82851bd6cc87c
2015-03-04 22:35:13 -08:00
Yabin Cui
c2917ec702 am 5ad57ce6: Merge "Fix fortify compilation test on mips."
* commit '5ad57ce6ab95a12ab738eb7cd3595745ddd60d8d':
  Fix fortify compilation test on mips.
2015-03-05 05:50:33 +00:00
Yabin Cui
5ad57ce6ab Merge "Fix fortify compilation test on mips." 2015-03-05 05:46:16 +00:00
Yabin Cui
f3bd305b8f Fix fortify compilation test on mips.
Change-Id: Icff5b859ae58067bfa34430d3f5684335fe063b4
2015-03-04 21:43:14 -08:00
Yabin Cui
80aa71aa71 am e1c0213b: Merge "Switch pthread_rwlock_t to stdatomic."
* commit 'e1c0213be3f0c2c4e310cbc262da88835a2e5d86':
  Switch pthread_rwlock_t to stdatomic.
2015-03-05 04:48:48 +00:00
Yabin Cui
e1c0213be3 Merge "Switch pthread_rwlock_t to stdatomic." 2015-03-05 04:42:35 +00:00
Yabin Cui
08ee8d2030 Switch pthread_rwlock_t to stdatomic.
Bug: 19099838
Change-Id: Ie82967a60b5cec61a8bdd1e0e4a03738d01944f8
2015-03-04 18:16:20 -08:00