Commit graph

25246 commits

Author SHA1 Message Date
Ryan Prichard
75cb71c510 Merge changes Idc5da0f8,I64223714
am: 9c85408d95

Change-Id: Iee95450f21eeea98e31565bc54edb945298eb28a
2018-02-22 07:12:27 +00:00
Treehugger Robot
9c85408d95 Merge changes Idc5da0f8,I64223714
* changes:
  Reject exit-time destructors in libc
  Remove non-trivial constructors/destructors from SystemProperties
2018-02-22 06:48:12 +00:00
Ryan Prichard
8f419579ed Reject exit-time destructors in libc
Test: m libc
Bug: b/73485611
Change-Id: Idc5da0f8a21e3f58fc68085577fa5fca40057276
2018-02-21 15:10:24 -08:00
Tom Cherry
ee8e3dd67c Remove non-trivial constructors/destructors from SystemProperties
With the goal of disallowing exit time destructors, SystemProperties's
non-trivial destructor needs to be removed.  This means replacing the
union hack with yet another hack as we don't want to allocate anything
despite relying on some polymorphism.

Bug: 73485611
Test: boot bullhead
Change-Id: I64223714c9b26c9724bfb8f3e2b0168e47b56bc8
2018-02-21 15:10:17 -08:00
Tom Cherry
9fa8caa815 Merge changes Ibcd45e9b,I1ff5c0fa
am: 44c7b6ad0a

Change-Id: If8e462a66adea805e1a44f4441c7a0b07d9e835b
2018-02-21 04:53:08 +00:00
Tom Cherry
44c7b6ad0a Merge changes Ibcd45e9b,I1ff5c0fa
* changes:
  Do not munmap in MmapFile::~MmapFile
  Build bionic/tests with cpp_std experimental.
2018-02-21 04:41:21 +00:00
Tom Cherry
9104a702bc Merge "Fix mmap leak in MmapFile"
am: d27a3d7853

Change-Id: I8309fc4cd9889857e1b3ed813ec9b374b3ce5e4d
2018-02-21 02:20:40 +00:00
Treehugger Robot
d27a3d7853 Merge "Fix mmap leak in MmapFile" 2018-02-21 02:14:21 +00:00
Tom Cherry
5fe73268f3 Do not munmap in MmapFile::~MmapFile
Having any destructor with a global variable in bionic is causing
some issues. Since we don't actually need to munmap in this case, we
remove the destructor to work around that issue.

A small class is used to still munmap during tests.

Bug: 73485611
Test: bionic unit tests
Change-Id: Ibcd45e9b1ab22d187ecfc2738bb87244250d81ea
2018-02-20 16:02:13 -08:00
Tom Cherry
cb4d42173e Fix mmap leak in MmapFile
If the mmap'ed file doesn't end in a new line, previously we'd leak
the mmap'ed region.  This change now munmap's the region.

Test: unit tests
Change-Id: If28d3d9a6b1b9c54123beecb3bbbe8ed984ca81d
2018-02-20 15:50:04 -08:00
Tom Cherry
60ddedff0b Build bionic/tests with cpp_std experimental.
Test: bionic unit tests still pass.
Change-Id: I1ff5c0fa391ae111ac19e863ef0f7f29868406e6
2018-02-20 15:40:02 -08:00
dimitry
068ea4563a Merge "Fix RTLD_NEXT/DEFAULT lookup"
am: e510d9c369

Change-Id: I5b525fbbb6bcff3e368cc11f2624d4d92c095213
2018-02-20 22:32:04 +00:00
Treehugger Robot
e510d9c369 Merge "Fix RTLD_NEXT/DEFAULT lookup" 2018-02-20 22:24:37 +00:00
dimitry
153168c855 Fix RTLD_NEXT/DEFAULT lookup
RTLD_NEXT/DEFAULT lookup should not skip handle lookup
in the case when the load group is RTLD_GLOBAL.

Note that there is a difference between load group is local group.
The local group includes externally referenced libraries where
the load group does not. The external reference in this context is a
DT_NEEDED library that belongs to a previously loaded group.

Bug: http://b/72237367
Test: bionic-unit-tests --gtest_filter=dl*
Change-Id: I8997cc961c13a5396f1756161798b45ed1cab16c
2018-02-20 17:10:00 +01:00
Elliott Hughes
10f60624f7 Merge "Remove obsolete debuggerd32/debuggerd64 hack."
am: 0da2523570

Change-Id: I218a0f61e4cc0c8d71dcf8085fb35c0d25e8a25d
2018-02-16 23:49:33 +00:00
Treehugger Robot
0da2523570 Merge "Remove obsolete debuggerd32/debuggerd64 hack." 2018-02-16 23:34:35 +00:00
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
4e6bf9e9fa Remove obsolete debuggerd32/debuggerd64 hack.
Bug: N/A
Test: builds
Change-Id: I159eea4e1c0d88e5e51184479ed020e7597390ba
2018-02-16 10:53:03 -08: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