Commit graph

25229 commits

Author SHA1 Message Date
Elliott Hughes
2bc42e9664 Merge "The VDSO soname varies by architecture."
am: e2d6c1e76c

Change-Id: I0836e5064db05b624d494248b6f5fe5716c45450
2018-02-16 23:19:59 +00:00
Elliott Hughes
e2d6c1e76c Merge "The VDSO soname varies by architecture." 2018-02-16 21:51:54 +00:00
Elliott Hughes
da1bb11340 The VDSO soname varies by architecture.
From http://man7.org/linux/man-pages/man7/vdso.7.html:

       user ABI   vDSO name
       ─────────────────────────────
       aarch64    linux-vdso.so.1
       arm        linux-vdso.so.1
       ia64       linux-gate.so.1
       mips       linux-vdso.so.1
       ppc/32     linux-vdso32.so.1
       ppc/64     linux-vdso64.so.1
       s390       linux-vdso32.so.1
       s390x      linux-vdso64.so.1
       sh         linux-gate.so.1
*      i386       linux-gate.so.1
*      x86-64     linux-vdso.so.1
       x86/x32    linux-vdso.so.1

Note that Android "x86" is Linux's "i386", which is the odd one out
amongst Android's supported architectures.

Bug: http://b/72831787
Test: ran tests
Change-Id: I0a28127af042e2fd7673f24bbb30f8a50556cf96
2018-02-16 10:05:08 -08:00
Elliott Hughes
52d10ed272 Merge "Add __fseterr."
am: d5172fced0

Change-Id: I847cdaa0766f540cad474c4137650210eca14247
2018-02-15 02:47:16 +00:00
Treehugger Robot
d5172fced0 Merge "Add __fseterr." 2018-02-15 02:36:38 +00:00
Elliott Hughes
f1589c5d14 Merge "Add remaining _l function stubs."
am: 665ce210fa

Change-Id: I9f0c8f4e16022730e1bc6a0387ed04201fc8fb0d
2018-02-15 01:34:03 +00:00
Elliott Hughes
665ce210fa Merge "Add remaining _l function stubs." 2018-02-15 01:26:17 +00:00
Elliott Hughes
457852666c Add __fseterr.
Trivial, obvious counterpart to the standard ferror(3) and clearerr(3),
and lets us build bison out of the box.

Bug: http://b/64273806
Test: ran tests
Change-Id: I20affabddb71210051165c41e86adfe5ae04f77f
2018-02-14 15:25:21 -08:00
Elliott Hughes
55d7fcea34 Merge "Add uc_sigmask64."
am: 38a78728c3

Change-Id: I6c0712cfb7927f1c0f4163dd2eadc74ca7d35ea7
2018-02-14 21:42:48 +00:00
Elliott Hughes
38a78728c3 Merge "Add uc_sigmask64." 2018-02-14 21:24:11 +00:00
Elliott Hughes
3376c23dac Add remaining _l function stubs.
Bug: http://b/65595804
Test: ran tests
Change-Id: I3bea3af20b354d1f0d3e05fd35421a9045f29020
2018-02-13 23:14:12 -08:00
Elliott Hughes
23415fc60d Add uc_sigmask64.
Added to each ucontext_t for source compatibility between platforms where
sigset_t and sigset64_t differ (arm, x86) and where they're the same
(all the rest).

Bug: http://b/72493232
Test: ran tests
Change-Id: I65a37bfa177933701bbe6c2350448885fd0f9c43
2018-02-13 19:09:04 -08:00
Elliott Hughes
35549743bc Merge "Switch the rest of our internal headers to #pragma once."
am: 2d1e1011cf

Change-Id: I694d29c8c32ef1035668e3a8ac0c18230651cf45
2018-02-14 03:05:21 +00:00
Treehugger Robot
2d1e1011cf Merge "Switch the rest of our internal headers to #pragma once." 2018-02-14 02:53:37 +00:00
Christopher Ferris
7cf17cc1b0 Merge "Implement malloc hooks."
am: af8d54a7d7

Change-Id: Ic89879c033b37b11c56ff557b0af3e95453dc1da
2018-02-14 01:02:59 +00:00
Christopher Ferris
af8d54a7d7 Merge "Implement malloc hooks." 2018-02-14 00:49:48 +00:00
Elliott Hughes
cbc80ba9d8 Switch the rest of our internal headers to #pragma once.
We've been using #pragma once for new internal files, but let's be more bold.

Bug: N/A
Test: builds
Change-Id: I7e2ee2730043bd884f9571cdbd8b524043030c07
2018-02-13 14:27:17 -08:00
Christopher Ferris
db478a6274 Implement malloc hooks.
Use the malloc debug framework to implement the malloc debug hooks
since it can introduce a performance issue.

Also, modify the bionic/tests/utils.h slightly to dump an error message
when the exe failed.

Bug: 30561479

Test: Ran malloc hook unit tests.
Test: Ran malloc debug unit tests.
Test: Enabled malloc hooks and ran bionic unit tests and verified no
Test: unexpected failures.
Test: Enabled malloc debug and malloc hooks and verified malloc debug wins.
Test: Enabled malloc debug using env, property, and property with name
Test: still works.

Change-Id: Ib50046a0493c5c2050cf831befb812310bdcc249
(cherry picked from commit d6a1dc2379)
2018-02-13 13:37:30 -08:00
Ryan Prichard
fbe8a1b482 Merge "Switch x86 begin.c to asm; align ESP correctly"
am: 3374d0cabb

Change-Id: If3d28736735c7b8434e1f14c628d096b775c9b72
2018-02-13 16:42:24 +00:00
Elliott Hughes
b5e9c6a399 Merge "Better backwards compatibility for stat64."
am: f99b7a34c8

Change-Id: I76cf6ff02055474209fa2ddf1f4299e5c6ad7d45
2018-02-13 16:36:13 +00:00
Treehugger Robot
3374d0cabb Merge "Switch x86 begin.c to asm; align ESP correctly" 2018-02-13 16:17:27 +00:00
Elliott Hughes
f99b7a34c8 Merge "Better backwards compatibility for stat64." 2018-02-13 15:42:55 +00:00
Tom Cherry
c4033e1485 Merge "Revert "Remove a check for AIDs in the OEM range.""
am: a8b179bcdd

Change-Id: Ib3e706b19a87303c4add32d0b80535d1a3818308
2018-02-13 07:45:20 +00:00
Treehugger Robot
a8b179bcdd Merge "Revert "Remove a check for AIDs in the OEM range."" 2018-02-13 07:09:27 +00:00
Ryan Prichard
f857d59635 Switch x86 begin.c to asm; align ESP correctly
Every other architecture already uses an assembly file here.

The previous code aligned ESP incorrectly, but it doesn't really matter
because everything is built with Clang's -mstackrealign, which realigns
ESP in every function prologue.

Bug: http://b/73140672#comment4
Test: lunch aosp_x86-eng; m; emulator; device boots
Test: manual
Change-Id: I921fd7848cdc611b4f8f13d1176d1983ffea952d
2018-02-12 21:43:12 -08:00
Elliott Hughes
25f17e48df Better backwards compatibility for stat64.
Caused problems for some Google source switching to unified headers
because the legacy headers just used #define instead.

Bug: http://b/73210428
Test: builds
Change-Id: If8a36f284031e57af419903610029a8c34a23d91
2018-02-12 15:48:01 -08:00
Goran Jakovljevic
52d1ff5329 Merge "MIPS32: Make sigset64_t equal to sigset_t"
am: 919dd9dcb4

Change-Id: I5fd10e2653a645470fde6b23b63db2b9ed6b0647
2018-02-12 19:01:44 +00:00
Tom Cherry
41986a013a Revert "Remove a check for AIDs in the OEM range."
We now have a proper mechanism for OEMs to create new AIDs via
config.fs and /vendor/etc/{passwd,group}.  This means that there is no
reason for OEMs to add AIDs by modifying android_filesystem_config.h,
and therefore we can add this check back.

Bug: 27999086
Test: pwd and grp tests pass with custom AIDs in config.fs

This reverts commit a14485adde.

Change-Id: I74a28ff267a595e83cf692b27fd8b5170a021f54
2018-02-12 10:49:13 -08:00
Treehugger Robot
919dd9dcb4 Merge "MIPS32: Make sigset64_t equal to sigset_t" 2018-02-12 18:49:12 +00:00
Tom Cherry
69bd70122a Merge "Add ability to read /etc/passwd and /etc/group"
am: ab8c861597

Change-Id: I05b9b2559dbf30f2dedfa722584433b95d1215a1
2018-02-12 16:32:37 +00:00
Tom Cherry
ab8c861597 Merge "Add ability to read /etc/passwd and /etc/group" 2018-02-12 16:27:20 +00:00
Goran Jakovljevic
379666996d MIPS32: Make sigset64_t equal to sigset_t
sigset_t is already large enough on mips so use the same principle
as on LP64 architectures: typedef sigset_t sigset64_t

Also prevent accessing sa_restorer field for architectures which
don't define SA_RESTORER in signal_test.

This allows compilation of signal_test.

Test: bionic-unit-tests in QEMU (MIPS32)
Change-Id: I965e202c9a7f7d109e4ec25ad87172dc7c1b8806
2018-02-12 09:03:10 +01:00
George Burgess IV
974de08375 Merge "Remove __overloadable/__RENAME_CLANG"
am: 4362da8076

Change-Id: I8035439bd15876a5a8d5ded547e25760328affee
2018-02-10 02:52:00 +00:00
Treehugger Robot
4362da8076 Merge "Remove __overloadable/__RENAME_CLANG" 2018-02-10 02:30:37 +00:00
Josh Gao
57bbcbd847 Merge "linker_memory: return success in enable_fallback_allocator."
am: 6fa9bddbc7

Change-Id: If5636675dfd39e1a5d42f875917c2462efb97749
2018-02-10 01:59:21 +00:00
Treehugger Robot
6fa9bddbc7 Merge "linker_memory: return success in enable_fallback_allocator." 2018-02-10 01:44:07 +00:00
Ryan Prichard
9ae7d46291 Merge "crtbegin: Correctly align ESP to 16 for __i386__"
am: 5bf2c20f43

Change-Id: I5b38b1b07b068489b29443dcb3ef087ee07d23b3
2018-02-09 07:06:50 +00:00
Treehugger Robot
5bf2c20f43 Merge "crtbegin: Correctly align ESP to 16 for __i386__" 2018-02-09 06:56:31 +00:00
Dan Albert
6722d68aaa Merge "Add _FORCE_CRT_ATFORK config for crtbegin."
am: 59a0a37b9d

Change-Id: Iae273eec0ae8fd839def86b0a20ab37a0892f017
2018-02-09 05:54:38 +00:00
Treehugger Robot
59a0a37b9d Merge "Add _FORCE_CRT_ATFORK config for crtbegin." 2018-02-09 05:41:31 +00:00
Ryan Prichard
a0d177d010 crtbegin: Correctly align ESP to 16 for __i386__
The (lowest) address of the argument area (aka ESP immediately prior to
the call instruction) must be aligned to 0 mod 16. Here, it is aligned to
12 mod 16.

From the SysV ABI doc (2.2.2 The Stack Frame)

"""The end of the input argument area shall be aligned on a 16 (32, if
__m256 is passed on stack) byte boundary. In other words, the value
(%esp + 4) is always a multiple of 16 (32) when control is transferred to
the function entry point."""

Test: extract code into a separate C file and verify stack alignment in a
  "start_main" function
Test: use the upcoming NDK r17-beta1 (with new Bionic crtbegin*.o files)
  with an M-23 x86 system image, check alignment in main (compiled with
  Clang not GCC, compiled w/o -mstackrealign)
Bug: b/73140672

Change-Id: Ia8d93fe5668d0a514a9fd22c40bf8362805111e6
2018-02-08 20:55:57 -08:00
Elliott Hughes
8c37f5ad5b Merge "Document the rules of thumb for "should I add a syscall wrapper?"."
am: 3d6b2e78a9

Change-Id: I776cfdedf394b4e13cb76b14fafb789c94671bb2
2018-02-09 03:46:56 +00:00
Elliott Hughes
3d6b2e78a9 Merge "Document the rules of thumb for "should I add a syscall wrapper?"." 2018-02-09 03:33:43 +00:00
Tom Cherry
6034ef85d8 Add ability to read /etc/passwd and /etc/group
Add the capability to read /etc/passwd and /etc/group for getpw* and
getgr* functions.

Bug: 27999086
Test: pwd, grp, grp_pwd_file unit tests
Test: Read in custom users/groups from /etc/{passwd,group}
Change-Id: Idc1f054af8a7ca34743a90493495f0ccc775a0d8
2018-02-08 12:38:57 -08:00
Elliott Hughes
1a1b57cb83 Document the rules of thumb for "should I add a syscall wrapper?".
This isn't well known, and causes confusion for at least a couple of
people each year.

Bug: N/A
Test: N/A
Change-Id: I43127d937ee81d0c79bbc496638a1b1b6003dd80
2018-02-08 09:53:59 -08:00
Goran Jakovljevic
c6cf969283 Merge "Don't use SA_RESTORER if it is not defined"
am: aac0dd9891

Change-Id: I025e86e3c0c0020496baf94588b106eab018a973
2018-02-08 08:03:31 +00:00
Treehugger Robot
aac0dd9891 Merge "Don't use SA_RESTORER if it is not defined" 2018-02-08 07:47:21 +00:00
Dan Albert
4067bf9e3a Merge "Fix __gnu_Unwind_Find_exidx again."
am: 1a5737a48f

Change-Id: I70bcdb6028e38e630066490fed7c87767664439c
2018-02-07 20:19:03 +00:00
Treehugger Robot
1a5737a48f Merge "Fix __gnu_Unwind_Find_exidx again." 2018-02-07 20:10:01 +00:00
Dan Albert
b64f3fe81d Merge "Add a few more legacy inlines for strto*_l."
am: 13dec2354d

Change-Id: I53574a944999870ccd3c2931ed17a588a70f8041
2018-02-07 20:08:54 +00:00