summaryrefslogtreecommitdiffstats
path: root/libc/private
Commit message (Collapse)AuthorAgeFilesLines
* Fix __get_tls() in static C library to use kernel helpers.David 'Digit' Turner2010-08-271-9/+35
| | | | | | | This is needed to fix gdbserver's handling of threaded programs, among other things. Change-Id: I823387c602cef9891532da946a01db14be780ab0
* Remove compiler warnings when building Bionic.David 'Digit' Turner2010-06-221-0/+41
| | | | | | | | Also add missing declarations to misc. functions. Fix clearerr() implementation (previous was broken). Handle feature test macros like _POSIX_C_SOURCE properly. Change-Id: Icdc973a6b9d550a166fc2545f727ea837fe800c4
* Allow static C++ destructors to be properly called on dlclose().David 'Digit' Turner2010-06-181-0/+37
| | | | | | | | | | | | | | | | | | | | | | | With this patch, _and_ an upcoming build/ patch, the destruction of static C++ objects contained in shared libraries will happen properly when dlclose() is called. Note that this change introduces crtbegin_so.S and crtend_so.S which are currently ignored by the build system. + move definition of __dso_handle to the right place (before that, all shared libraries used the __dso_handle global variable from the C library). Note that we keep a 'weak' __dso_handle in aeabi.c to avoid breaking the build until the next patch to build/core/combo/ appears. We will be able to remove that later. + move bionic/aeabi.c to arch-arm/bionic/ (its proper location) Change-Id: Ie771aa204e3acbdf02fd30ebd4150373a1398f39 NOTE: The NDK will need to be modified to enable this feature in the shared libraries that are generated through it.
* libc: remove cutils dependenciesDavid 'Digit' Turner2010-06-111-0/+107
| | | | | | | | We simply copy the stuff we need from cutils headers. A future patch will change cutils to include the private <bionic_atomic_inline.h> Change-Id: Ib6fd9a03bc9e337ce867bd606dc94c2b4438480a
* Use private futexes for semaphores, unless they are initialized with pshared ↵David 'Digit' Turner2010-06-081-0/+57
| | | | | | | != 0. Change-Id: I534e36a7171cd37037ae03b910ba71ea6968286d Note: previously, sem_init() would return an error if pshared != 0.
* Fix spurious DNS lookups in the C library.David 'Digit' Turner2010-03-081-0/+8
| | | | | | | | | | | | | | | | | | | | | | | The problem was that the 'defdname' field of res_state structure was not properly initialized in __res_vinit(). This field is used to store the default domain name, which is normally build from calling gethostname() (see line 549 of res_init.c). Unfortunately, in the typical Android case, gethostname() returns an error (the hostname is configured) and a random stack string is used later to build the DNS search list (see lines 556+ in res_init.c) For the sake of illustration, let's say the search list is set to a random value like 'xWLK'. The end result is that when trying to result an unknown domain name (e.g. 'www.ptn'), the query fails then the resolver tries to make a new query with the DNS search list path(s) appended (e.g. 'www.ptn.xWLK'). The patch simply initializes 'defdname' to an empty string to avoid this when the net.dns.search system property is not set. Also contains whitespace/formatting fixes
* resolved conflicts for merge of 4a05d12c to eclair-plus-aospDavid 'Digit' Turner2009-09-221-3/+13
|\
| * Fix TLS access for ARMv6 and beyond.David 'Digit' Turner2009-09-221-1/+12
| | | | | | | | | | | | | | | | | | | | For performance reasons, we don't call the kernel helper. Instead, we directly access the TLS register on ARMv6 and higher. For ARMv5TE, keep using the hard-coded address populated by the kernel on each task switch. NOTE: Since we don't call the kernel helper, this must precisely match your kernel configuration. This is controlled by setting the ARCH_ARM_HAVE_TLS_REGISTER variable to 'true' in your board configuration file.
* | Linux kernel helpers support is provided to android for its TLS ↵vinay harugop2009-09-161-1/+3
|/ | | | | | | | implementation. This fix addresses this by modifying the TLS access functions to use the kernel helper. This Fix is verified on ST Ericsson's U8500 platform and Submitted on behalf of a third-party: Surinder-pal SINGH from STMicroelectronics.
* Pass the elfdata pointer in a slot of the temporary TLS area.David 'Digit' Turner2009-07-171-0/+7
| | | | | | | | | | | | | | | | This is needed to properly initialize the C runtime when libc.so is loaded by the dynamic linker. Move the temporary TLS setup before the first system call, just in case something really horrible happens, we won't crash when trying to write an error code in 'errno' Remove the broken TLS_SLOT_THREAD_ID setup. First, this slot should normally receive the address of a pthread_internal_t, not a kernel thread identifier. Second, it is never used by the linker anyway. Also remove an obsolete comment.
* Prevent a crash in the memory leak checker (which happened in chk_free())David 'Digit' Turner2009-07-101-0/+3
| | | | | | Simplify the code a little, removing un-necessary mutex locks/unlocks. Provide slightly better diagnostic message in case of corruption. Use snprintf/strlcat instead of sprintf/strcat
* Revert "Fix the C library initialization to avoid calling static C++ ↵David 'Digit' Turner2009-06-032-191/+0
| | | | | | constructors twice." This reverts commit 03eabfe65e1e2c36f4d26c78a730fa19a3bdada3.
* Fix the C library initialization to avoid calling static C++ constructors twice.David 'Digit' Turner2009-06-022-0/+191
| | | | | | | | | | | | | | | | | | | | | | | | | | The problem was due to the fact that, in the case of dynamic executables, the dynamic linker calls the DT_PREINIT_ARRAY, DT_INIT and DT_INIT_ARRAY constructors when loading shared libraries and dynamic executables, *before* calling the executable's entry point (i.e. arch-$ARCH/bionic/crtbegin_dynamic.c) which in turns call __libc_init() in libc.so, as defined by bionic/libc_init_dynamic.c The latter did call these constructors array again, mistakenly. The patch also updates the documentation of many related functions. Also adds a new section to linker/README.TXT explaining restrictions on C library usage. The patch has been tested on a Dream for stability issues with proprietary blobs: - H264 decoding works - Camera + Video recording works - GPS works - Sensors work The tests in system/extra/tests/bionic/libc/common/test_static_cpp_mutex.cpp has been run and shows the static C++ constructor being called only once.
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-0318-0/+2737
|
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-0318-2737/+0
|
* auto import from //branches/cupcake/...@132276The Android Open Source Project2009-02-192-20/+75
|
* auto import from //branches/cupcake/...@126645The Android Open Source Project2009-01-151-0/+94
|
* auto import from //branches/cupcake/...@125939The Android Open Source Project2009-01-0916-0/+2588