aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2009-07-28bionic/linker: keep track of opened libraries by basenameandroid-sdk-tools_r2android-sdk-1.6_r2android-sdk-1.6_r1android-sdk-1.6-docs_r1android-1.6_r2android-1.6_r1.5android-1.6_r1.4android-1.6_r1.3android-1.6_r1.2android-1.6_r1.1android-1.6_r1donut-release2donut-releasedonutErik Gilling
Prior to this change, the dynamic loader kept track of opened libraries either by their base name (i.e., libfoo.so instead of /system/lib/libfoo.so) when the shared library was loaded through the DT_NEEDED tag in an ELF header, or by whatever name was passed to dlopen(). This created a number of problems, among which: 1. dlopen("libfoo.so") and dlopen("/path/to/libfoo.so") would open the same library twice; 2. dlopen("/path/to/libfoo.so") and then dlopen("libbar.so"), where libbar.so depends on libfoo.so, would open libfoo.so twice. This patch makes the dynamic loader keep track of each loaded library by basename, which resolves the above ambiguity. The patch also enforces library lookup by base name, which means that it will refuse to load another library that has the same name. Thanks for the inspiration Iliyan. Signed-off-by: Erik Gilling <konkers@android.com> Cc: Iliyan Malchev <malchev@google.com>
2009-07-28Merge change 8281 into donutAndroid (Google) Code Review
* changes: linker: remove newlines from DL_ERR so that dlerror works correctly
2009-07-27Make the DNS resolver accept domain names with an underscore.David 'Digit' Turner
More precisely, this accepts domain labels with an underscore in the middle (i.e. not at the start or the end of the label). This is needed to perform complex CNAME chain resolution in certain VPN networks.
2009-07-22linker: remove newlines from DL_ERR so that dlerror works correctlyErik Gilling
Signed-off-by: Erik Gilling <konkers@android.com>
2009-07-21Restore malloc debug.Andy McFadden
Some libc changes were preventing the initialization call from being made. The basic problem appears to be that libc_init_common.c is only built once, and it's only built for the non-debug libc.
2009-07-18Fix the C library runtime initialization order.David 'Digit' Turner
This allows libc.so to run the C runtime initializer as soon as the dynamic linker loads the shared library, i.e. before any other initializers (e.g. static C++ constructors in other shared libraries the executable depends on). This also removes the bug where the initializers from the executable itself were run twice: once by the dynamic linker, and another time by __libc_init as defined by libc_init_dynamic.c
2009-07-17Pass the elfdata pointer in a slot of the temporary TLS area.David 'Digit' Turner
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.
2009-07-10Add new C++ headers <cerrno> and <cfloat>David 'Digit' Turner
Also add std::malloc/realloc/calloc/free to <cstdlib> Rename <cwchar_is_not_supported> to <cwchar>
2009-07-10Add <linux/uinput.h> to C library kernel headersDavid 'Digit' Turner
2009-07-10Prevent a crash in the memory leak checker (which happened in chk_free())David 'Digit' Turner
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
2009-06-25Merge change 2990 into donutAndroid (Google) Code Review
* changes: Add LD_LIBRARY_PATH support to bionic's linker
2009-06-24Merge change 5184 into donutAndroid (Google) Code Review
* changes: update clean msm_camera.h
2009-06-23update clean msm_camera.hIliyan Malchev
Signed-off-by: Iliyan Malchev <malchev@google.com>
2009-06-22Add Glibc-compatible macro aliases for the nanosecond time accessors in stat ↵David 'Digit' Turner
structure
2009-06-16Update cleaned-up kernel headersDavid 'Digit' Turner
2009-06-15Add LD_LIBRARY_PATH support to bionic's linkerDavid Bartley
2009-06-12Add new clean header for PPP on PPTP (VPN)David 'Digit' Turner
2009-06-04bionic: update msm_camera.h headerIliyan Malchev
Signed-off-by: Iliyan Malchev <malchev@google.com>
2009-06-03Revert "Fix the C library initialization to avoid calling static C++ ↵David 'Digit' Turner
constructors twice." This reverts commit 03eabfe65e1e2c36f4d26c78a730fa19a3bdada3.
2009-06-02Fix the C library initialization to avoid calling static C++ constructors twice.David 'Digit' Turner
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.
2009-06-01linker: Give more context for failures during library dependency resolution.Dima Zavin
Signed-off-by: Dima Zavin <dima@android.com>
2009-05-27linker: Make the errors reported by dlopen/dlsym be more useful.Dima Zavin
Changed it so that when the linker generates error messages, they are scribbled away into a buffer that dlfcn and friends can read from. Since the error messages are generetad with snprintf, and snprintf MAY call malloc during some code paths, we now link against a version of libc that does not contain malloc/free/realloc/calloc. We then define malloc and friends in the dynamic loader, and make them abort() if they are ever called. Signed-off-by: Dima Zavin <dima@android.com>
2009-05-27libc: Add an intermediate version of the static libc without mallocDima Zavin
For now, this will only used by the dynamic loader to ensure that malloc and friends are never called. Signed-off-by: Dima Zavin <dima@android.com>
2009-05-27libc: Cleanup the libc makefile.Dima Zavin
Removes a lot of redundant code, and reorganizes the file. We first setup all the comomn variables we may need, and then define the actual libraries that need to be generated. Signed-off-by: Dima Zavin <dima@android.com>
2009-05-27Merge change 2470 into donutAndroid (Google) Code Review
* changes: Fix getservent() so that it returns s_port in network byte order. Also add a new document detailing known issues in the C library.
2009-05-27Merge change 1852 into donutAndroid (Google) Code Review
* changes: Fix __eabi_atexit() implementation, as well as a bug in the BSD-originated __cxa_finalize() implementation This patch uses "#if ANDROID" instead of "#if 1" in the __cxa_finalize() fix
2009-05-26add msm_camera.h header and .gitignore file to bionicIliyan Malchev
Signed-off-by: Iliyan Malchev <malchev@google.com>
2009-05-26update msm_adsp.h headerIliyan Malchev
Signed-off-by: Iliyan Malchev <malchev@google.com>
2009-05-27Fix getservent() so that it returns s_port in network byte order.David 'Digit' Turner
Also add a new document detailing known issues in the C library.
2009-05-26Fix the parsing of the .fini_array in the dynamic linker (it should happen ↵David 'Digit' Turner
in reverse order). Also add a small design overview document for the linker. The latter contains details on how the initialization/finalization is supposed to work.
2009-05-20Add <linux/ipsec.h> and <linux/if_pppolac.h> for VPN support.David 'Digit' Turner
Also update tools/update_all.py to not use perforce add/edit/delete commands automatically now that we're using git
2009-05-20Fix __eabi_atexit() implementation, as well as a bug in the BSD-originated ↵David 'Digit' Turner
__cxa_finalize() implementation This patch uses "#if ANDROID" instead of "#if 1" in the __cxa_finalize() fix
2009-05-18Add <cmath> standard C++ header.David 'Digit' Turner
This is needed for upcoming STLport experimentation.
2009-05-15revert to previous implementation of __aeabi_atexit() since the new one ↵David 'Digit' Turner
seems to crash a static ICU String destructor. I don't have the time to investigate why right now, so a revert is preferred. Damn...
2009-05-14Fix __aeabi_atexit to call __cxa_atexit properly. This function is defined ↵David 'Digit' Turner
by the C++ ABI for ARM document.
2009-05-12linker: Compute symbol name before lookup so we can also use it for error msgDima Zavin
Signed-off-by: Dima Zavin <dima@android.com>
2009-05-05change getaddrinfo() implementation to match GLibc.David 'Digit' Turner
the issue is that the BSD implementation doesn't accept a call like: getaddrinfo(SERVER_NAME, "9999", NULL, &res); because if will reject a numerical string in the second parameter if no hints are explicitely provided. This technically doesn't violate POSIX but might make porting Linux software a bit difficult. For more details see: http://groups.google.com/group/android-ndk/browse_thread/thread/818ab9c53f24c87 also comment debugging printf() calls which shouldn't be there.
2009-05-01Merge change 57 into donutAndroid (Google) Code Review
* changes: Add the domain search list for VPN connection. The current solution is to read the net.dns.search property, and expand the list during the resolve initialization. In the future, we could implement search list per process.
2009-04-30Increase the limit of loaded shared libraries from 64 to 96 This change is ↵James Dong
required for OpenCORE 2.0 This is the same as Change 71 in master branch.
2009-04-24libc: Replace a reference to TARGET_BUILD_TYPE with DEBUG_BIONIC_LIBCDave Bort
We're soon going to stop using TARGET_BUILD_TYPE==debug to debug native modules. Signed-off-by: Dave Bort <dbort@android.com>
2009-04-22merge cupcake into donutJean-Baptiste Queru
2009-04-13Add the domain search list for VPN connection.Chung-yih Wang
The current solution is to read the net.dns.search property, and expand the list during the resolve initialization. In the future, we could implement search list per process. Update: refine the code accordingly. Update: remove unnecessary code. Update: remove the unused variable.
2009-04-10AI 145714: Added cstring wrapper around string.h.Niko Catania
In new, include cstddef which declares std::size_t. BUG=1601432 Automated import of CL 145714
2009-04-08AI 145059: (Almost) final set of wrapper around the C headers for stdc++ and ↵Niko Catania
their tests. The only one left is cstring. * bionic/libstdc++/include/cstdlib: * bionic/libstdc++/include/cstdio: * bionic/libstdc++/include/cstdint: * bionic/libstdc++/include/csignal: * bionic/libstdc++/include/csetjmp: Added header file. Checks the bionic headers file were picked up instead of the host ones. Added test for new header files * system/extras/tests/bionic/libstdc++/Android.mk: Added tests for the new header files. EXTRA_CFLAGS: include the bionic header files. BUG=1601432 Automated import of CL 145059
2009-04-02AI 144236: Added new C to stdc++ header files: cassert, cctype, climits, ctime.Niko Catania
QA Impact:None BUG=1601432 Automated import of CL 144236
2009-03-30AI 143504: Completed cstddef to be non empty and similar to the gnu stl ↵Niko Catania
implementation. Even if we don't want to have a bloated stl implementation, having empty files around is probably not very good either. Added a test to make sure the header file compiles on host and kila-eng. QA Impact: In system/extras/test/bionic/libstdc++ build the tests using: mm BIONIC_TESTS=1 to build the host and target tests. BUG=1601432 Automated import of CL 143504
2009-03-27AI 143161: am: CL 142857 Add some bluring to the animation. This requires a ↵Mathias Agopian
new kernel which will be checked-in later, at which point the blur effect will automatically be enabled. Original author: mathias Merged from: //branches/cupcake/... Automated import of CL 143161
2009-03-25Automated import from //branches/cupcake/...@142857,142857android-sdk-1.5_r3android-sdk-1.5_r1android-sdk-1.5-preandroid-1.5r4android-1.5r3android-1.5r2android-1.5cupcake-releasecupcakeMathias Agopian
2009-03-24Automated import from //branches/donutburger/...@140950,140950Iliyan Malchev
2009-03-19auto import from //branches/cupcake_rel/...@141571The Android Open Source Project