OSDN Git Service

android-x86/bionic.git
10 years agoMerge "Add support for the ternary operator to the header scrubber."
Elliott Hughes [Thu, 21 Nov 2013 19:30:22 +0000 (19:30 +0000)]
Merge "Add support for the ternary operator to the header scrubber."

10 years agoAdd support for the ternary operator to the header scrubber.
Elliott Hughes [Thu, 21 Nov 2013 19:12:34 +0000 (11:12 -0800)]
Add support for the ternary operator to the header scrubber.

Used in various uapi headers.

Change-Id: Id0f862d2adc7ddc9727e8a29160d5435f8d547c3

10 years agoMerge "Fix useconds_t for LP64."
Elliott Hughes [Thu, 21 Nov 2013 17:05:04 +0000 (17:05 +0000)]
Merge "Fix useconds_t for LP64."

10 years agoMerge "Remove obsolete kernel/arch-mips headers."
Elliott Hughes [Thu, 21 Nov 2013 17:04:44 +0000 (17:04 +0000)]
Merge "Remove obsolete kernel/arch-mips headers."

10 years agoMerge "Remove the unused arch-x86 and arch-x86-64 kernel headers."
Elliott Hughes [Thu, 21 Nov 2013 17:04:24 +0000 (17:04 +0000)]
Merge "Remove the unused arch-x86 and arch-x86-64 kernel headers."

10 years agoFix useconds_t for LP64.
Elliott Hughes [Thu, 21 Nov 2013 16:55:46 +0000 (08:55 -0800)]
Fix useconds_t for LP64.

Change-Id: I869e60484999c1feda3dcdb86bee5b5373e6b3df

10 years agoRemove obsolete kernel/arch-mips headers.
Elliott Hughes [Thu, 21 Nov 2013 02:09:34 +0000 (18:09 -0800)]
Remove obsolete kernel/arch-mips headers.

Bug: 11559337
Change-Id: I70e205ff1f5acd07fddd7d82367e818b13847acd

10 years agoMerge "Switch to upstream sleep(3) and usleep(3)."
Elliott Hughes [Thu, 21 Nov 2013 00:41:30 +0000 (00:41 +0000)]
Merge "Switch to upstream sleep(3) and usleep(3)."

10 years agoSwitch to upstream sleep(3) and usleep(3).
Elliott Hughes [Thu, 21 Nov 2013 00:09:06 +0000 (16:09 -0800)]
Switch to upstream sleep(3) and usleep(3).

Also fix the signature of usleep, and the definition of useconds_t which
should be unsigned, as the 'u' in its name implies.

This patch also cleans up the existing FreeBSD hacks by moving the libm
stuff from <sys/cdefs.h> to a libm-private header, and adding comments
about the hacks we use to build FreeBSD source.

Change-Id: Ibe5067a380502df94a0a3a7901969b35411085b6

10 years agoMerge "Fix <signal.h> for mips uapi."
Elliott Hughes [Wed, 20 Nov 2013 20:54:03 +0000 (20:54 +0000)]
Merge "Fix <signal.h> for mips uapi."

10 years agoFix <signal.h> for mips uapi.
Elliott Hughes [Wed, 20 Nov 2013 20:51:52 +0000 (12:51 -0800)]
Fix <signal.h> for mips uapi.

Bug: 11559337
Change-Id: I4c6080f162d74ee78c81d698c7b50470b0e09586

10 years agoMerge "Clean up pthread_internal_t."
Elliott Hughes [Wed, 20 Nov 2013 01:23:33 +0000 (01:23 +0000)]
Merge "Clean up pthread_internal_t."

10 years agoClean up pthread_internal_t.
Elliott Hughes [Wed, 20 Nov 2013 00:52:24 +0000 (16:52 -0800)]
Clean up pthread_internal_t.

Bug: 11755300
Change-Id: Ib509e8c5ec6b23513aa78b5ac5141d7c34ce2dc8

10 years agoRemove the unused arch-x86 and arch-x86-64 kernel headers.
Elliott Hughes [Wed, 20 Nov 2013 00:56:55 +0000 (16:56 -0800)]
Remove the unused arch-x86 and arch-x86-64 kernel headers.

x86-64 already used uapi headers, and x86 can too now.

Bug: 11559337
Change-Id: I1196d2500f06ad40f2488b96fc8ccc7e02c7d5c0

10 years agoMerge "Add .cfi_startproc/.cfi_endproc to ENTRY/END."
Christopher Ferris [Wed, 20 Nov 2013 00:45:24 +0000 (00:45 +0000)]
Merge "Add .cfi_startproc/.cfi_endproc to ENTRY/END."

10 years agoAdd .cfi_startproc/.cfi_endproc to ENTRY/END.
Christopher Ferris [Tue, 19 Nov 2013 21:45:27 +0000 (13:45 -0800)]
Add .cfi_startproc/.cfi_endproc to ENTRY/END.

Bug: 10414953
Change-Id: I711718098b9f3cc0ba8277778df64557e9c7b2a0

10 years agoMerge "Provide <sys/user.h>."
Elliott Hughes [Wed, 20 Nov 2013 00:21:29 +0000 (00:21 +0000)]
Merge "Provide <sys/user.h>."

10 years agoProvide <sys/user.h>.
Elliott Hughes [Tue, 19 Nov 2013 23:32:31 +0000 (15:32 -0800)]
Provide <sys/user.h>.

strace wants this, for example.

Change-Id: Icb4d64bde392abbc091fa3375a4fa19b2707b12c

10 years agoMerge "Clean up forking and cloning."
Elliott Hughes [Tue, 19 Nov 2013 22:09:53 +0000 (22:09 +0000)]
Merge "Clean up forking and cloning."

10 years agoClean up forking and cloning.
Elliott Hughes [Tue, 19 Nov 2013 21:31:58 +0000 (13:31 -0800)]
Clean up forking and cloning.

The kernel now maintains the pthread_internal_t::tid field for us,
and __clone was only used in one place so let's inline it so we don't
have to leave such a dangerous function lying around. Also rename
files to match their content and remove some useless #includes.

Change-Id: I24299fb4a940e394de75f864ee36fdabbd9438f9

10 years agoMerge "Add test case for 1^NaN"
Narayan Kamath [Tue, 19 Nov 2013 09:56:53 +0000 (09:56 +0000)]
Merge "Add test case for 1^NaN"

10 years agoMerge "bionic: call stdio cleanup on exit"
Elliott Hughes [Tue, 19 Nov 2013 04:01:54 +0000 (04:01 +0000)]
Merge "bionic: call stdio cleanup on exit"

10 years agoMerge "Fix pthread_join."
Elliott Hughes [Tue, 19 Nov 2013 03:48:59 +0000 (03:48 +0000)]
Merge "Fix pthread_join."

10 years agoFix pthread_join.
Elliott Hughes [Sat, 16 Nov 2013 01:40:18 +0000 (17:40 -0800)]
Fix pthread_join.

Let the kernel keep pthread_internal_t::tid updated, including
across forks and for the main thread. This then lets us fix
pthread_join to only return after the thread has really exited.

Also fix the thread attributes of the main thread so we don't
unmap the main thread's stack (which is really owned by the
dynamic linker and contains things like environment variables),
which fixes crashes when joining with an exited main thread
and also fixes problems reported publicly with accessing environment
variables after the main thread exits (for which I've added a new
unit test).

In passing I also fixed a bug where if the clone(2) inside
pthread_create(3) fails, we'd unmap the child's stack and TLS (which
contains the mutex) and then try to unlock the mutex. Boom! It wasn't
until after I'd uploaded the fix for this that I came across a new
public bug reporting this exact failure.

Bug: 8206355
Bug: 11693195
Bug: https://code.google.com/p/android/issues/detail?id=57421
Bug: https://code.google.com/p/android/issues/detail?id=62392
Change-Id: I2af9cf6e8ae510a67256ad93cad891794ed0580b

10 years agobionic: call stdio cleanup on exit
Pawit Pornkitprasan [Thu, 14 Nov 2013 16:50:45 +0000 (23:50 +0700)]
bionic: call stdio cleanup on exit

As of 61e699a133a4807fe878a6cb0d7190d7c96e21f8, stdio clean up
functions are no longer registered in atexit and must be called
manually via __cleanup.

The issue this fixes is some static binaries linked against bionic
cannot output properly when piped or redirected because the buffer
is not flushed before closing.

This is done by pulling in exit.c (and other dependencies) from
netbsd.

Change-Id: I193e54a6d08900f291550029fe75ce76394d9e22

10 years agoMerge "Pull in cleaned version.h header."
Christopher Ferris [Mon, 18 Nov 2013 23:26:59 +0000 (23:26 +0000)]
Merge "Pull in cleaned version.h header."

10 years agoMerge "Modify tests for another glibc difference."
Christopher Ferris [Mon, 18 Nov 2013 21:35:20 +0000 (21:35 +0000)]
Merge "Modify tests for another glibc difference."

10 years agoAdd test case for 1^NaN
Narayan Kamath [Mon, 18 Nov 2013 18:47:48 +0000 (18:47 +0000)]
Add test case for 1^NaN

Should be 1.

Change-Id: I6cf723a419f51d3bda58286a538774b71276c7b5

10 years agoPull in cleaned version.h header.
Christopher Ferris [Sat, 16 Nov 2013 00:29:28 +0000 (16:29 -0800)]
Pull in cleaned version.h header.

Change-Id: Ia917af9336b63ed5a10147770a8110134cb274cb

10 years agoModify tests for another glibc difference.
Christopher Ferris [Fri, 15 Nov 2013 23:16:01 +0000 (15:16 -0800)]
Modify tests for another glibc difference.

It turns out that when passing a closed file to getdelim or getline, the
functions in glibc will properly return a failure, but errno might not be
set. Skip the errno check except on bionic.

Change-Id: I8d625f15303d4c2d42e8d28491ea8a368aea4d32

10 years agoMerge "Clean up the pthread_create trampoline."
Elliott Hughes [Fri, 15 Nov 2013 23:27:36 +0000 (23:27 +0000)]
Merge "Clean up the pthread_create trampoline."

10 years agoClean up the pthread_create trampoline.
Elliott Hughes [Fri, 15 Nov 2013 22:57:45 +0000 (14:57 -0800)]
Clean up the pthread_create trampoline.

Bug: 8206355
Bug: 11693195
Change-Id: I35cc024d5b6ebd19d1d2e45610db185addaf45df

10 years agoMerge "Add new tests for memory/string routines."
Christopher Ferris [Fri, 15 Nov 2013 22:47:07 +0000 (22:47 +0000)]
Merge "Add new tests for memory/string routines."

10 years agoMerge "Switch pthread_create over to __bionic_clone."
Elliott Hughes [Fri, 15 Nov 2013 22:42:56 +0000 (22:42 +0000)]
Merge "Switch pthread_create over to __bionic_clone."

10 years agoSwitch pthread_create over to __bionic_clone.
Elliott Hughes [Fri, 15 Nov 2013 19:51:07 +0000 (11:51 -0800)]
Switch pthread_create over to __bionic_clone.

Bug: 8206355
Bug: 11693195
Change-Id: I04aadbc36c87e1b7e33324b9a930a1e441fbfed6

10 years agoAdd new tests for memory/string routines.
Christopher Ferris [Thu, 7 Nov 2013 01:32:11 +0000 (17:32 -0800)]
Add new tests for memory/string routines.

Create a few generic testing functions to allow any memory/string tests
to be created.

Add alignment tests for memcpy/memset/strcat/strcpy/strlen.

Add an overread test for memcpy/strcat/strcpy/strlen. This test attempts
to verify that the functions do not read past the end of their buffers
(src buffer in the case of src/dst functions).

Bug: 9797008

Change-Id: Ib3223ca1b99e729ae8229adc2d03f4dc3103d97c

10 years agoMerge "[MIPS] Reimplement syscall to invoke the system call directly"
Elliott Hughes [Fri, 15 Nov 2013 01:01:06 +0000 (01:01 +0000)]
Merge "[MIPS] Reimplement syscall to invoke the system call directly"

10 years ago[MIPS] Reimplement syscall to invoke the system call directly
Chris Dearman [Wed, 13 Nov 2013 22:15:31 +0000 (14:15 -0800)]
[MIPS] Reimplement syscall to invoke the system call directly

Some MIPS kernels do not correctly restart interrupted system calls that
have been invoked using the indirect syscall (NR_syscall).

The simplest workaround is to handle the indirection in userland and then
call the required system call directly.

Change-Id: I8385399621529db9a52b463c96925f6decaaca30

10 years agoMerge "Remove the mips regdef.h and fpregdef.h old kernel headers."
Elliott Hughes [Thu, 14 Nov 2013 00:18:58 +0000 (00:18 +0000)]
Merge "Remove the mips regdef.h and fpregdef.h old kernel headers."

10 years agoRemove the mips regdef.h and fpregdef.h old kernel headers.
Elliott Hughes [Thu, 14 Nov 2013 00:13:01 +0000 (16:13 -0800)]
Remove the mips regdef.h and fpregdef.h old kernel headers.

Bug: 11559337
Change-Id: I6352cac9c4ef425cb21e34d0299223711ec079af

10 years agoMerge "Add unit tests for pow's behavior with NaNs."
Elliott Hughes [Wed, 13 Nov 2013 22:57:36 +0000 (22:57 +0000)]
Merge "Add unit tests for pow's behavior with NaNs."

10 years agoAdd unit tests for pow's behavior with NaNs.
Elliott Hughes [Wed, 13 Nov 2013 21:29:23 +0000 (13:29 -0800)]
Add unit tests for pow's behavior with NaNs.

Bug: 11669804
Change-Id: Idfa6527640c8d0c2cf3e5343bf7afe013e237545

10 years agoMerge "Add a unit test for syscall(2)."
Elliott Hughes [Wed, 13 Nov 2013 21:29:05 +0000 (21:29 +0000)]
Merge "Add a unit test for syscall(2)."

10 years agoAdd a unit test for syscall(2).
Elliott Hughes [Wed, 13 Nov 2013 21:14:31 +0000 (13:14 -0800)]
Add a unit test for syscall(2).

Change-Id: Ic7d9735d46711af93c3a1747de7b2eb8cebea094

10 years agoMerge "Add extra regression tests for an already-fixed dynamic linker bug."
Elliott Hughes [Tue, 12 Nov 2013 01:01:24 +0000 (01:01 +0000)]
Merge "Add extra regression tests for an already-fixed dynamic linker bug."

10 years agoAdd extra regression tests for an already-fixed dynamic linker bug.
Elliott Hughes [Mon, 11 Nov 2013 23:48:06 +0000 (15:48 -0800)]
Add extra regression tests for an already-fixed dynamic linker bug.

Bug: https://code.google.com/p/android/issues/detail?id=61799
Change-Id: I84af68f8430a06e999297c2e57e06ecb45adf81e

10 years agoMerge "Add a temporary uapi/linux/compiler.h until upstream has one."
Elliott Hughes [Fri, 8 Nov 2013 23:20:18 +0000 (23:20 +0000)]
Merge "Add a temporary uapi/linux/compiler.h until upstream has one."

10 years agoAdd a temporary uapi/linux/compiler.h until upstream has one.
Elliott Hughes [Fri, 8 Nov 2013 23:13:54 +0000 (15:13 -0800)]
Add a temporary uapi/linux/compiler.h until upstream has one.

Bug: 11559337
Change-Id: I205974b1a26e4f85d0e11503afa80669195d211c

10 years agoMerge "Remove the dependency on the non-uapi __kernel_nlink_t."
Elliott Hughes [Fri, 8 Nov 2013 23:12:35 +0000 (23:12 +0000)]
Merge "Remove the dependency on the non-uapi __kernel_nlink_t."

10 years agoRemove the dependency on the non-uapi __kernel_nlink_t.
Elliott Hughes [Fri, 8 Nov 2013 22:38:12 +0000 (14:38 -0800)]
Remove the dependency on the non-uapi __kernel_nlink_t.

The kernel doesn't have an nlink_t; it just uses the equivalent of
uint32_t. We already had a usable __nlink_t in the C library, so
let's just define our nlink_t in terms of __nlink_t, which is what
__nlink_t was meant for anyway.

Note that our struct stat just follows the kernel, and doesn't refer
to nlink_t anyway.

Change-Id: I2a56e418e42404b1741b08c50554b03c11caebae

10 years agoMerge "Generate the uapi headers for mips and x86/x86_64."
Elliott Hughes [Fri, 8 Nov 2013 22:18:46 +0000 (22:18 +0000)]
Merge "Generate the uapi headers for mips and x86/x86_64."

10 years agoGenerate the uapi headers for mips and x86/x86_64.
Elliott Hughes [Fri, 8 Nov 2013 19:45:48 +0000 (11:45 -0800)]
Generate the uapi headers for mips and x86/x86_64.

Bug: 11559337
Change-Id: I23b1a43e7bfa8fa6f9df7e59d2e731a0ec52dafc

10 years agoMerge "Prepare to switch to the uapi <linux/signal.h>."
Elliott Hughes [Thu, 7 Nov 2013 20:41:19 +0000 (20:41 +0000)]
Merge "Prepare to switch to the uapi <linux/signal.h>."

10 years agoPrepare to switch to the uapi <linux/signal.h>.
Elliott Hughes [Thu, 7 Nov 2013 20:28:46 +0000 (12:28 -0800)]
Prepare to switch to the uapi <linux/signal.h>.

<time.h> didn't need to copy the cruft from <signal.h>, and
<signal.h> only needs the uid_t hack when it's not using
uapi headers.

pthread_exit.cpp should include what it uses.

Change-Id: I836c36abe0f0a781d41fc425b249d1c7686bb124

10 years agoMerge "Stop using the non-uapi <linux/err.h> header file."
Elliott Hughes [Thu, 7 Nov 2013 18:44:49 +0000 (18:44 +0000)]
Merge "Stop using the non-uapi <linux/err.h> header file."

10 years agoStop using the non-uapi <linux/err.h> header file.
Elliott Hughes [Thu, 7 Nov 2013 18:31:05 +0000 (10:31 -0800)]
Stop using the non-uapi <linux/err.h> header file.

We only need it for MAX_ERRNO, and it's time we had somewhere to put
the little assembler utility macros we've been putting off writing.

Change-Id: I9354d2e0dc47c689296a34b5b229fc9ba75f1a83

10 years agoMerge "Remove pathconf's dependencies on non-uapi header files."
Elliott Hughes [Thu, 7 Nov 2013 01:32:27 +0000 (01:32 +0000)]
Merge "Remove pathconf's dependencies on non-uapi header files."

10 years agoRemove pathconf's dependencies on non-uapi header files.
Elliott Hughes [Thu, 7 Nov 2013 01:21:09 +0000 (17:21 -0800)]
Remove pathconf's dependencies on non-uapi header files.

Change-Id: I597996e4b141b009916f7ad2866dd100e08aa4d3

10 years agoMerge "Fix a TODO; we've had SOCK_CLOEXEC for a while now."
Elliott Hughes [Thu, 7 Nov 2013 01:16:47 +0000 (01:16 +0000)]
Merge "Fix a TODO; we've had SOCK_CLOEXEC for a while now."

10 years agoFix a TODO; we've had SOCK_CLOEXEC for a while now.
Elliott Hughes [Thu, 7 Nov 2013 01:04:56 +0000 (17:04 -0800)]
Fix a TODO; we've had SOCK_CLOEXEC for a while now.

Change-Id: I4bc39b57f3c33441ead74127f576bf5a4e311566

10 years agoMerge "Clean up the 32-bit kernel support, fix LP64 fcntl declaration."
Elliott Hughes [Thu, 7 Nov 2013 01:02:54 +0000 (01:02 +0000)]
Merge "Clean up the 32-bit kernel support, fix LP64 fcntl declaration."

10 years agoClean up the 32-bit kernel support, fix LP64 fcntl declaration.
Elliott Hughes [Thu, 7 Nov 2013 00:20:54 +0000 (16:20 -0800)]
Clean up the 32-bit kernel support, fix LP64 fcntl declaration.

In practice, thanks to all the registers the stubs don't actually change,
but it's confusing to have an incorrect declaration.

I suspect that fcntl remains broken for aarch64; it happens to work for
x86_64 because the first vararg argument gets placed in the right register
anyway, but I have no reason to believe that's true for aarch64.

This patch adds a unit test, though, so we'll be able to tell when we get
as far as running the unit tests.

Change-Id: I58dd0054fe99d7d51d04c22781d8965dff1afbf3

10 years agoMerge "Add processed uapi kernel headers for ARM."
Ben Cheng [Wed, 6 Nov 2013 23:55:25 +0000 (23:55 +0000)]
Merge "Add processed uapi kernel headers for ARM."

10 years agoAdd processed uapi kernel headers for ARM.
Ben Cheng [Wed, 6 Nov 2013 23:51:05 +0000 (15:51 -0800)]
Add processed uapi kernel headers for ARM.

Change-Id: Id34de841b7b4b5a1bf7d22eb793860f92f24a6e5

10 years agoMerge "Fix pread/pwrite for LP64."
Elliott Hughes [Wed, 6 Nov 2013 22:25:17 +0000 (22:25 +0000)]
Merge "Fix pread/pwrite for LP64."

10 years agoFix pread/pwrite for LP64.
Elliott Hughes [Wed, 6 Nov 2013 21:10:37 +0000 (13:10 -0800)]
Fix pread/pwrite for LP64.

Unlike on 32-bit systems where off_t is 32-bit, we don't want to
throw away the top 32 bits of an LP64 system's 64-bit off_t.

Change-Id: Ib2e0daeb4fc0b8ab3d1b983d0b371d8f81033b50

10 years agoMerge "Make cpp.py less braindead."
Elliott Hughes [Wed, 6 Nov 2013 20:31:09 +0000 (20:31 +0000)]
Merge "Make cpp.py less braindead."

10 years agoMake cpp.py less braindead.
Elliott Hughes [Tue, 5 Nov 2013 22:54:29 +0000 (14:54 -0800)]
Make cpp.py less braindead.

The old code ignored operator precedence (!), despite having two tables
of operator precedence. The code's still pretty awful, but I've cleaned
it up enough to fix this, the most important bug.

This patch lets us correctly clean the uapi unistd.h, stat.h, and swab.h files,
and also fixes the mess we were already making of various old kernel
header files. I've added a bunch more tests, fixed the existing tests that
the existing script was already failing (!), and changed the script so that
the tests are run every time the script is run.

We can probably remove some of the old kernel header files that we were
parsing incorrectly, but we can worry about that later.

Bug: 11253477
Change-Id: Ie66c65b3a7ae13b4e98ed8038a6a534f06eae0e5

10 years agoMerge "Fix <sys/select.h> for LP64, clean up <time.h>."
Elliott Hughes [Tue, 5 Nov 2013 21:54:38 +0000 (21:54 +0000)]
Merge "Fix <sys/select.h> for LP64, clean up <time.h>."

10 years agoFix <sys/select.h> for LP64, clean up <time.h>.
Elliott Hughes [Tue, 5 Nov 2013 21:28:36 +0000 (13:28 -0800)]
Fix <sys/select.h> for LP64, clean up <time.h>.

The 64-bit uapi headers don't define FD_CLR and friends, so this
patch updates libc/kernel/common/linux/time.h after the change
b934bbec145e9e084bf48149a3a94ae3dd132157 in external/kernel-headers,
then fixes <sys/select.h> to work in this new world, and removes
some now-unnecessary duplication from <time.h> (with other cruft
cleaned up while I'm here).

Change-Id: Ifd26f901b4d200c65065b3e6ef1b74055127e052

10 years agoMerge "Remove unnecessary #include."
Elliott Hughes [Tue, 5 Nov 2013 20:00:29 +0000 (20:00 +0000)]
Merge "Remove unnecessary #include."

10 years agoRemove unnecessary #include.
Elliott Hughes [Tue, 5 Nov 2013 19:59:06 +0000 (11:59 -0800)]
Remove unnecessary #include.

Change-Id: I99dade0b3803272ee29eba2ad36b0311f8a24c31

10 years agoMerge "Refresh libc/kernel/common/linux/uinput.h"
Elliott Hughes [Thu, 31 Oct 2013 23:03:15 +0000 (23:03 +0000)]
Merge "Refresh libc/kernel/common/linux/uinput.h"

10 years agoRefresh libc/kernel/common/linux/uinput.h
Scott Anderson [Fri, 25 Oct 2013 22:04:49 +0000 (15:04 -0700)]
Refresh libc/kernel/common/linux/uinput.h

Change-Id: Icd830af5aee63276554ebf7bfe8192965209cc59
Signed-off-by: Scott Anderson <saa@google.com>
10 years agoMerge "Fix linker crashes during unknown symbol lookup"
Elliott Hughes [Thu, 31 Oct 2013 22:06:59 +0000 (22:06 +0000)]
Merge "Fix linker crashes during unknown symbol lookup"

10 years agoFix linker crashes during unknown symbol lookup
Sergey Melnikov [Thu, 31 Oct 2013 14:02:12 +0000 (18:02 +0400)]
Fix linker crashes during unknown symbol lookup

Integration of kernel VDSO into internal bionic data structures using
common functions.
Fix for dl_iterate_phdr function: the function provides incorrect
address of object in case of nonzero virtual and base addresses.
Location in address space of a particular program header should be
calculated using the formula:  addr = base_addr + virtual_addr.

Signed-off-by: Sergey Melnikov <sergey.melnikov@intel.com>
Change-Id: Ie2ab4257fd456242aab8afed0bd5bd6b29e81d6d

10 years agoMerge "Move the pthread debugging flags to the right place."
Elliott Hughes [Thu, 31 Oct 2013 21:23:29 +0000 (21:23 +0000)]
Merge "Move the pthread debugging flags to the right place."

10 years agoMove the pthread debugging flags to the right place.
Elliott Hughes [Thu, 31 Oct 2013 21:09:39 +0000 (14:09 -0700)]
Move the pthread debugging flags to the right place.

Change-Id: Ie805bd837d1f72cdf1818e056c0baeb0857e4e84

10 years agoMerge "<pthread.h> fixes and pthread cleanup."
Elliott Hughes [Thu, 31 Oct 2013 20:36:48 +0000 (20:36 +0000)]
Merge "<pthread.h> fixes and pthread cleanup."

10 years ago<pthread.h> fixes and pthread cleanup.
Elliott Hughes [Wed, 30 Oct 2013 21:40:09 +0000 (14:40 -0700)]
<pthread.h> fixes and pthread cleanup.

<pthread.h> was missing nonnull attributes, noreturn on pthread_exit,
and had incorrect cv qualifiers for several standard functions.

I've also marked the non-standard stuff (where I count glibc rather
than POSIX as "standard") so we can revisit this cruft for LP64 and
try to ensure we're compatible with glibc.

I've also broken out the pthread_cond* functions into a new file.

I've made the remaining pthread files (plus ptrace) part of the bionic code
and fixed all the warnings.

I've added a few more smoke tests for chunks of untested pthread functionality.

We no longer need the libc_static_common_src_files hack for any of the
pthread implementation because we long since stripped out the rest of
the armv5 support, and this hack was just to ensure that __get_tls in libc.a
went via the kernel if necessary.

This patch also finishes the job of breaking up the pthread.c monolith, and
adds a handful of new tests.

Change-Id: Idc0ae7f5d8aa65989598acd4c01a874fe21582c7

10 years agoMerge "Remove an obsolete ARM gdb hack."
Elliott Hughes [Wed, 30 Oct 2013 21:37:56 +0000 (21:37 +0000)]
Merge "Remove an obsolete ARM gdb hack."

10 years agoRemove an obsolete ARM gdb hack.
Elliott Hughes [Wed, 30 Oct 2013 21:32:42 +0000 (14:32 -0700)]
Remove an obsolete ARM gdb hack.

Experiment shows that the claim in the makefile was false: gdb works fine
setting breakpoints in these functions when compiled without special treatment.

Change-Id: Ibdf4dd5a14d171c954b8c2089daaf28e1c310be9

10 years agoMerge "Factor out some of the makefile cruft."
Elliott Hughes [Wed, 30 Oct 2013 02:13:34 +0000 (02:13 +0000)]
Merge "Factor out some of the makefile cruft."

10 years agoFactor out some of the makefile cruft.
Elliott Hughes [Tue, 29 Oct 2013 23:59:54 +0000 (16:59 -0700)]
Factor out some of the makefile cruft.

I really don't want to add yet another copy for aarch64.

Also sort arm, mips, and x86.

Also silence the "TARGET_ARCH_VARIANT" warning for non-ARM; Intel and MIPS
have both complained about it.

Change-Id: I32c592a90c0cf0cdae250d84035b3e4655543781

10 years agoMerge "Explain the sigprocmask in pthread_exit."
Elliott Hughes [Tue, 29 Oct 2013 23:29:07 +0000 (23:29 +0000)]
Merge "Explain the sigprocmask in pthread_exit."

10 years agoExplain the sigprocmask in pthread_exit.
Elliott Hughes [Tue, 29 Oct 2013 23:11:06 +0000 (16:11 -0700)]
Explain the sigprocmask in pthread_exit.

Also remove the SIGSEGV special case, which was probably because
hand-written __exit_with_stack_teardown stubs used to try to cause
SIGSEGV if the exit system call returned (which it never does, so
that dead code disappeared).

Also move the sigprocmask into the only case where it's necessary ---
the one where we unmap the stack that would be used by a signal
handler.

Change-Id: Ie40d20c1ae2f5e7125131b6b492cba7a2c6d08e9

10 years agoMerge "Fix up failing glibc tests."
Christopher Ferris [Tue, 29 Oct 2013 22:32:33 +0000 (22:32 +0000)]
Merge "Fix up failing glibc tests."

10 years agoFix up failing glibc tests.
Christopher Ferris [Mon, 28 Oct 2013 22:24:04 +0000 (15:24 -0700)]
Fix up failing glibc tests.

There is a known bug running clone with the CLONE_VM flag, so for host
create an empty test.

Change the expected output of the stdio test for a glibc difference.

Change the pause test to use ScopedSignalHandler to setup/restore the SIGALRM
handler.

After this, running bionic-unit-tests-glibc passes for all tests.

Bug: 11389824

Change-Id: Ib304eae4164115835a54991dfdca5821ecc3db5e

10 years agoMerge "Update <sys/exec_elf.h> to include EM_AARCH64."
Elliott Hughes [Tue, 29 Oct 2013 15:50:33 +0000 (15:50 +0000)]
Merge "Update <sys/exec_elf.h> to include EM_AARCH64."

10 years agoUpdate <sys/exec_elf.h> to include EM_AARCH64.
Elliott Hughes [Tue, 29 Oct 2013 04:28:40 +0000 (21:28 -0700)]
Update <sys/exec_elf.h> to include EM_AARCH64.

Upstream added the constant for us.

Change-Id: I197e32d2e5b3fd499d069546ccfcc1d35d65e0a0

10 years agoMerge "AArch64: Add support for AArch64 to stdlib/strtod.c"
Elliott Hughes [Mon, 28 Oct 2013 23:25:27 +0000 (23:25 +0000)]
Merge "AArch64: Add support for AArch64 to stdlib/strtod.c"

10 years agoAArch64: Add support for AArch64 to stdlib/strtod.c
Serban Constantinescu [Tue, 8 Oct 2013 18:32:36 +0000 (19:32 +0100)]
AArch64: Add support for AArch64 to stdlib/strtod.c

This patch adds support for AArch64 to strtod.c definitions.

Change-Id: I9491c4371d921c00e73ae169877a9a71225731fb
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
10 years agoMerge "AArch64: Autogenerated syscalls for AArch64"
Elliott Hughes [Mon, 28 Oct 2013 23:19:46 +0000 (23:19 +0000)]
Merge "AArch64: Autogenerated syscalls for AArch64"

10 years agoAArch64: Autogenerated syscalls for AArch64
Serban Constantinescu [Thu, 10 Oct 2013 22:05:06 +0000 (23:05 +0100)]
AArch64: Autogenerated syscalls for AArch64

This patch adds AArch64 syscalls, autogenerated using:
        ./libc/tools/gensyscalls.py

Change-Id: I1cc60430423ecb52a35448bf2c358b82136b2f16
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
10 years agoMerge "AArch64: Add support for AArch64 to the syscall interface"
Elliott Hughes [Mon, 28 Oct 2013 23:17:23 +0000 (23:17 +0000)]
Merge "AArch64: Add support for AArch64 to the syscall interface"

10 years agoAArch64: Add support for AArch64 to the syscall interface
Serban Constantinescu [Mon, 7 Oct 2013 15:49:09 +0000 (16:49 +0100)]
AArch64: Add support for AArch64 to the syscall interface

This patch adds support for AArch64 to the syscall interface. The kernel
implementation exports a set of canonical syscalls, therefore some of
the userspace exported syscalls are implemented as stubs based on the
canonical set.

Change-Id: Ia965d71e97769b8be9d7655193fc40303964c4df
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
10 years agoMerge "Fix the *rand48 functions on LP64."
Elliott Hughes [Mon, 28 Oct 2013 23:09:49 +0000 (23:09 +0000)]
Merge "Fix the *rand48 functions on LP64."

10 years agoFix the *rand48 functions on LP64.
Elliott Hughes [Mon, 28 Oct 2013 22:24:26 +0000 (15:24 -0700)]
Fix the *rand48 functions on LP64.

I reported the mrand48 bug upstream, and 'matt' fixed the whole family
of functions!

Change-Id: I07fbc034e86499ce89599c3026a741738fd0cfc0

10 years agoMerge "Update <sys/exec_elf.h> to get the DF_* flags."
Elliott Hughes [Mon, 28 Oct 2013 22:03:54 +0000 (22:03 +0000)]
Merge "Update <sys/exec_elf.h> to get the DF_* flags."

10 years agoUpdate <sys/exec_elf.h> to get the DF_* flags.
Elliott Hughes [Mon, 28 Oct 2013 21:59:41 +0000 (14:59 -0700)]
Update <sys/exec_elf.h> to get the DF_* flags.

Change-Id: Ia9e785f6b95122f94ee3b01a312db1d5bb91a72e