summaryrefslogtreecommitdiff
path: root/libpthread/nptl/sysdeps/generic/libc-tls.c
AgeCommit message (Collapse)Author
2020-09-02Revert "Fix static linking with GCC-10"Waldemar Brodkorb
This reverts commit 5b58a1ebd89a4f05778441814e81817c82193fa3. This breaks all static builds earlier to gcc 10 :( Bad testing on my side.
2020-08-11Fix static linking with GCC-10Lance Fredrickson
Starting with GCC-10 multiple definitions of global variables by will be rejected. https://gcc.gnu.org/gcc-10/porting_to.html This fixes multiple definitions of _dl_pagesize and _dl_tls_static_size while attempting static linking. Of course this only occurs when compiling something that requires these symbols. First patch submission so hopefully all done correctly. thanks, Lance Fredrickson From e0686f7c03ce8e51ccffefeb6365e50311e6dd10 Mon Sep 17 00:00:00 2001 From: lancethepants <lancethepants@gmail.com> Date: Wed, 15 Jul 2020 13:09:26 -0600 Subject: [PATCH] Starting with GCC-10 multiple definitions of global variables by will be rejected. This fixes multiple definitions of _dl_pagesize and _dl_tls_static_size while attempting static linking.
2019-04-14Fix _dl_deallocate_tls in !SHARED caseYann Sionneau
This patch seems needed in builds where - SHARED is not defined (no shared lib support) - and USE_TLS is set Without this patch, static_dtv is free'ed. See the following backtrace: 0 __do_check_chunk (p=0x52638 <fork_handler_pool+2296>) at libc/stdlib/malloc-standard/malloc.c:80 1 0x0000000000017fa0 in __do_check_inuse_chunk (p=0x52638 <fork_handler_pool+2296>) at libc/stdlib/malloc-standard/malloc.c:143 2 0x0000000000017354 in free (mem=0x52648 <static_dtv>) at libc/stdlib/malloc-standard/free.c:293 3 0x000000000002d5b0 in _dl_deallocate_tls (tcb=0x58690, dealloc_tcb=false) at libpthread/nptl/sysdeps/generic/dl-tls.c:588 4 0x0000000000021c0c in __deallocate_stack (pd=0x58000) at libpthread/nptl/allocatestack.c:717 5 0x0000000000024408 in __free_tcb (pd=0x58000) at libpthread/nptl/pthread_create.c:217 6 0x00000000000200ac in pthread_join (threadid=360448, thread_return=0x0 <k1c_start>) at libpthread/nptl/pthread_join.c:109 7 0x0000000000010354 in tf (a=0x58000) at tst-basic3.c:42 8 0x00000000000247c8 in start_thread (arg=0x4000200960) at libpthread/nptl/pthread_create.c:285 9 0x0000000000026560 in ?? () This backtrace is obtained while debugging tst-basic3 from the uclibc-ng nptl testsuite. It aborts because of the assert in malloc: https://elixir.bootlin.com/uclibc-ng/v1.0.31/source/libc/stdlib/malloc-standard/malloc.c#L80 Signed-off-by: Yann Sionneau <ysionneau@kalray.eu>
2018-08-10nptl: Replace sbrk with mmapChristophe Lyon
Replace sbrk with mmap since this commit disables sbrk area for FDPIC MMU-less platform: fs/binfmt_elf_fdpic.c: fix brk area overlap with stack on NOMMU https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/fs/binfmt_elf_fdpic.c?id=4ac313111018cb44ecc250445de5ccb93026a980 * libpthread/nptl/sysdeps/generic/libc-tls.c (__libc_setup_tls): Handle __FDPIC__. Signed-off-by: Mickaël Guêné <mickael.guene@st.com> Signed-off-by: Christophe Lyon <christophe.lyon@st.com>
2018-08-10nptl: Clear TLS area for static binaries.Christophe Lyon
busybox init checks it has pid 1, but getpid() returns another value when building busybox statically. This is because the corresponding area is not cleared when allocated (it is allocated with MAP_UNINITIALIZED, whose behavior depends on the Linux kernel's CONFIG_MMAP_ALLOW_UNINITIALIZED). This patch fixes the problem by explicitly clearing the memory area. * libpthread/nptl/sysdeps/generic/libc-tls.c (__libc_tls_setup): Clear tlsblock. Signed-off-by: Mickaël Guêné <mickael.guene@st.com> Signed-off-by: Christophe Lyon <christophe.lyon@st.com>
2018-08-10nptl: Use linker-defined symbol to find start of .tdata section.Christophe Lyon
phdr->p_vaddr of TLS segment is not a valid value for FDPIC so we can either translate phdr->p_vaddr using loadmap (not easy here) or use a new linker script defined symbol, whih this patch does. * libpthread/nptl/sysdeps/generic/libc-tls.c (__tdata_start): Declare. (__libc_setup_tls): Support __FDPIC__. Signed-off-by: Mickaël Guêné <mickael.guene@st.com> Signed-off-by: Christophe Lyon <christophe.lyon@st.com>
2016-11-30NONTLS_INIT_TP is never defined, remove dead codeWaldemar Brodkorb
2012-11-18Replace FSF snail mail address with URLsMike Frysinger
This matches a similar change made to glibc. No functional changes here. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-03-03add missing prototypesPeter S. Mazinger
Add some missing prototypes 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>
2009-10-17libpthread/nptl: core of the "Native Posix Threading Library" for uClibcAustin Foxley
targetting arm,sh,i386,mips,sparc for now Signed-off-by: Austin Foxley <austinf@cetoncorp.com>