summaryrefslogtreecommitdiffstats
path: root/libc
Commit message (Collapse)AuthorAgeFilesLines
* Ensure we initialize stdin/stdout/stderr's recursive mutexes.Elliott Hughes2014-11-032-10/+17
| | | | | | | (cherry-pick of 6a03abcfd23f31d1df06eb0059830e22621282bb.) Bug: 18208568 Change-Id: I9da16ce0f9375bc363d1d02be706d73fd3b1e150
* Add RTLD_NODELETE flag supportDmitriy Ivanov2014-10-311-0/+1
| | | | | | | | | Bug: 18186310 Bug: https://code.google.com/p/android/issues/detail?id=64069 (cherry picked from commit 1b20dafdbe65e43b9f4c95057e8482380833ea91) Change-Id: Ic02eec22a7c322ece65eb40730a3404f611526b1
* Fix unused DT entry warnings.Dmitriy Ivanov2014-10-311-0/+29
| | | | | | | | | | | | DT_STRSZ Implement strtab boundary checks DT_FLAGS_1 Warn if flags other than DF_1_NOW|DF_1_GLOBAL are set Bug: 17552334 Bug: 18186310 (cherry picked from commit 6cdeb5234d7f4523fe9d83974f265d80f10512a6) Change-Id: I7ffc7bc600798308a77ad949a644949b64250ae2
* Fix a couple more cases of missing CLOEXEC.Elliott Hughes2014-10-311-2/+2
| | | | | | | | | | | The debuggerd case can probably never happen, because you're crashing at this point anyway. The system property one seems possible though. Bug: 18186310 (cherry picked from commit 0dc39f9952c5e3a3121ea77357bb264ef0f8ded7) Change-Id: I3e84488fc246f6c28cbd82e96d0cd4343a12c28a
* Only use <atomic> for C++11 and newer.Dan Albert2014-10-301-1/+1
| | | | | | | | | | Any pre-C++11 clients of stdatomic.h that use libc++ are being forced over to <atomic>, which they don't have the language support to use. Bug:17736764 Change-Id: I62445c1f2541410a1569498c09433c7196635537 (cherry picked from commit 3ce0769aa5f9a991af1d167f730d987dd002253c)
* Merge changes I0feda6b2,I22d13fde,I49d7d09d,Ice490bfe into lmp-mr1-devElliott Hughes2014-10-295-13/+19
|\ | | | | | | | | | | | | | | * changes: Fix the type of u_ar0 in <sys/user.h>. Add greg_t for arm64. POSIX says <signal.h> gets you ucontext_t. Add in_port_t and move it and in_addr_t to the correct header file.
| * Fix the type of u_ar0 in <sys/user.h>.Elliott Hughes2014-10-291-3/+3
| | | | | | | | | | | | | | (cherry picked from commit e03950fa0c5567edf70d011b856a027e03b1c0f7) Bug: 18172268 Change-Id: I0feda6b253882f68f47bcf30fad998286cc7f620
| * Add greg_t for arm64.Elliott Hughes2014-10-291-0/+4
| | | | | | | | | | | | | | | | | | | | | | This was already present for the other architectures. I think we skipped this because glibc seems to have an incorrect definition (int rather than long), but the kernel has the sane definition (just not in a uapi header). (cherry picked from commit 8e4d371091e5738346f5c6ad395b8487c2a5ec67) Bug: 18172268 Change-Id: I22d13fdeb6431ea122dd028a229782dcaf2286b2
| * POSIX says <signal.h> gets you ucontext_t.Elliott Hughes2014-10-292-8/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | POSIX also says that ucontext_t's uc_sigmask has type sigset_t. MIPS64 strace needs this. The #define is to keep chromium off our lawn; otherwise it tries to redefine all this stuff itself. We should probably clean that up and remove the #define. (cherry picked from commit 26a8eb50a84e131d34d10d5d167d67e9995399bd) Bug: 18172268 Change-Id: I49d7d09dabfc6c6926a8e1f4b235d041e2f2fc4d
| * Add in_port_t and move it and in_addr_t to the correct header file.Elliott Hughes2014-10-292-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | No one's reported this, but I saw it in an Android port of fuser(1). We still have lots of problems in our network headers because we get most of the structs direct from the kernel, and it doesn't use types like this (which is why we've got away without this one for so long). One day we should probably look at cleaning that up, but doing so can wait. (cherry picked from commit 35d226e05d92824c6eb992e7a64ea22efc8bae03) Bug: 18172268 Change-Id: Ice490bfe84afb04722d738128053d4c533b8a664
* | Add stpcpy assembler version.Christopher Ferris2014-10-2912-869/+1124
|/ | | | | | | | | | For generic, continue to use the C version of the code. Bug: 13746695 (cherry picked from commit 7d849ac378515efa1522e538e6e1d3b546cae97d) Change-Id: Iae44785f37f9bb59103ab78fb9f74c92f8a95c7f
* Cleanup arm assembly.Christopher Ferris2014-10-2823-253/+210
| | | | | | | | | | | | Remove the old arm directives. Change the non-local labels to .L labels. Add cfi directives to strcpy.S. Bug: 18157900 (cherry picked from commit c8bd2abab24afe563240297018c4fa79944f193b) Change-Id: Ifa1c3d16553d142eaa0d744af040f0352538106c
* Add __memcpy_chk assembly for 64 bit.Christopher Ferris2014-10-285-370/+484
| | | | | | | | Bug: 17623887 (cherry picked from commit 8cf61dab5f11ed5654a5760ab47cec0239caafe0) Change-Id: I91e66ca0c26f04b50308059f9c89d388d55f6e3a
* Clean up the architecture-specific makefiles.Elliott Hughes2014-10-287-108/+154
| | | | | | | | | | Group things appropriately and name each group. Bug: 18160821 (cherry picked from commit 7c02d9428ca18ac600f7ba7d51bb24ca71e733f6) Change-Id: I863242515af44058154d03e2d8c34678e682d66a
* No arm source refers to SOFTFLOAT.Elliott Hughes2014-10-281-2/+0
| | | | | | | | | | So why bother #defining it? Bug: 18160821 (cherry picked from commit b1a6c319c40674d71e30313040d3b33b8bddf24b) Change-Id: I9cd9c144ba7071fddda12fa16d1232ad861b66be
* Remove the unnecessary generic-neon code.Christopher Ferris2014-10-283-193/+1
| | | | | | | Bug: 18156619 (cherry picked from commit 2169e17482da91865e412e55b52b88d7c8db47f6) Change-Id: I4a7f5bb9ad4c27b274f3a3c86c1617ca0578b98f
* Merge "Don't mask out SA_RESTORER from sa_flags." into lmp-mr1-devElliott Hughes2014-10-281-4/+0
|\
| * Don't mask out SA_RESTORER from sa_flags.Elliott Hughes2014-10-281-4/+0
| | | | | | | | | | | | | | | | | | | | | | glibc doesn't do this, and we probably shouldn't either. Bug: 16703540 Bug: 17436734 (cherry picked from commit afe58ad9892de27a7acb0aaded6312ee0f958314) Change-Id: Iada5d0ae814f438cb276f056b2b5e3675f0e3666
* | Merge "Disable tzdata in $ANDROID_DATA." into lmp-mr1-devElliott Hughes2014-10-281-8/+5
|\ \ | |/ |/|
| * Disable tzdata in $ANDROID_DATA.Elliott Hughes2014-10-271-8/+5
| | | | | | | | | | Bug: 18139284 Change-Id: I2670dc1791d635139a5d39a438dc08777439476b
* | [x86,x86_64] Fix libgcc unwinding through signalPavel Chupin2014-10-274-43/+211
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change provides __restore/__restore_rt on x86 and __restore_rt on x86_64 with unwinding information to be able to unwind through signal frame via libgcc provided unwinding interface. See comments inlined for more details. Also remove the test that had a dependency on __attribute__((cleanup(foo_cleanup))). It doesn't provide us with any better test coverage than we have from the newer tests, and it doesn't work well across a variety architectures (presumably because no one uses this attribute in the real world). Tested this on host via bionic-unit-tests-run-on-host on both x86 and x86-64. Bug: 17436734 Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com> (cherry picked from commit 50321e2e66f19998970e59d666bc9af387345b3a) Change-Id: Iba90e36958b00c7cc7db5eeebf888dc89ce4d619
* | Use the kernel's sa_restorer for aarch64.Elliott Hughes2014-10-273-48/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gdb was happy with what we had, but libgcc and libunwind weren't. libgcc is happy with the kernel's restorer (because of the extra nop), though libunwind looks like it's going to need code changes regardless. We could make our restorer more like the kernel's one, but why bother when we can just let the kernel supply the canonical one? Bug: 17436734 (cherry picked from commit 1cff9a89645a8f362a9ce19c7f9544e98c1fd9e7) Change-Id: Ie13d73fd97395e1979a67c2294e036a97c50000d
* | Fix 32-bit arm unwinding through signal frames.Elliott Hughes2014-10-273-37/+27
| | | | | | | | | | | | | | | | | | | | gdb was already okay; libgcc and libunwind need a little extra help. Bug: 17436734 (cherry picked from commit 148dff3ec6114a03acc722ae43990f1b342abad9) Change-Id: I2cc997017acc57c930284af5264f353656b98c7b
* | Fix signal trampolines.Elliott Hughes2014-10-2712-12/+183
|/ | | | | | | | | | | | | | | | | | | | | | | | * LP32 should use sa_restorer too. gdb expects this, and future (>= 3.15) x86 kernels will apparently stop supporting the case where SA_RESTORER isn't set. * gdb and libunwind care about the exact instruction sequences, so we need to modify the code slightly in a few cases to match what they're looking for. * gdb also cares about the exact function names (for some architectures), so we need to use __restore and __restore_rt rather than __sigreturn and __rt_sigreturn. * It's possible that we don't have a VDSO; dl_iterate_phdr shouldn't assume that getauxval(AT_SYSINFO_EHDR) will return a non-null pointer. This fixes unwinding through a signal handler in gdb for all architectures. It doesn't fix libunwind for arm and arm64. I'll keep investigating that... (cherry picked from commit 36f451a6d93b6807944d99fa23396e039c47e845) Bug: 17436734 Change-Id: Ic1ea1184db6655c5d96180dc07bcc09628e647cb
* Use mxcr_mask instead of mxcsr_mask to match glibc.Elliott Hughes2014-10-241-1/+1
| | | | | | | | Bug: 18097559 (cherry picked from commit f485547b9267263e1de220a3cc368deaec367191) Change-Id: I242105faa8210abc9635a951b25b127cd64ed23c
* Update bionic to tzdata2014i.Elliott Hughes2014-10-221-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From the release notes: Changes affecting future time stamps Pacific/Fiji will observe DST from 2014-11-02 02:00 to 2015-01-18 03:00. (Thanks to Ken Rylander for the heads-up.) Guess that future years will use a similar pattern. A new Zone Pacific/Bougainville, for the part of Papua New Guinea that plans to switch from UTC+10 to UTC+11 on 2014-12-28 at 02:00. (Thanks to Kiley Walbom for the heads-up.) Changes affecting time zone abbreviations Since Belarus is not changing its clocks even though Moscow is, the time zone abbreviation in Europe/Minsk is changing from FET to its more-traditional value MSK on 2014-10-26 at 01:00. (Thanks to Alexander Bokovoy for the heads-up about Belarus.) The new abbreviation IDT stands for the pre-1976 use of UT+8 in Indochina, to distinguish it better from ICT (UT+7). Changes affecting past time stamps Many time stamps have been corrected for Asia/Ho_Chi_Minh before 1976 (thanks to Trần Ngọc Quân for an indirect pointer to Trần Tiến Bình's authoritative book). Asia/Ho_Chi_Minh has been added to zone1970.tab, to give tzselect users in Vietnam two choices, since north and south Vietnam disagreed after our 1970 cutoff. Asia/Phnom_Penh and Asia/Vientiane have been turned into links, as they differed from existing zones only for older time stamps. As usual, these changes affect pre-1970 time stamps only. Their old contents have been moved to the 'backzone' file. Bug: 18085936 (cherry picked from commit a05c2a2a705c8298154db6665cbbb4dbe3cdbbd5) Change-Id: If0253cc1515e1bc98e99c6e24eec797836ca7c27
* Merge "Fix generic __memcpy_chk implementation." into lmp-mr1-devChristopher Ferris2014-10-221-34/+40
|\
| * Fix generic __memcpy_chk implementation.Christopher Ferris2014-10-221-34/+40
| | | | | | | | | | | | | | | | | | | | | | | | - Clean up the labels (add .L to make them local). - Change to using cfi directives. - Fix unwinding of the __memcpy_chk fail path. Bug: 18033671 (cherry pick from commit 7123d4371a5e04337b1de5f8cdf6cdc1e08e9cad) Change-Id: Ife93bcbfc1949ef29fc8e2dc515b7120632b82b1
* | Merge "Fix race condition in timer disarm/delete." into lmp-mr1-devChristopher Ferris2014-10-221-2/+18
|\ \ | |/ |/|
| * Fix race condition in timer disarm/delete.Christopher Ferris2014-10-211-2/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When setting a repeat timer using the SIGEV_THREAD mechanism, it's possible that the callback can be called after the timer is disarmed or deleted. This happens because the kernel can generate signals that the timer thread will continue to handle even after the timer is supposed to be off. Add two new tests to verify that disarming/deleting doesn't continue to call the callback. Modify the repeat test to finish more quickly than before. Refactor the Counter implementation a bit. Bug: 18039727 Change-Id: I73192c915cdacf608521b1792c54e5af14a34907
* | Rename library_offset to library_fd_offsetDmitriy Ivanov2014-10-221-4/+4
| | | | | | | | | | | | | | | | | | | | | | replace lseek() and use pread() instead add test for library_fd_offset > file_size case Bug: 17762003 (cherry picked from commit a6c1279098f24a675d0df74ce1946f5d534b425e) Change-Id: Ie117c745081ee33d07db5341115ff6c8e98b0dec
* | Add file_offset parameter to android_extinfoDmitriy Ivanov2014-10-211-1/+9
|/ | | | | | | | Bug: 17762003 (cherry picked from commit 07e5bc152d8a3ad4c50808bb86f3c0f2c5e2f514) Change-Id: I72d527831384ff5dde013a4c8dfe639fbec165f5
* Make memory_order_acquire visible in global namespaceHans Boehm2014-10-201-0/+1
| | | | | | | | We were missing that using directive when including <atomic>. Bug:17736764 Change-Id: Ie8ca92a952749415567bcd5fa21d56629a364660 (cherry picked from commit 76ac4d0853c3bba0c65edc98a9cdf932c452e252)
* Merge "Return total footprint, not high water mark." into lmp-mr1-devChristopher Ferris2014-10-131-1/+3
|\
| * Return total footprint, not high water mark.Christopher Ferris2014-10-131-1/+3
| | | | | | | | | | | | | | | | | | | | The mallinfo usmblks value returned by dlmalloc is a little misleading. It's not the current max, it's the historical high water mark. This leads to dumpsys meminfo producing native memory numbers that don't add up. Change this to the real total footprint, not this high water mark. Bug: 17265653 Change-Id: Id0293a1b50c9b0be8795405049f537a51ab0e8b7
* | am c891e240: Add back symbols to fix Greed for Glory franchise.Christopher Ferris2014-10-101-6/+8
|\ \ | | | | | | | | | | | | * commit 'c891e24073830e07ba7373dee554ff2c70e1d313': Add back symbols to fix Greed for Glory franchise.
| * | Add back symbols to fix Greed for Glory franchise.Christopher Ferris2014-10-091-6/+8
| | | | | | | | | | | | | | | Bug: 17813018 Change-Id: Id939426ee5303117b9601e7915fcfec5024fc621
* | | Fix pthread_attr_getstack under valgrind.Elliott Hughes2014-10-101-3/+8
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | valgrind seems to mess with the stack enough that the kernel will report "[stack:pid]" rather than "[stack]" in /proc/self/maps, so switch to the task-specific file instead to force "[stack]". (There are two conditions in the kernel code that decides which form to output.) Bug: 17897476 (cherry picked from commit 9afb2f2106a5d659854c175c574c1c31e0e205a2) Change-Id: I92c331ef6fb5868af49e75bc595710d290a95f5b
* | am c9734d24: Re-add dlmalloc for 32 bit.Christopher Ferris2014-10-092-3/+12
|\ \ | |/ | | | | | | * commit 'c9734d24d92f4737f5ab3808c77d816a1b084582': Re-add dlmalloc for 32 bit.
| * Re-add dlmalloc for 32 bit.Christopher Ferris2014-10-092-3/+12
| | | | | | | | | | | | | | | | | | It turns out that appportable has a version that calls dlmalloc directly. Re-add the dlmalloc symbol for 32 bit only as a compatibility shim that calls malloc. Bug: 17881362 Change-Id: I8f20963b0b8d323489dc083e4063779e0d1d7447
| * Work around a bug in Immersion's libImmEmulatorJ.so.Elliott Hughes2014-10-072-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | This library calls pthread_mutex_lock and pthread_mutex_unlock with a NULL pthread_mutex_t*. This gives them (and their users) one release to fix things. Bug: 17443936 (cherry picked from commit 7d3f553f989f830976efa92ddc3c84661d4d42aa) Change-Id: Ie26bbecd3a74d61113b51c18832872499b97ee86 (cherry picked from commit b5e7eba6d1b97e471996fcfe7dbde7cbba7512ef)
* | Inline helpers need to be exported unmangled.Dan Albert2014-10-079-44/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | __open_2() is used by the fortify implementation of open(2) in fcntl.h, and as such needs an unmangled C name. For some reason (inlining?), this doesn't cause problems at the default optimization level, but does for -O0. The rest of these didn't cause build failures, but they look suspect and probably will, we just haven't caught them yet. (cherry-pick of 658727e111ed6dee7be5239494f0764f7b1b02f8 with conflicts in stdio.h and string.h.) Bug: 17784968 Change-Id: I7391a7a8999ee204eaf6abd14a3d5373ea419d5b
* | cdefs.h: add artificial attribute to FORTIFY_SOURCE functionsNick Kralevich2014-10-071-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise the gcc compiler warning doesn't show up. Add -Wno-error to fortify related tests. Fortify related tests are expected to be examples of bad programs, and in many cases shouldn't compile cleanly. Rewriting them to compile cleanly isn't feasible nor desirable. Bug: 17784968 (cherry picked from commit 1aaa17802c92d99ae170245c2b2f15a6c27b133e) Change-Id: Ib6df1a3f44b55b1fff222e78395c10c51cd39817
* | Work around a bug in Immersion's libImmEmulatorJ.so.Elliott Hughes2014-10-072-2/+14
| | | | | | | | | | | | | | | | | | | | | | This library calls pthread_mutex_lock and pthread_mutex_unlock with a NULL pthread_mutex_t*. This gives them (and their users) one release to fix things. Bug: 17443936 (cherry picked from commit 7d3f553f989f830976efa92ddc3c84661d4d42aa) Change-Id: Ie26bbecd3a74d61113b51c18832872499b97ee86
* | Improve <sys/cdefs.h>.Elliott Hughes2014-10-0711-281/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix and use __RENAME (and lose ___RENAME --- two underscores should be enough for anybody). This was the point of this change, because I want to use __RENAME to support the two basename variants and the two strerror_r variants. Lose a bunch of macros that weren't being used. Lose three dead files from the DNS code. Bug: 17784968 (cherry picked from commit 2cfb4e8e2e217ef0e4140dcbf9b3da809781158c) Change-Id: I5e96146f92c0521248c78c0933bec5e9a9818222
* | Merge "further cleanup memcpy fortify implementation" into lmp-mr1-devElliott Hughes2014-10-071-5/+1
|\ \
| * | further cleanup memcpy fortify implementationNick Kralevich2014-10-061-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | Bug: 17784968 (cherry picked from commit b84f667e9312611536a564700daea11c12b6fcfa) Change-Id: I68fc2cc0a1ee7f0887edf3681eb83ef678de1383
* | | am d11eac34: Force export symbols on all x86 variants in libc.Christopher Ferris2014-10-073-5/+22
|\ \ \ | |/ / |/| / | |/ | | * commit 'd11eac3455a059a092ceee92eda9905e1d661e94': Force export symbols on all x86 variants in libc.
| * Force export symbols on all x86 variants in libc.Christopher Ferris2014-10-063-5/+22
| | | | | | | | | | | | | | | | | | | | For silvermont, the __popcountsi2 symbol does not get exported by libc. But for atom, this symbol is exported. Since we already exported this symbol for previous releases, it's better to just follow through and force the export, but only for 32 bit. x86 64 bit will not export this symbol. Bug: 17681440 Change-Id: I6c62245f0960910f64baaaf6d9d090bf3ea5f435
* | string.h: remove unused variableNick Kralevich2014-10-061-1/+0
| | | | | | | | | | | | | | (cherry picked from commit 48be71d02b6cc4e6493d38cdd6b7779032c38901) Bug: 17784968 Change-Id: Iac7732fb4f7fe42977cb9f62472bb636e17e5232