Commit graph

8344 commits

Author SHA1 Message Date
Elliott Hughes
123172ae37 Merge "[MIPS] Fix atomic_is_lock_free test for mips32. On 32-bit MIPS, 64-bit atomic ops are achieved through locks. So allow the test to fail for atomic_intmax_t on 32-bit MIPS." 2014-07-23 22:55:49 +00:00
Raghu Gandham
f1837377d2 [MIPS] Fix atomic_is_lock_free test for mips32.
On 32-bit MIPS, 64-bit atomic ops are achieved through locks.
So allow the test to fail for atomic_intmax_t on 32-bit MIPS.

Change-Id: I78e7807e50f899a0fea0d5b388d9ebb53228aaa0
2014-07-24 16:11:52 -07:00
Dmitriy Ivanov
dbf52ec37b Merge "Fix global variable initialization for linker" 2014-07-24 20:55:36 +00:00
Dmitriy Ivanov
4151ea73b7 Fix global variable initialization for linker
Linker now calls init functions for itself.

Change-Id: Ibd099812493041ac70f591e3f379ee742b4683b8
2014-07-24 15:33:25 -07:00
Elliott Hughes
d6f614a4e1 Merge "Implement twalk(3), add unit tests." 2014-07-24 22:07:52 +00:00
Elliott Hughes
3e424d0a24 Implement twalk(3), add unit tests.
I've also added insque(3) and remque(3) (from NetBSD because the OpenBSD
ones are currently broken for non-circular lists).

I've not added the three hash table functions that should be in this header
because they operate on a single global hash table and thus aren't likely
to be useful.

Bug: https://code.google.com/p/android/issues/detail?id=73719
Change-Id: I97397a7b921e2e860fd9c8032cafd9097380498a
2014-07-24 14:55:29 -07:00
Duane Sand
bc5a3ec6df [MIPSR6] Use C-coded string ops on mips32r6/mips64r6
The existing assembler code uses deprecated lwl/lwr/swl/swr ops.
Replacing those with misalignment-forgiving lw/sw ops may
involve careful performance tuning.

Change-Id: I47a042f7b22b87d7d52e46c29c44b1db1ba8b693
2014-07-23 14:00:21 -07:00
Elliott Hughes
7d22a45196 Merge "[MIPSR6] setjmp supports mips32r6 and FP64A/FPXX reg models" 2014-07-23 18:45:08 +00:00
Duane Sand
dd37251c47 [MIPSR6] setjmp supports mips32r6 and FP64A/FPXX reg models
Save and restore floating point registers via 64-bit
load/stores when possible.  Use assembler's builtin macro
ops to generate pairs of 32-bit load/stores on Mips I cpus.

Some cpus or FR modes have only 16 even-numbered dp fp regs.
This is exposed by _MIPS_FPSET, defined by existing compilers.

Change-Id: I7f617a3ffea8da41c402ef3a68ab32c91d3d7622
2014-07-23 13:57:30 -07:00
Nick Kralevich
f965075749 Merge "debuggerd: if PR_GET_DUMPABLE=0, don't ask for dumping" 2014-07-23 18:51:55 +00:00
Nick Kralevich
be0e43b776 debuggerd: if PR_GET_DUMPABLE=0, don't ask for dumping
PR_GET_DUMPABLE is used by an application to indicate whether or
not core dumps / PTRACE_ATTACH should work.

Security sensitive applications often set PR_SET_DUMPABLE to 0 to
disable core dumps, to avoid leaking sensitive memory to persistent
storage. Similarly, they also set PR_SET_DUMPABLE to zero to prevent
PTRACE_ATTACH from working, again to avoid leaking the contents
of sensitive memory.

Honor PR_GET_DUMPABLE when connecting to debuggerd. If an application
has said it doesn't want its memory dumped, then we shouldn't
ask debuggerd to dump memory on its behalf.

FORTIFY_SOURCE tests: Modify the fortify_source tests to set
PR_SET_DUMPABLE=0. This reduces the total runtime of
/data/nativetest/bionic-unit-tests/bionic-unit-tests32 from approx
53 seconds to 25 seconds. There's no need to connect to debuggerd
when running these tests.

Bug: 16513137
Change-Id: Idc7857b089f3545758f4d9b436b783d580fb653f
2014-07-23 15:48:49 -07:00
Elliott Hughes
f9bfc2ff8e Merge "Fix belated review comments on syslog change." 2014-07-23 18:45:08 +00:00
Elliott Hughes
afe6360627 Fix belated review comments on syslog change.
Bug: 14292866
Change-Id: I3cd92084cb55b5673f6ba62d51952941b79deb51
2014-07-23 11:38:38 -07:00
Dmitriy Ivanov
337c0cefdc Merge "Fix 'adb shell /system/bin/linker' crash" 2014-07-23 17:53:27 +00:00
Dmitriy Ivanov
efe13832dc Fix 'adb shell /system/bin/linker' crash
Bug: https://code.google.com/p/android/issues/detail?id=63174
Change-Id: I072290ea11109c07f277ad3dec7f44fcb7bf6aa6
2014-07-28 16:29:52 -07:00
Elliott Hughes
8a2ecf868f Merge "syscall(3)'s return type should be long." 2014-07-24 20:55:36 +00:00
Elliott Hughes
21972b61ec syscall(3)'s return type should be long.
This doesn't require us to change any of the syscall implementations
because (a) the LP32 ones have sizeof(int) == sizeof(long) anyway,
which is how we never noticed this bug before and (b) the LP64 ones
all use a 64-bit register for the result (and for the syscall number
too).

Bug: https://code.google.com/p/android/issues/detail?id=73952
Change-Id: I9866c3579a7a94de27bfbe80ad7a822c3183c7fb
2014-07-28 12:33:07 -07:00
Elliott Hughes
1a918d9be8 Merge "Remove localtime_tz and strftime_tz." 2014-07-24 20:55:36 +00:00
Elliott Hughes
39d903aea9 Remove localtime_tz and strftime_tz.
This also brings our copy of strftime.c much closer to upstream, though
we still have several GNU extensions and hacks to deal with Android32's
broken time_t.

Bug: 15765976
Change-Id: Ic9ef36e8acd3619504ecc4d73feec2b61fd4dfa1
2014-07-25 15:50:31 -07:00
Elliott Hughes
8c66fd798e Merge "Use vsnprintf(3) in syslog(3)." 2014-07-24 20:55:36 +00:00
Elliott Hughes
f1e83cc34a Use vsnprintf(3) in syslog(3).
It seemed like a clever trick to use the internal log message formatting
code in syslog(3), but on reflection that means you can't (for example)
format floating point numbers. This patch switches us over to using good
old vsnprintf(3), even though that requires us to jump through a few hoops.

There's no obvious way to unit test this, so I wrote a little program and
ran that.

(cherry-pick of b1b60c30bf321c0fc02264b953b5c16c49d34457.)

Bug: 14292866
Change-Id: I9c83500ba9cbb209b6f496067a91bf69434eeef5
2014-07-28 09:43:21 -07:00
Elliott Hughes
8dbe3f0f51 Merge "[MIPS] Drop soft-fp targets" 2014-07-23 17:53:27 +00:00
Duane Sand
ba23bd0a40 [MIPS] Drop soft-fp targets
Change-Id: I583bf8242d3034ebfc48548499cdb3316094c8e3
2014-07-24 18:04:21 +00:00
Elliott Hughes
467e49be70 Merge "Fix generate-NOTICE to cope better with BSD __COPYRIGHT macros." 2014-07-22 16:35:00 +00:00
Elliott Hughes
5d2f86f363 Fix generate-NOTICE to cope better with BSD __COPYRIGHT macros.
Change-Id: I99f9d2e0a28342663cec6aed483e1a23c12e5e87
2014-07-23 11:10:48 -07:00
Elliott Hughes
ea42a6caea Merge "Fix a couple of bugs in generate-NOTICE and regenerate the NOTICE files." 2014-07-22 16:25:43 +00:00
Elliott Hughes
3758a244cf Fix a couple of bugs in generate-NOTICE and regenerate the NOTICE files.
Change-Id: Id6fcb74292e661504d0758bfce24abdc18cb8d32
2014-07-22 21:29:00 -07:00
Elliott Hughes
e26ac7f776 Merge "Remove the unused swab.S." 2014-07-22 21:56:40 +00:00
Elliott Hughes
ca70453e84 Remove the unused swab.S.
Change-Id: Id30eac5a21b649d6a039a0d7ca0496177fbfb571
2014-07-22 20:21:31 -07:00
Elliott Hughes
79b5a39617 Merge "[MIPS] Allow united mipsel and mips64el gcc toolchain" 2014-07-22 16:35:00 +00:00
Duane Sand
f541650828 [MIPS] Allow united mipsel and mips64el gcc toolchain
Explicitly tell 32-bit links that they are doing 32-bit links.
This is needed when using united 32-bit and 64-bit toolchains.
This is harmless when using older separate 32-only toolchains.

Change-Id: I70cbd3f5867e59b1f6f829793444242fb0894aa6
2014-07-22 14:27:48 -07:00
Elliott Hughes
0f7d882bb7 Switch to OpenBSD res_random.
Change-Id: Ia971d647832893e9bb4601697132a105524d2f96
2014-07-21 15:31:53 -07:00
Elliott Hughes
4d421901e5 Merge "Use upstream OpenBSD's arc4random." 2014-07-21 15:45:37 +00:00
Elliott Hughes
2b67d7dee0 Use upstream OpenBSD's arc4random.
The getentropy_linux.c is lightly modified to build on Android, but we're now
completely in sync with upstream OpenBSD's arc4random implementation.

Change-Id: If32229fc28aba908035fb38703190d41ddcabc95
2014-07-21 14:38:16 -07:00
Elliott Hughes
925d388e24 Merge "Rewrite syslog(3) to use Android logging." 2014-07-19 23:20:08 +00:00
Elliott Hughes
3ad8ecb64e Rewrite syslog(3) to use Android logging.
Since we don't have syslogd on Android and you can't run one on a non-rooted
device, it's more useful if syslog output just goes to the regular Android
logging system.

Bug: 14292866
Change-Id: Icee7f088b97f88ccbdaf471b98cbac7f19f9210a
2014-07-21 16:56:48 -07:00
Dan Albert
b828eaeb45 Merge "There is no _MIN for unsigned types." 2014-07-21 15:45:37 +00:00
Dan Albert
ee7f1b5946 There is no _MIN for unsigned types.
Change-Id: I49c38e51197b750210bdbf28c9cf6db30452a206
2014-07-21 17:16:30 -07:00
Dan Albert
1fb90a8aa0 Merge "Fix mbsrtowcs(3)'s handling of len parameter." 2014-07-17 22:34:19 +00:00
Dan Albert
6b55ba54ef Fix mbsrtowcs(3)'s handling of len parameter.
The len parameter is a _maximum_ length. The previous code was treating
it as an exact length, causing the following typical call to fail:

    mbsrtowcs(out, &in, sizeof(out), state); // sizeof(out) > strlen(in)

Change-Id: I48e474fd54ea5f122bc168a4d74bfe08704f28cc
2014-07-21 11:45:48 -07:00
Dan Albert
e9731387f4 Merge "__libc_fatal should print a newline to stderr." 2014-07-18 22:17:02 +00:00
Dan Albert
97e31dedf0 __libc_fatal should print a newline to stderr.
Change-Id: I088dc880d7488a65beac8cda95f530f3db41f112
2014-07-21 11:10:00 -07:00
Elliott Hughes
7dd126a38c Merge "Clean up some misinformation around prctl." 2014-07-17 22:33:54 +00:00
Elliott Hughes
9c07aee83b Clean up some misinformation around prctl.
prctl shouldn't be in <unistd.h>.

Change-Id: I29609fc91c033e1ad143b75d9b4eb17aefbd63d6
2014-07-18 16:15:32 -07:00
Christopher Ferris
3c2b71ad56 Merge "Use the mmap/munmap for allocation routines." 2014-07-17 22:33:54 +00:00
Christopher Ferris
6425327c32 Use the mmap/munmap for allocation routines.
To avoid any issues calling malloc related routines, use mmap/munmap.
Specifically, this avoids any problems when this is compiled into a
malloc debug shared library.

Change-Id: Iae2d197145da43dc103ad6024357d8cc2374378f
2014-07-18 14:16:51 -07:00
Elliott Hughes
d18b87f38d Merge "Remove SIOCKILLADDR from <sys/socket.h>." 2014-07-17 22:33:42 +00:00
Elliott Hughes
8a3d1ca183 Remove SIOCKILLADDR from <sys/socket.h>.
Change-Id: I6b64a9abe01c786a9ec26aee1517cb981a4860fb
2014-07-17 17:10:02 -07:00
Elliott Hughes
76282482db Merge "Remove PR_SET_TIMERSLACK_PID from <sys/prctl.h>." 2014-07-17 22:33:42 +00:00
Elliott Hughes
9f165d24f0 Remove PR_SET_TIMERSLACK_PID from <sys/prctl.h>.
Change-Id: Ie70f23c80e8473ac9617b74967d7c84709f5b00d
2014-07-17 17:12:35 -07:00