Commit graph

1655 commits

Author SHA1 Message Date
Elliott Hughes
a985076bfe Fix sysconf(_SC_NPROCESSORS_CONF) on ARM.
Bug: http://code.google.com/p/enh/issues/detail?id=33
Change-Id: I679b4cd888d362031042284e8edf01c5273a92aa
2012-06-06 12:04:38 -07:00
Elliott Hughes
c2bba24d0a Merge "Give the timer_create SIGEV_THREAD helper threads sensible names." 2012-06-06 10:44:32 -07:00
Elliott Hughes
470631ed79 Give the timer_create SIGEV_THREAD helper threads sensible names.
Bug: 6609676
Change-Id: I286b197c75beee4d9930b0973f2d7dd47c14e91c
2012-06-06 10:32:56 -07:00
Jean-Baptiste Queru
c7882ab2a9 Merge "bionic: add clean kernel header ucontext.h" 2012-05-17 12:25:02 -07:00
Elliott Hughes
70cf0bc049 Merge "Remove the last references to SuperH." 2012-05-16 09:56:37 -07:00
Elliott Hughes
e33af61c70 Remove the last references to SuperH.
Change-Id: Icb44c1f94cb178d90b4c2b1e8f6d175586aec4e1
2012-05-15 17:08:41 -07:00
Nick Kralevich
cf8e554c72 Merge "Make the linker relocatable." 2012-05-15 15:10:24 -07:00
Nick Kralevich
36e0345af8 Merge "linker: set LOCAL_NO_CRT := true" 2012-05-15 15:10:12 -07:00
Nick Kralevich
1adc7c0389 Merge "linker: Fix the computation of si->base" 2012-05-15 15:10:01 -07:00
Nick Kralevich
cd6b2007b8 Merge "Add linker support for PIE" 2012-05-15 15:09:45 -07:00
Nick Kralevich
dcbc3787bf Make the linker relocatable.
Previously, the linker always loaded itself into the same
location in memory, which inhibited the effectiveness of Android's
ASLR implementation. Modify the linker code so it can be relocatable
and link itself at runtime.

Change-Id: Ia80273d7a00ff648b4da545f4b69debee6343968
2012-05-15 10:41:14 -07:00
Nick Kralevich
e742c1f564 linker: set LOCAL_NO_CRT := true
Use LOCAL_NO_CRT to prevent linking against crtbegin.o, rather than
messing with build rules. This also prevents linking against crtend.o,
which isn't needed for the linker.

Change-Id: I0c5b9999be7e8676560fe145c1c033ffce8db4d1
2012-05-15 10:08:39 -07:00
David 'Digit' Turner
077891b199 linker: Fix the computation of si->base
The computation of si->base assumed that the first entry in the
program header table is a PT_PHDR. This results in the dynamic
linker crashing with a SIGSEGV/MAPERR when trying to load some
of the NDK unit test programs, which happen to have an EXIDX
header first, followed byu a PHDR one.

This patch fixes the computation by parsing the program header
table, looking explicitely for the PHDR entry. This fixes the
load of the NDK unit test programs, and doesn't affect system
libraries.

Change-Id: Id18ea6037dbe950b5abbbce816c2960321f0b81d
2012-05-15 09:58:33 -07:00
Nick Kralevich
6cdefd06c0 Add linker support for PIE
Modify the dynamic linker so that executables can be loaded
at locations other than 0x00000000.

Modify crtbegin* so that non-PIC compilant "thumb interwork
veneers" are not created by the linker.

Bug: 5323301
Change-Id: Iece0272e2b708c79034f302c20160e1fe9029588
2012-05-15 09:56:32 -07:00
Kito Cheng
c425bc0532 bionic: add clean kernel header ucontext.h
Change-Id: I34fd0b0147fa33fd74c13480bc11827634233a41
2012-05-14 01:42:12 +08:00
Elliott Hughes
4f05d1c758 Merge "bionic/x86: Optimization for memcpy" 2012-05-10 10:14:44 -07:00
Elliott Hughes
edb7cad9b7 Merge "Actually set the header guard in "linux-syscalls.h"." 2012-05-09 16:39:40 -07:00
Elliott Hughes
1928523c87 Actually set the header guard in "linux-syscalls.h".
Spotted while merging a MIPS change.

Change-Id: I36fb5a07d0bba0c117e9fe9733957bd37ca4b4c0
2012-05-09 16:34:11 -07:00
Elliott Hughes
e54089079b Merge "[MIPS] Add support for MIPS syscalls" 2012-05-09 11:50:07 -07:00
Raghu Gandham
1fa0d84957 [MIPS] Add support for MIPS syscalls
Change-Id: I4deba67e15c865c4c2db03064c04098a09828ea6
Signed-off-by: Raghu Gandham <raghu@mips.com>
Signed-off-by: Chris Dearman <chris@mips.com>
2012-05-09 11:46:28 -07:00
Elliott Hughes
7eb1cc23f8 Merge "bionic: allow the board to customize MALLOC_ALIGNMENT" 2012-05-09 09:52:56 -07:00
Jack Ren
2fd81ef71c bionic: allow the board to customize MALLOC_ALIGNMENT
Currently the dlmalloc allocates the memory with 8-byte alignment.
According to the com.aurorasoftworks.quadrant.ui.professional benchmark data:
We can get much better memory performance if we change it to be 16-byte aligned.
For example, On Nexus-S:
8-byte aligned :
    1378 1070  1142 1665 1765  1163 1179  1263  1404 avg: 1336.555555556
16-byte aligned:
    1691 1731  1780 1691 1671  1678 1802  1758  1780 avg: 1731.333333333
                                                    gain: 29.53%

That patch provides flexibity to customize the MALLOC_ALIGNMENT from the
board config.The macro MALLOC_ALIGNMENT defaults to 8.
To change it, please define BOARD_MALLOC_ALIGNMENT in the BoardConfig.mk:
BOARD_MALLOC_ALIGNMENT := <whatever>

Change-Id: I8da0376944a0bbcef1d0fc026bfb6d9125db9739
Signed-off-by: Jin Wei <wei.a.jin@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Signed-off-by: Beare, Bruce J <bruce.j.beare@intel.com>
2012-05-09 09:52:22 -07:00
Elliott Hughes
fd95503347 Merge "pthread: Invalidate stale stack pointers on pthread_exit()" 2012-05-09 09:46:02 -07:00
Bjorn Andersson
0753dc653e pthread: Invalidate stale stack pointers on pthread_exit()
A call to pthread_key_delete() after pthread_exit() have unmapped the stack of a thread
but before the ongoing pthread_join() have finished executing will result in an access
to unmapped memory.
Avoid this by invalidating the stack_base and tls pointers during pthread_exit().

This is based on the investigation and proprosed solution by
Srinavasa Nagaraju <srinavasa.x.nagaraju@sonyericsson.com>

Change-Id: I145fb5d57930e91b00f1609d7b2cd16a55d5b3a9
2012-05-08 17:43:57 -07:00
Elliott Hughes
3919b96ecc Merge "Implement the "abort" stub in assembly for ARM." 2012-05-08 14:54:57 -07:00
Ben Cheng
eda7be454d Implement the "abort" stub in assembly for ARM.
So that we can always get the full stack trace regardless of gcc's handling
of the "noreturn" attribute associated with abort().

(Cherry pick of Id264a5167e7cabbf11515fbc48f5469c527e34d4.)

Bug: 6455193

Conflicts:

	libc/Android.mk

Change-Id: I568fc5303fd1d747075ca933355f914122f94dac
2012-05-08 14:47:20 -07:00
Jack Ren
c47703a521 bionic/x86: Optimization for memcpy
Signed-off-by: Liubov Dmitrieva <liubov.dmitrieva@intel.com>
Signed-off-by: H.J. Lu <hongjiu.lu@intel.com>
Signed-off-by: Wei A Jin <wei.a.jin@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>

Conflicts:

	libc/arch-x86/string/ssse3-memcpy5.S

Change-Id: I41e70d1d19d5457e65c89b64da452fbdaf3a00a7
2012-05-08 12:18:25 -07:00
Elliott Hughes
20bea00090 Merge "Cherry-pick "generate PIC code"." 2012-05-08 11:56:13 -07:00
Nick Kralevich
5982e33aca Cherry-pick "generate PIC code".
Change-Id: I7d5f2e5663df263493f65e364c959e663fc4d13a
2012-05-08 11:53:28 -07:00
Elliott Hughes
6cf3c7c50a Merge "Let pthread_create fail if schedparam can't be set" 2012-05-08 10:56:01 -07:00
Pierre Peiffer
d0c884d359 Let pthread_create fail if schedparam can't be set
The creation of a thread succeeds even if the requested scheduling
parameters can not be set. This is not POSIX compliant, and even
worse, it leads to a wrong behavior. Let pthread_create() fail in this
case.

Change-Id: Ice66e2a720975c6bde9fe86c2cf8f649533a169c
Signed-off-by: Christian Bejram <christian.bejram@stericsson.com>
2012-05-08 10:54:51 -07:00
Elliott Hughes
e3bc7192ec Merge "bionic: fix integer overflows in chk_malloc(), leak_malloc(), and leak_memalign()" 2012-05-07 10:51:29 -07:00
Xi Wang
7f5aa4f35e bionic: fix integer overflows in chk_malloc(), leak_malloc(), and leak_memalign()
The allocation size in chk_malloc(), leak_malloc(), and leak_memalign()
functions may be rounded up to a small value, leading to buffer overflows.
The code only runs in debugging mode.

This patch complements commit 6f04a0f4 (CVE-2009-0607).

Change-Id: Id899bcd2bcd2ea2205e5753c433390710032dc83
Signed-off-by: Xi Wang <xi.wang@gmail.com>
2012-05-07 10:50:21 -07:00
Elliott Hughes
73a6566da3 Merge "Remove expired dns cache entries before removing oldest" 2012-05-07 10:41:53 -07:00
Elliott Hughes
8657eafc35 Merge "Adjust memcpy for ARM Cortex A9 cache line size" 2012-05-07 09:13:35 -07:00
Henrik Smiding
fe6338da91 Adjust memcpy for ARM Cortex A9 cache line size
ARM Cortex A8 use 64 bytes and ARM Cortex A9 use 32 bytes cache line
size.

The following patch:
  Adds code to adjust memcpy cache line size to match A9 cache line
  size.
  Adds a flag to select between 32 bytes and 64 bytes cache line
  size.

  Copyright (C) ST-Ericsson SA 2010
    Modified neon implementation to fit Cortex A9 cache line size
    Author: Henrik Smiding henrik.smiding@stericsson.com for
            ST-Ericsson.

Change-Id: I8a55946bfb074e6ec0a14805ed65f73fcd0984a3
Signed-off-by: Christian Bejram <christian.bejram@stericsson.com>
2012-05-07 14:18:02 +02:00
Elliott Hughes
f7db5ecc4d Merge "MIPS support to libm, libdl and libthread_db" 2012-05-04 12:00:19 -07:00
Chris Dearman
726800e8f4 MIPS support to libm, libdl and libthread_db
Change-Id: I9106721af7fe0cd45df82976250db0d300a20117
Signed-off-by: Raghu Gandham <raghu@mips.com>
2012-05-04 11:34:40 -07:00
Elliott Hughes
10579fc43d Merge "Update s_fabsl.c to upstream head." 2012-04-30 22:35:02 -07:00
Elliott Hughes
7735a38935 Update s_fabsl.c to upstream head.
Bug: http://code.google.com/p/android/issues/detail?id=29539
Change-Id: I843dcfcbfe49e8e9f43c49aae6ade1edb57a3053
2012-04-30 16:12:43 -07:00
Ken Sumrall
6baffed252 Add the posix_memalign(3) function to bionic
The posix_memalign(3) function is very similar to the traditional
memalign(3) function, but with better error reporting and a guarantee
that the memory it allocates can be freed.  In bionic, memalign(3)
allocated memory can be freed, so posix_memalign(3) is just a wrapper
around memalign(3).

Change-Id: I62ee908aa5ba6b887d8446a00d8298d080a6a299
2012-04-27 09:34:53 -07:00
Andrew Hsieh
1e343cb119 Merge "[MIPS] Fix the warning originating from the kernel header signal.h. This is a clean header generated from the corresponding change in external/kernel-headers repository. (CL 35760)" 2012-04-24 23:44:18 -07:00
Raghu Gandham
e328ce6c55 [MIPS] Fix the warning originating from the kernel header signal.h.
This is a clean header generated from the corresponding change in
external/kernel-headers repository. (CL 35760)
2012-04-23 18:59:41 -07:00
Elliott Hughes
418e647a83 Merge "libstdc++: Fix x86 thread-safe one-time-construction implementation." 2012-04-16 09:13:13 -07:00
Elliott Hughes
4994deaef5 Merge "Bionic: Fix wrong prototype of system call clock_nanosleep" 2012-04-16 09:09:05 -07:00
Elliott Hughes
7b8666e683 Merge "bionic: Fix wrong prototype of system call getresuid/getresgid" 2012-04-16 09:06:22 -07:00
Jack Ren
d515ce465b Bionic: Fix wrong prototype of system call clock_nanosleep
In bionic/libc/SYSCALLS.TXT, the prototype of system call
clock_nanosleep is incorrect.

According to man page:
int clock_nanosleep(clockid_t clock_id, int flags,
                    const struct timespec *request,
                    struct timespec *remain);

Change-Id: Ic44c6db3d632293aa17998035554eacd664c2d57
Signed-off-by: Jin Wei <wei.a.jin@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
2012-04-16 23:53:05 +08:00
Elliott Hughes
6435d27f9d Merge "bionic: fix NULL parameter failure in getcwd()" 2012-04-16 08:48:19 -07:00
Jack Ren
41070dd15f bionic: Fix wrong prototype of system call getresuid/getresgid
In bionic/libc/SYSCALLS.TXT, the prototypes of system call
getresuid/getresgid are incorrect.

According to man page, they should be:
    int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid);
    int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid);

Change-Id: I676098868bb05a9e1fe45419b234cf397626fdad
Signed-off-by: Jin Wei <wei.a.jin@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
2012-04-16 23:45:36 +08:00
Jack Ren
e5bf068147 bionic: fix NULL parameter failure in getcwd()
LTP: getcwd01 failed in LTP

Need to check getcwd parameters, otherwise it will lead to
posix test case to fail.

Change-Id: Ieb673b6dd4ca6481da81c5339dbf7ec0a463f263
Signed-off-by: Jin Wei <wei.a.jin@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
2012-04-16 23:35:05 +08:00