summaryrefslogtreecommitdiffstats
path: root/libpthread/nptl/sysdeps/generic/libc-tls.c
diff options
context:
space:
mode:
author"Steven J. Hill" <sjhill@realitydiluted.com>2005-07-31 03:17:26 +0000
committer"Steven J. Hill" <sjhill@realitydiluted.com>2005-07-31 03:17:26 +0000
commit4e4163c84b41138f68634bd60300f6407ceec8df (patch)
tree057561d6c68551e5616345ae6d173e589226b5bb /libpthread/nptl/sysdeps/generic/libc-tls.c
parent5907a96392145dcc56d004010f54fbe935e40841 (diff)
downloaduClibc-alpine-4e4163c84b41138f68634bd60300f6407ceec8df.tar.bz2
uClibc-alpine-4e4163c84b41138f68634bd60300f6407ceec8df.tar.xz
Properly link in needed TLS functions for the static C library. Added the new low-level locking primitives to the C library for both static and shared. Added the new file 'dl-tls.c' from glibc which should be the final code necessary to fully link all the libraries for a NPTL-based uClibc.
Diffstat (limited to 'libpthread/nptl/sysdeps/generic/libc-tls.c')
-rw-r--r--libpthread/nptl/sysdeps/generic/libc-tls.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/libpthread/nptl/sysdeps/generic/libc-tls.c b/libpthread/nptl/sysdeps/generic/libc-tls.c
index a8f680013..361c74c17 100644
--- a/libpthread/nptl/sysdeps/generic/libc-tls.c
+++ b/libpthread/nptl/sysdeps/generic/libc-tls.c
@@ -24,8 +24,10 @@
#include <stdio.h>
#include <sys/param.h>
#ifdef __UCLIBC__
+#include <elf.h>
#include <link.h>
#include <string.h>
+
#define __sbrk sbrk
#endif
@@ -149,6 +151,7 @@ __libc_setup_tls (size_t tcbsize, size_t tcbalign)
IE-model TLS. */
# if TLS_TCB_AT_TP
tcb_offset = roundup (memsz + GL(dl_tls_static_size), tcbalign);
+ tlsblock = __sbrk (tcb_offset + tcbsize + max_align);
# elif TLS_DTV_AT_TP
tcb_offset = roundup (tcbsize, align ?: 1);
tlsblock = __sbrk (tcb_offset + memsz + max_align
@@ -197,15 +200,7 @@ __libc_setup_tls (size_t tcbsize, size_t tcbalign)
# error "Either TLS_TCB_AT_TP or TLS_DTV_AT_TP must be defined"
# endif
if (__builtin_expect (lossage != NULL, 0))
-#ifdef __UCLIBC__
- /*
- * FIXME: Implement something similar to what is used in glibc
- * found in 'sysdeps/unix/sysv/linux/libc_fatal.c'.
- */
- fprintf(stderr, "FAILED TLS allocation!!!!\n");
-#else
__libc_fatal (lossage);
-#endif
/* We have to create a fake link map which normally would be created
by the dynamic linker. It just has to have enough information to