summaryrefslogtreecommitdiffstats
path: root/libc/arch-arm/bionic
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Stop libc from cross-referencing unwind symbols"Dan Albert2015-07-201-93/+0
| | | | | | | | This reverts commit cd13b14e98d4921af126667fae0cf6613a5615c5. Bug: http://b/19958712 Change-Id: I7cc7f69728c42c37e129aee30d761c4cd7e30e94 (cherry picked from commit 95fd031c4d22b90c542621170bb6d4d05bb94457)
* Simplify three copyright headers.Elliott Hughes2015-05-121-1/+1
| | | | | | | | | There's no reason to have multiple years in our own copyright headers, and given the stupidity of our NOTICE file generation, it just creates more junk. Change-Id: I065a3811c2e2584e3b649a18ad9460286bc72b92 (cherry picked from commit c69ace87ec110a91005bdf19dbafeb355f399c06)
* Stop libc from cross-referencing unwind symbolsDmitriy Ivanov2015-04-071-0/+93
| | | | | | | | | | | | | This makes unwind symbols 'protected', which should prevent them from relocating against libc++.so/libcutls.so. This is temporary file and it is going to be removed once libc.so stops exporting them. Bug: http://b/19958712 Change-Id: I96a765afe47e68d2e2ceb288870e63a25ca52081
* Use ALIAS_SYMBOL for assembler aliasing.Christopher Ferris2015-03-251-4/+2
| | | | Change-Id: I8d04d2da0a1ac440cc9044fc819c9a8eda5ff17d
* Move the generic arm memcmp.S into the generic directory.Elliott Hughes2014-12-151-343/+0
| | | | Change-Id: I48e4d14a0dcddbb246edbac6d0329619574ab44d
* Remove arm assembler not referenced from any makefile.Elliott Hughes2014-12-143-1617/+0
| | | | | | | I also suspect that libc/arch-arm/bionic/memcmp.S is supposed to like in the generic directory these days, but this change just removes dead code. Change-Id: I9072488df6e9b7261d79b6014914a0e937cb387b
* Fix arm64 clone stack handling.Elliott Hughes2014-12-101-2/+5
| | | | | | | Make sure we adjust the stack pointer so a signal can't overwrite data. Bug: 15195265 Change-Id: I5ab9469a82cb214c32f40a713268a1ab74a4c6fa
* Use the stmdb instead of str to save the fn/argJiangli Yuan2014-12-101-4/+2
| | | | | | | | | | Directly save data into stack without properly adjustment of stack point is dangous. For example, if a signal comes, kernel will put sigframe into userspace's stack, which will overwrite the saved data if sp is not adjusted properly. Bug: 15195265 Change-Id: Iea0cadfd3b94d50cf40252ad52fe5950811b9192 Signed-off-by: Jiangli Yuan <a6808c@motorola.com>
* Switch arm and arm64 over to the x86 style of jmpbuf.Elliott Hughes2014-12-081-20/+10
| | | | | | | | Specifically, use the argument to sigsetjmp as a flag in the buffer to indicate whether or not the signal mask is valid. Bug: 16918359 Change-Id: I5bb1f1220f14c105c6bc57e0c28c1dc366d1438f
* Fix signal mask save/restore for arm64.Elliott Hughes2014-12-061-1/+0
| | | | | Bug: 16918359 Change-Id: Ieb15f7f1658f5accee05665b72ba17831a80ea9d
* Clean up arm setjmp family.Elliott Hughes2014-12-053-265/+146
| | | | | Bug: 16918359 Change-Id: I9b986bdbdbaefe9d9896a820ee8cfe860adfe5c5
* Clean up the arm64 setjmp.Elliott Hughes2014-12-052-17/+4
| | | | | | | | Note that this doesn't address the fact that we don't save/restore the real-time signals. But it does let us pass the tests we currently fail. Bug: 16918359 Change-Id: I063a6926164289a71026a412da7f5dd2ca9a74b3
* Remove __ARM_HAVE_VFP.Elliott Hughes2014-12-032-12/+0
| | | | | Bug: 18556103 Change-Id: I6d4cc6a1b359ad2df1ce6687fd26f392059f6efd
* Make __aeabi_*() symbols weak.Dan Albert2014-09-261-13/+16
| | | | | | | This is needed to avoid multiple symbol definitions when linking with libstdc++ or with compiler-rt. Change-Id: I2f713bcff113222f0d2538e49691e715d8a8475d
* Fix 32-bit arm unwinding through signal frames.Elliott Hughes2014-09-162-36/+27
| | | | | | | gdb was already okay; libgcc and libunwind need a little extra help. Bug: 17436734 Change-Id: I1f5108f9877373be078554a1ea4938aa4436204e
* Fix signal trampolines.Elliott Hughes2014-09-152-0/+70
| | | | | | | | | | | | | | | | | | | | | | * 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... Bug: 17436734 Change-Id: Ic1ea1184db6655c5d96180dc07bcc09628e647cb
* Ensure __set_errno is still visible on LP32.Elliott Hughes2014-09-082-2/+2
| | | | | | | | | | | | | | | | | | The use of the .hidden directive to avoid going via the PLT for __set_errno had the side-effect of actually making __set_errno hidden (which is odd because assembler directives don't usually affect symbols defined in a different file --- you can't even create a weak reference to a symbol that's defined in a different file). This change switches the system call stubs over to a new always-hidden __set_errno_internal and has a visible __set_errno on LP32 just for binary compatibility with old NDK apps. (cherry-pick of 7efad83d430f4d824f2aaa75edea5106f6ff8aae.) Bug: 17423135 Change-Id: I6b6d7a05dda85f923d22e5ffd169a91e23499b7b
* Fix pthread_getattr_np for the main thread.Elliott Hughes2014-08-261-34/+0
| | | | | | | | | | | | | | | | | | | | On most architectures the kernel subtracts a random offset to the stack pointer in create_elf_tables by calling arch_align_stack before writing the auxval table and so on. On all but x86 this doesn't cause a problem because the random offset is less than a page, but on x86 it's up to two pages. This means that our old technique of rounding the stack pointer doesn't work. (Our old implementation of that technique was wrong too.) It's also incorrect to assume that the main thread's stack base and size are constant. Likewise to assume that the main thread has a guard page. The main thread is not like other threads. This patch switches to reading /proc/self/maps (and checking RLIMIT_STACK) whenever we're asked. Bug: 17111575 Signed-off-by: Fengwei Yin <fengwei.yin@intel.com> Change-Id: I1d4dbffe7bc7bda1d353c3a295dbf68d29f63158
* Simplify _ALIGN_TEXT.Elliott Hughes2014-08-201-2/+0
| | | | | Bug: 16872067 Change-Id: I2b622f252c21ce1b344c040f828ab3f4bf9b6c0a
* Remove misleading arm/arm64 PIC_SYM.Elliott Hughes2014-08-074-11/+11
| | | | | Bug: 16823325 Change-Id: Ic8ff3a628bb4cd71361e3a1c2cfde4b3d39c50b1
* Enable building libc with clang.Elliott Hughes2014-07-111-7/+14
| | | | | Bug: 16218205 Change-Id: I024de2044fe016412c7bead22c264e96be4cb39c
* Remove __memcmp16 from bionic.Elliott Hughes2014-06-121-234/+0
| | | | Change-Id: I2486d667d96c8900dd368d855f37c1327161efb7
* Rename __bionic_clone_entry to __start_thread.Elliott Hughes2014-06-061-2/+2
| | | | | | This seems a bit less obscure. Change-Id: I7dc528c253b73c861694f67556ad8f919bf92136
* Revert "Revert "Lose the hand-written futex assembler.""Elliott Hughes2014-05-281-38/+0
| | | | | | | | | | | | | | | | | | | | | | The problem with the original patch was that using syscall(3) means that errno can be set, but pthread_create(3) was abusing the TLS errno slot as a pthread_mutex_t for the thread startup handshake. There was also a mistake in the check for syscall failures --- it should have checked against -1 instead of 0 (not just because that's the default idiom, but also here because futex(2) can legitimately return values > 0). This patch stops abusing the TLS errno slot and adds a pthread_mutex_t to pthread_internal_t instead. (Note that for LP64 sizeof(pthread_mutex_t) > sizeof(uintptr_t), so we could potentially clobber other TLS slots too.) I've also rewritten the LP32 compatibility stubs to directly reuse the code from the .h file. This reverts commit 75c55ff84ebfa686c7ae2cc8ee431c6a33bd46b4. Bug: 15195455 Change-Id: I6ffb13e5cf6a35d8f59f692d94192aae9ab4593d
* Merge "Revert "Lose the hand-written futex assembler.""Narayan Kamath2014-05-281-0/+38
|\
| * Revert "Lose the hand-written futex assembler."Narayan Kamath2014-05-281-0/+38
| | | | | | | | | | | | | | | | | | | | This reverts commit ced906c849704f379d7191822f6d74993d4fa296. Causes issues on art / dalvik due to a broken return value check and other undiagnosed issues. bug: 15195455 Change-Id: I5d6bbb389ecefb0e33a5237421a9d56d32a9317c
* | Clear link register in __bionic_clone.Ben Cheng2014-05-231-7/+2
|/ | | | | | | | | Since __bionic_clone uses tail-call to invoke __bionic_clone_entry, at runtime the unwinder will reach the stack of the clone() function, which belongs to the parent thread, if the link register is not cleared. BUG: 14270816 Change-Id: Ia3711c87f8b619debe73748c28b9fb8691ea698e
* Lose the hand-written futex assembler.Elliott Hughes2014-05-221-38/+0
| | | | | | | Also stop exporting 'futex'. Bug: 12250341 Change-Id: Icc4fa4296cd04dfe0d1061822c69e2eb40c3433a
* Hide most of the private futex functions.Elliott Hughes2014-05-211-33/+2
| | | | | | | | | | Also hide part of the system properties compatibility code, since we needed to touch that to keep it building. I'll remove __futex_syscall4 and futex in a later patch. Bug: 11156955 Change-Id: Ibbf42414c5bb07fb9f1c4a169922844778e4eeae
* Hide __get_sp.Elliott Hughes2014-05-201-1/+1
| | | | | Bug: 11156955 Change-Id: I55d8d320521e80c2085af28933a18b00cf5c714e
* Hide _exit_with_stack_teardown.Elliott Hughes2014-05-161-1/+1
| | | | | Bug: 11156955 Change-Id: Ida3020343c9975177dc324918cd1f10c455eb173
* Hide the __bionic_clone and __bionic_clone_entry implementation details.Elliott Hughes2014-05-081-0/+1
| | | | | | | | | clone(2) is the public symbol. Also switch a test from __bionic_clone to clone; testing public API means the test now works on glibc too. Change-Id: If59def26a00c3afadb8a6cf9442094c35a59ffde
* Fix for libgcc compat generation script.Dmitriy Ivanov2014-04-181-88/+156
| | | | | | | | | Taking into account possibility that external symbol could have been an OBJECT instead of function. b/14090368 Change-Id: Iac173d2dd1309ed53024306578137c26b1dbbf15
* Unify our assembler macros.Elliott Hughes2014-02-2010-11/+11
| | | | | | | | | | | | | | Our <machine/asm.h> files were modified from upstream, to the extent that no architecture was actually using the upstream ENTRY or END macros, assuming that architecture even had such a macro upstream. This patch moves everyone to the same macros, with just a few tweaks remaining in the <machine/asm.h> files, which no one should now use directly. I've removed most of the unused cruft from the <machine/asm.h> files, though there's still rather a lot in the mips/mips64 ones. Bug: 12229603 Change-Id: I2fff287dc571ac1087abe9070362fb9420d85d6d
* Remove useless _C_LABEL from our assembler source.Elliott Hughes2014-02-204-11/+11
| | | | Change-Id: I41a9181537c70ecc69ef8035132c9a83811a40d0
* Added script generating additions to libgcc_compat.c from linker errorsDmitriy Ivanov2014-02-201-166/+80
| | | | | bug: 12234455 Change-Id: Icac35237f06e75745da5a91d9c4c941d7df4f84d
* Add all implicitly loaded symbols from libgcc.a into libgcc_compat.c.Ben Cheng2014-01-241-2/+6
| | | | Change-Id: I0e66a73e849a01817d016a688d7291c2fb604e48
* Re-export libgcc's __aeabi_uidivmod and __popcount_tabBernhard Rosenkränzer2014-01-241-0/+2
| | | | | | | | This is required to make the Nexus 10 graphics driver work on a system compiled with gcc 4.9. Change-Id: If3f3d488652a736d9ea3e583548d74fae3ffa902 Signed-off-by: Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>
* Regenerate the NOTICE files.Elliott Hughes2014-01-071-1/+1
| | | | | | | Also standardize the orthography in a few places to reduce near-duplicates in the NOTICE files. Change-Id: I347c75e817be61ec1b9c5b4b96226feedc8d09ab
* Remove the bogus exit status from _exit_with_stack_teardown.Elliott Hughes2013-12-211-11/+9
| | | | | | | It should always be 0, and there's no reason to pass a constant in as an argument. Change-Id: I92ac59b718a18e298bd7c52821af447f9181ca2a
* Fix aarch64 futex assembly routines.Elliott Hughes2013-12-201-6/+5
| | | | | | | Also make the other architectures more similar to one another, use NULL instead of 0 in calling code, and remove an unused #define. Change-Id: I52b874afb6a351c802f201a0625e484df6d093bb
* Add __popcountsi2 to the function compat list.Ben Cheng2013-12-191-0/+1
| | | | | | | | This is needed if we use Clang to compile Bionic, which won't include __popcountsi2 anymore as Clang generates inline instructions. However prebuilt binary blobs still depend on libc.so to resolve __popcountsi2. Change-Id: I9001a3884c4be250c0ceebcd79922783fae1a0b7
* Clean up some ARMv4/ARMv5 cruft.Elliott Hughes2013-12-133-26/+26
| | | | Change-Id: I29e836fea4b53901e29f96c6888869c35f6726be
* Add cfi directives to all arm assembly.Christopher Ferris2013-12-029-150/+38
| | | | | | | | | | | | | | | | | | | | | | Since the ENTRY/END macros now have .cfi_startproc/.cfi_endproc, most of the custom arm assembly has no unwind information. Adding the proper cfi directives for these and removing the arm directives. Update the gensyscalls.py script to add these cfi directives for the generated assembly. Also fix the references to non-uapi headers to the proper uapi header. In addition, remove the kill.S, tkill.S, tgkill.S for arm since they are not needed at all. The unwinder (libunwind) is able to properly unwind using the normal abort. After this change, I can unwind through the system calls again. Bug: 11559337 Bug: 11825869 Bug: 11321283 Change-Id: I18b48089ef2d000a67913ce6febc6544bbe934a3
* Clean up forking and cloning.Elliott Hughes2013-11-191-0/+0
| | | | | | | | | 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
* Switch pthread_create over to __bionic_clone.Elliott Hughes2013-11-152-52/+5
| | | | | | Bug: 8206355 Bug: 11693195 Change-Id: I04aadbc36c87e1b7e33324b9a930a1e441fbfed6
* Stop using the non-uapi <linux/err.h> header file.Elliott Hughes2013-11-075-14/+5
| | | | | | | 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
* Let the compiler worry about implementing ffs(3).Elliott Hughes2013-10-241-41/+0
| | | | | | It does at least as good a job as our old hand-written assembly anyway. Change-Id: If7c4a1ac508bace0b71ee7b67808caa6eabf11d2
* AArch64: Fix uses of stack size for 32/64bit libc buildsSerban Constantinescu2013-10-221-1/+1
| | | | | | | This patch fixes stack size uses to size_t. Change-Id: I0671c85ddb1c1aceaf9440a7c73c21fe528653fa Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
* Fix x86_64 build, clean up intermediate libraries.Elliott Hughes2013-10-091-1/+2
| | | | | | | | | | | | | | | | | | | | | | The x86_64 build was failing because clone.S had a call to __thread_entry which was being added to a different intermediate .a on the way to making libc.so, and the linker couldn't guarantee statically that such a relocation would be possible. ld: error: out/target/product/generic_x86_64/obj/STATIC_LIBRARIES/libc_common_intermediates/libc_common.a(clone.o): requires dynamic R_X86_64_PC32 reloc against '__thread_entry' which may overflow at runtime; recompile with -fPIC This patch addresses that by ensuring that the caller and callee end up in the same intermediate .a. While I'm here, I've tried to clean up some of the mess that led to this situation too. In particular, this removes libc/private/ from the default include path (except for the DNS code), and splits out the DNS code into its own library (since it's a weird special case of upstream NetBSD code that's diverged so heavily it's unlikely ever to get back in sync). There's more cleanup of the DNS situation possible, but this is definitely a step in the right direction, and it's more than enough to get x86_64 building cleanly. Change-Id: I00425a7245b7a2573df16cc38798187d0729e7c4