15063 Commits

Author SHA1 Message Date
Dmitriy Ivanov
38c37d6705 Work around for libraries without dt_soname
Applies only for apps targeting sdk version <= 22

Bug: http://b/21565766
Change-Id: If0bf2229dc1341e9ca09f9a05d0890515273d5a2
2015-06-02 13:45:15 -07:00
Nick Kralevich
c92f9f8069 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

(cherrypicked from commit 2825f10b7f61558c264231a536cf3affc0d84204)

Change-Id: Ic0cdf9f9dd0e35a63b44a4c4a08400020041eddf
2015-06-02 10:08:05 -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
c4ebe60e1a 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
(cherry picked from commit f439b5a3186ca0fef1092f45770abc716da9d87a)
2015-06-01 16:57:33 -07: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
c5e02eeb35 Cleanup ftruncate negative test.
Addresses post-submit comments from
I54692ab8105dd09db6af7a2c0894a17bdd118aa0.

Bug: http://b/21309901
Change-Id: Ie19ee8cdcc4055a65fe7dfc103156e54eafe8977
(cherry picked from commit 9d476a02e9a14e847669a6683c585028175aa322)
2015-06-01 13:24:36 -07: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
Dan Albert
5f3e19dbbe Fix error handling for negative size in ftruncate.
Bug: 21309901
Change-Id: I54692ab8105dd09db6af7a2c0894a17bdd118aa0
(cherry picked from commit c05554ec5c9aff5e0f1e83de9bb62c3569eecca2)
2015-06-01 11:28:13 -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
ca10ac6dd4 Improve some of error/warning messages
Bug: http://b/20464031
Change-Id: I948141c46f9e054fc45f5934153dee56ce3cd558
(cherry picked from commit 087005f37e02b48809746947159d824493885b1e)
2015-05-28 15:28:41 -07:00
Dmitriy Ivanov
5511551009 Merge "Improve some of error/warning messages" 2015-05-28 22:28:13 +00:00
Dmitriy Ivanov
4a7c3af054 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
(cherry picked from commit d974e8804689058714dc4fe9adcb57ee9a6996a8)
2015-05-28 15:25:55 -07: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
d8ead18145 Add functions to provide target sdk version
Bug: http://b/21364029
Change-Id: I8648d1bff6c8fd6e7cd12da7f128e048b9f2829a
(cherry picked from commit 79fd668bb4ddb22432eeda2ebd8d10359013d9a8)
2015-05-27 16:20:16 -07: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" android-m-preview 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
15309fde91 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
(cherry picked from commit b96ac41b32e61799c48f3fd07831cc168b95068d)
2015-05-22 15:24:13 -07: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