summaryrefslogtreecommitdiff
path: root/libpthread
AgeCommit message (Collapse)Author
2012-01-15libc: build abort with unwind-info for backtraceBernhard Reutner-Fischer
If backtrace support is turned on, build raise() and abort() with unwind info (fixup 4c9b7f3c21ff21c199e54bfad2fdf3445fa4573d). Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-01-14linuxthreads/signals: do not restore handler for invalid signalMarkos Chandras
Invalid signals have no handlers so when trying to restore the old handler to a bad signal a SIGSEGV occurs. This is because the library tries to store the old handler to an invalid memory area where it things the bad signal lives. URL: https://bugs.busybox.net/show_bug.cgi?id=4640 Signed-off-by: Markos Chandras <markos.chandras@imgtec.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-01-13libc: allow to backtrace out of abort callCarmelo Amoroso
Build raise and abort function with dwarf2 info by using -fasynchronous-unwind-tables to make backtrace() working across a call to abort. A scenario where it could be useful is within a signal handler that wants to dump a backtrace when catching some signal (i.e SIGABRT). Without having abort & raise built with DWARF2 information, it is not possible for the libgcc stack unwinder to walk through the call stack out of the abort/raise function. Impacts in terms of size are really limited Current text data bss dec hex filename 164 0 0 164 a4 ./libpthread/nptl/sysdeps/unix/sysv/linux/raise.os 164 0 0 164 a4 ./libpthread/nptl/sysdeps/unix/sysv/linux/raise.oS 220 24 4 248 f8 ./libc/stdlib/abort.os With (-fasynchronous-unwind-tables) text data bss dec hex filename 216 0 0 216 d8 ./libpthread/nptl/sysdeps/unix/sysv/linux/raise.os 216 0 0 216 d8 ./libpthread/nptl/sysdeps/unix/sysv/linux/raise.oS 280 24 4 308 134 ./libc/stdlib/abort.os Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com> Acked-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-11-24nptl: add missing pt-tempname.cBernhard Reutner-Fischer
fix bd3c1a2495cbcb51b606f8e4892fcd127f91e645 forgotten file. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-11-18nptl: sem_open: use open64 if LFSBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-11-17misc: hide __gen_tempnameBernhard Reutner-Fischer
fix signed vs. unsigned comparison warnings while at it Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-10-27sparc: fix build for linuxthreads.oldRob Landley
sparc target has assembly implementations of clone.S that doesn't get used, and thus the build breaks. Also, sparc is missing a header file in pthreads.old that exists in pthreads.new. Signed-off-by: Rob Landley <rob@landley.net> Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
2011-10-27pthreads: fix build when DNS resolver is not enabled.Bernhard Reutner-Fischer
Resolver state is only available if DNS resolver is enabled. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
2011-10-27linuxthreads: fix typo in __UCLIBC_HAS_IPv4__ macroCarmelo Amoroso
IPv4 should has 'V' capital letter. Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
2011-06-14buildsys: pt-initfini.s depends on uClibc_config.hBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-06-13nptl/pthread: Correct path for machine specific pt-initfini.cKhem Raj
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2011-06-13ctor/dtor nptl: Fix init and fini function compilationKhem Raj
We need to define the rules for .S files so it gets the include paths some architectures like mips include headers Some architectures e.g. SH have their own version of pt-initfini.c so look for that first before resorting to generic version of pt-initfini.c Signed-off-by: Khem Raj <raj.khem@gmail.com>
2011-06-10nptl/Makefile.in: Fix the build break caused by UCLIBC_CTOR_DTOR enablingKhem Raj
Extra / somehow does not match the target and complains that $(top_builddir)libpthread/nptl/sysdeps/pthread/crti.o has no rules to build Signed-off-by: Khem Raj <raj.khem@gmail.com>
2011-05-31NPTL: Fix CTOR_DTORBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-05-13unwind.h: Move to libc/sysdeps from nptl sysdepsKhem Raj
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2011-05-13epoll.c: add cancellation to epoll_[p]wait()Peter S. Mazinger
While there, fix epoll_pwait syscall, it takes 6 arguments Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-05-11commentary typo fixBernhard Reutner-Fischer
s/decriptor/descriptor/ Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-05-11commentary typo fixBernhard Reutner-Fischer
use cancellation (with two 'l') uniformly. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-05-11lll: avoid shadow warningsBernhard Reutner-Fischer
use __ret uniformly to avoid shadow warnings as seen on x86_64. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-05-11libubacktrace: mv unwind.h to includeBernhard Reutner-Fischer
Fixes compilation if NPTL is off. I hope this doesn't break ARM EABI but cannot check ATM. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-03-09remove trailing ';' from _syscallX()Peter S. Mazinger
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
2011-03-08nptl: fix compilation on x86_64William Pitcock
This commit gives us a fully functioning NPTL on x86-64 by using the GOTOFF macro as needed. Signed-off-by: William Pitcock <nenolod@dereferenced.org> Signed-off-by: Khem Raj <raj.khem@gmail.com>
2011-03-05The C6X portAurelien Jacquiot
This adds support for the TI C6X family of processors. Signed-off-by: Mark Salter <msalter@redhat.com> Signed-off-by: Aurelien Jacquiot <a-jacquiot@ti.com> Signed-off-by: Bernd Schmidt <bernds@codesourcery.com>
2011-03-05Allow ABIs where SP points below the stack frame.Bernd Schmidt
On C6X, the stack pointer points to a word that is not part of the current function's stack frame. It may be overwritten by callees. Take this into account when creating the stack for a cloned thread. Signed-off-by: Bernd Schmidt <bernds@codesourcery.com>
2011-03-05Add Makefile support for DSBT ELF.Bernd Schmidt bernds_cb1@t-online.de
This adds support for a new binary format, DSBT ELF, to the Makefiles. Every shared library is assigned a DSBT index, and the link.so macro is adjusted to ensure the correct linker argument is passed. Configuration and ldso support will follow in separate commits. Signed-off-by: Bernd Schmidt <bernds@codesourcery.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-03-04nptl: fix use of IS_IN_LIBPTHREAD macroCarmelo Amoroso
IS_IN_LIBPTHREAD should be IS_IN_libpthread instead. Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
2011-03-03remove ucontext.h and guard sigstack structure with SUSV4_LEGACY and ↵Peter S. Mazinger
STRICT_HEADERS Remove ucontext.h if SUSV4_LEGACY is not set and fix it's references. Guard sigstack structure with SUSV4_LEGACY and STRICT_HEADERS. Disable sigstack function prototype, it is not provided by uClibc. Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
2011-03-03add missing prototypesPeter S. Mazinger
Add some missing prototypes Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
2011-03-03use common sigthread.hPeter S. Mazinger
NPTL build did not use the correct bits/sigthread.h, use a common version avoiding this. Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
2011-03-03add missing prototypesPeter S. Mazinger
Add some missing prototypes Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
2011-03-03syntax fixesPeter S. Mazinger
Avoid compile warnings about the use of undefined constants Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
2011-03-03avoid warnings on _STACK_GROWS_* usagePeter S. Mazinger
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
2011-02-25nptl:arm: add a wrapper for .cfi_sections pseudo-opsCarmelo Amoroso
ARM disables by default the support for ASM CFI directives. Anyway using an old version of binutils that does not support some new pseudo-op, the build fails as below: AS libpthread/nptl/sysdeps/unix/sysv/linux/close.oS libpthread/nptl/sysdeps/unix/sysv/linux/close.S: Assembler messages: libpthread/nptl/sysdeps/unix/sysv/linux/close.S:9: Error: unknown pseudo-op: `.cfi_sections' The problem is that the .cfi_sections pseudo should be wrapped by a macro that expands to nothing when the CFI is off. Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com> CC: Khem Ray <ray.khem@gmail.com>
2011-02-24linuxthreads.old: fix nommu initial thread stack detectionMike Frysinger
Because the nommu address space is flat, and the application stack can literally be located anywhere, we cannot rely on the assumptions that the mmu port gets away with. Namely, that the first thread's stack lives at the top of memory and nothing will be created above it. Currently, the code rounds the current stack up a page and sets that as the "top" of the stack, and then marks the "bottom" of the stack as "1". Then as new threads are created, this assumption is further refined by slowly backing off the "bottom" when a new stack is created within the range of the initial stack. Simple ascii example (tid0 is the initial thread): 1 thread: [bos tid0 stack tos] 2 threads: [ tid0 stack ] [tid1 stack] 3 threads: [ tid0 stack ] [tid1 stack] [tid2 stack] As you can kind of see, this algorithm operates on one basic assumption: the initial top of stack calculation is the absolute top of the stack. While this assumption was fairly safe in the original nommu days of yore where the only file format was FLAT (which defaults to a 4KiB stack -- exactly 1 page), and memory was fairly tight, we can see that this falls apart pretty quickly as soon as the initial stack is larger than a page. The issue that crops up now is simple to hit: start an application with an 8KiB stack, execute some functions that put pressure on the stack so that it exceeds 4KiB, then start up some threads. The initial tos will be rounded up by a page, but this is actually the middle of the stack. Now when the initial thread returns from its functions (thus unwinding the stack) and tries to call something which calls back into libpthread, the thread_self() func fails to detect itself as the initial thread as the current stack is now above the tos. The __pthread_find_self() func kicks in, walks all the thread arrays, fails to find a hit, and then walks into uninitialized memory for the thread descriptor. Use of this garbage memory has obvious results -- things fall down & go boom. To address this, I extend the current algorithm to automatically scale back both the bottom and the top stack limits of the initial thread. We use the current stack pointer at "thread boot time" only as a single known point. The initial thread stack bottom is set to the bottom of memory and the initial thread stack top is set to the top of memory. Then as we create new stack threads, we figure out whether the new stack is above or below the single known good address, and then scale back either the tos or the bos accordingly. Reviewed-by: Steven J. Magnani <steve@digidescorp.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-02-09arm: mv nptl specific atomic impl to common placeBernhard Reutner-Fischer
Thanks to Nitin Garg for notincing! Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-02-02arm: fix the static link problem for ARM due to undefined __tls_get_addrNitin Garg
Signed-off-by: Nitin Garg <nitingarg98@gmail.com> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
2011-01-29nptl/mips64: Fix build when using mips64 and ABIs other than o32Khem Raj
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2011-01-20nptl: Fix __USER_LABEL_PREFIX__ concatenatioWill Newton
The current C macro magic does not correctly concatenate the __USER_LABEL_PREFIX__ string on architectures where it has a non-empty value. We need to use __stringify to get the desired behaviour. Signed-off-by: Will Newton <will.newton@imgtec.com> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
2011-01-20nptl: fix start_thread() for _STACK_GROWS_UPWill Newton
This patch adds a working implementation of pthread_create for architectures where STACK_GROWS_UP. Signed-off-by: Matt Fleming <matthew.fleming@imgtec.com> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
2011-01-05nptl: get rid of the last preprocessor warning when __ASSUME_TGKILL is not ↵Carmelo Amoroso
defined A missing change in the previous commit. Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
2011-01-04nptl: get rid of preprocessor warning when __ASSUME_TGKILL is not definedCarmelo Amoroso
A sample of the warning reported while building for ARM that has not __ASSUME_TGKILL defined. libpthread/nptl/sysdeps/unix/sysv/linux/raise.c: In function 'raise': libpthread/nptl/sysdeps/unix/sysv/linux/raise.c:33:5: warning: "__ASSUME_TGKILL" is not defined Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
2010-12-29sparc: fix linking issue with __syscall_error.cAustin Foxley
Finally got around to testing out latest master and noticed that some buildsystem work last summer broke shared-builds of nptl on sparc. A version of __syscall_error.c needs to be linked into both libpthread and librt Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
2010-12-23linuxthreads: Fix compilation breakageMatt Fleming
With commit "resolv.c: add support for per thread res_state" (aab4df0fb51660300559f5f29290709db2f7bfee) _res symbol is now marked as hidden in an attempt to make the resolver per-thread. Signed-off-by: Matt Fleming <matthew.fleming@imgtec.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2010-12-21libpthread/nptl_db: Append options to LDFLAGS based on if LD is set to gcc ↵Khem Raj
driver or ld itself Signed-off-by: Khem Raj <raj.khem@gmail.com>
2010-12-18sem_open.c/sem_unlink.c: Use INTUSE macro to get proper function call to ↵Khem Raj
__pthread_once We need to use __pthread_once_internal if available this macro is therefore used to notify that. Signed-off-by: Khem Raj <raj.khem@gmail.com>
2010-12-18nptl: If DOPIC is set then we missed a rule to generate .os variants for ↵Khem Raj
pt-*.c files Signed-off-by: Khem Raj <raj.khem@gmail.com>
2010-12-09nptl: fix Unwind_Resume PLT callsTimo Teräs
My change a49b3a18e463cbe8c94c41501e386e7f4c61609e fixed two Unwind_Resume calls to go via PLT to avoid text relocations for PIC builds. However, it looks the reason for upstream not using PLT calls is that ebx gets clobbered. So we need to reload it. Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
2010-12-01libc_sh: add __tls_get_addr to static libc (SH)Filippo Arcidiacono
Add __tls_get_addr function to static libc allowing to handle local dynamic TLS access model. On SH, linker optimizations are not required, so __tls_get_addr can be called even in statically linked binaries. Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
2010-12-01Revert "libc_tls: Do not include generic libc-tls from arch specific ↵Carmelo Amoroso
implementation" This reverts commit 0c468129356f5ce6780e7369c271d74631ae03ba. Indeed recent updates into buildsys managed to filter-out generic implementation when arch specific one is defined, so duplicated symbols into the libc.a In the meanwhile, do a minor fix into mips version not using relative path to include <generic/libc-tls.c> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
2010-11-29libc_tls: Do not include generic libc-tls from arch specific implementationCarmelo Amoroso
libpthread/nptl/sysdeps/generic/libc-tls.c is built as well, so it does not need that arch specific version of libc-tls.c (MIPS and ALPHA) includes it. The arch libc-tls.s is aimed to provide the implementation of __tls_get_addr for the static libc.a, because on these archs the linker relaxations are not required and it could be possible to have local-dynamic access models in static libraries as well. Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>