summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ldso/include/dl-defs.h4
-rw-r--r--ldso/include/ldsodefs.h51
-rw-r--r--ldso/ldso/dl-elf.c6
-rw-r--r--ldso/ldso/dl-startup.c8
-rw-r--r--libc/sysdeps/linux/mips/sysdep.h18
5 files changed, 64 insertions, 23 deletions
diff --git a/ldso/include/dl-defs.h b/ldso/include/dl-defs.h
index b1bf8c7c1..de459b0a8 100644
--- a/ldso/include/dl-defs.h
+++ b/ldso/include/dl-defs.h
@@ -2,8 +2,8 @@
#define _LD_DEFS_H
/*
- * MIPS NPTL - This was taken from 'sysdeps/generic/ldsodefs.h'. It is
- * used for backtrace capability.
+ * NPTL - This was taken from 'sysdeps/generic/ldsodefs.h'. It is
+ * used for backtrace capability.
*/
extern void *__libc_stack_end;
diff --git a/ldso/include/ldsodefs.h b/ldso/include/ldsodefs.h
index 26b923536..06b5f3729 100644
--- a/ldso/include/ldsodefs.h
+++ b/ldso/include/ldsodefs.h
@@ -5,21 +5,62 @@
#include <tls.h>
/*
- * MIPS NPTL - These were taken from 'string/test-string.h'
+ * NPTL - These are supposed to be from 'sysdeps/generic/ldsodefs.h'
+ * and used with the ld.so global structure. I am not sure how
+ * this fits into uClibc yet, so they are empty.
*/
#define GL(x) _##x
#define GLRO(x) _##x
/*
- * MIPS NPTL - This was taken from 'sysdeps/generic/ldsodefs.h'. It is
- * most likely used for backtrace capability.
+ * NPTL - This was taken from 'sysdeps/generic/ldsodefs.h'. It is
+ * used for backtrace capability.
*/
-extern void *__libc_stack_end;
+/* Variable pointing to the end of the stack (or close to it). This value
+ must be constant over the runtime of the application. Some programs
+ might use the variable which results in copy relocations on some
+ platforms. But this does not matter, ld.so can always use the local
+ copy. */
+extern void *__libc_stack_end attribute_relro;
+rtld_hidden_proto (__libc_stack_end)
+
+/* Determine next available module ID. */
+extern size_t _dl_next_tls_modid (void) internal_function attribute_hidden;
+
+/* Calculate offset of the TLS blocks in the static TLS block. */
+extern void _dl_determine_tlsoffset (void) internal_function attribute_hidden;
+
+/* Set up the data structures for TLS, when they were not set up at startup.
+ Returns nonzero on malloc failure.
+ This is called from _dl_map_object_from_fd or by libpthread. */
+extern int _dl_tls_setup (void) internal_function;
+rtld_hidden_proto (_dl_tls_setup)
+
+/* Allocate memory for static TLS block (unless MEM is nonzero) and dtv. */
+extern void *_dl_allocate_tls (void *mem) internal_function;
+rtld_hidden_proto (_dl_allocate_tls)
/* Get size and alignment requirements of the static TLS block. */
extern void _dl_get_tls_static_info (size_t *sizep, size_t *alignp)
- internal_function;
+ internal_function;
+extern void _dl_allocate_static_tls (struct link_map *map)
+ internal_function attribute_hidden;
+
+/* These are internal entry points to the two halves of _dl_allocate_tls,
+ only used within rtld.c itself at startup time. */
+extern void *_dl_allocate_tls_storage (void)
+ internal_function attribute_hidden;
+extern void *_dl_allocate_tls_init (void *) internal_function;
+rtld_hidden_proto (_dl_allocate_tls_init)
+
+/* Deallocate memory allocated with _dl_allocate_tls. */
+extern void _dl_deallocate_tls (void *tcb, bool dealloc_tcb) internal_function;
+rtld_hidden_proto (_dl_deallocate_tls)
+
+#if defined USE_TLS
+extern void _dl_nothread_init_static_tls (struct link_map *) attribute_hidden;
+#endif
/* Keep the conditional TLS members at the end so the layout of the
structure used by !USE_TLS code matches the prefix of the layout in
the USE_TLS rtld. Note that `struct link_map' is conditionally
diff --git a/ldso/ldso/dl-elf.c b/ldso/ldso/dl-elf.c
index 62635fc23..a3177fb59 100644
--- a/ldso/ldso/dl-elf.c
+++ b/ldso/ldso/dl-elf.c
@@ -38,9 +38,9 @@ static caddr_t _dl_cache_addr = NULL;
static size_t _dl_cache_size = 0;
/*
- * MIPS NPTL - This was taken from 'elf/dl-load.c' in glibc. We may
- * or may not need this for backtrace support. Define
- * it for NPTL compilation.
+ * NPTL - This was taken from 'elf/dl-load.c' in glibc. We may
+ * or may not need this for backtrace support. Define
+ * it for NPTL compilation.
*/
void *__libc_stack_end;
diff --git a/ldso/ldso/dl-startup.c b/ldso/ldso/dl-startup.c
index f1e011690..31529cd18 100644
--- a/ldso/ldso/dl-startup.c
+++ b/ldso/ldso/dl-startup.c
@@ -141,10 +141,10 @@ static void * __attribute_used__ _dl_start(unsigned long args)
aux_dat++; /* Skip over NULL at end of envp */
/*
- * MIPS NPTL - This was taken from 'sysdeps/generic/libc-start.c'
- * and is most likely associated with backtrace
- * capability. It could possibly be removed later,
- * but right now NPTL needs this to compile.
+ * NPTL - This was taken from 'sysdeps/generic/libc-start.c'
+ * and is associated with backtrace capability. It
+ * It may be removed later, but right now NPTL needs
+ * NPTL needs this to compile.
*/
__libc_stack_end = (void *) argv;
diff --git a/libc/sysdeps/linux/mips/sysdep.h b/libc/sysdeps/linux/mips/sysdep.h
index 255073e9f..dca9cfa7c 100644
--- a/libc/sysdeps/linux/mips/sysdep.h
+++ b/libc/sysdeps/linux/mips/sysdep.h
@@ -20,14 +20,14 @@
#define _LINUX_MIPS_MIPS32_SYSDEP_H 1
/* There is some commonality. */
-/* MIPS NPTL - start sysdeps/unix/mips32/sysdep.h */
+/* NPTL - start sysdeps/unix/mips32/sysdep.h */
-/* MIPS NPTL - start sysdeps/unix/mips/sysdep.h */
+/* NPTL - start sysdeps/unix/mips/sysdep.h */
#include <sgidefs.h>
-/* MIPS NPTL - start sysdeps/unix/sysdep.h */
+/* NPTL - start sysdeps/unix/sysdep.h */
-/* MIPS NPTL - start sysdeps/generic/sysdep.h */
+/* NPTL - start sysdeps/generic/sysdep.h */
/* Define a macro we can use to construct the asm name for a C symbol. */
#ifdef NO_UNDERSCORES
#ifdef __STDC__
@@ -140,7 +140,7 @@
# endif
#endif /* __ASSEMBLER__ */
-/* MIPS NPTL - end sysdeps/generic/sysdep.h */
+/* NPTL - end sysdeps/generic/sysdep.h */
#include <sys/syscall.h>
#define HAVE_SYSCALLS
@@ -162,7 +162,7 @@
#if 0
/*
- * MIPS NPTL - these are defined in 'include/bits/syscalls.h' and
+ * NPTL - these are defined in 'include/bits/syscalls.h' and
* 'include/bits/sysnum.h'.
*/
#ifdef __STDC__
@@ -187,7 +187,7 @@
/* Wrappers around system calls should normally inline the system call code.
But sometimes it is not possible or implemented and we use this code. */
#define INLINE_SYSCALL(name, nr, args...) __syscall_##name (args)
-/* MIPS NPTL - end sysdeps/unix/sysdep.h */
+/* NPTL - end sysdeps/unix/sysdep.h */
#ifdef __ASSEMBLER__
@@ -245,7 +245,7 @@
#endif
#endif
-/* MIPS NPTL - end sysdeps/unix/mips/sysdep.h */
+/* NPTL - end sysdeps/unix/mips/sysdep.h */
/* Note that while it's better structurally, going back to call __syscall_error
can make things confusing if you're debugging---it looks like it's jumping
@@ -277,7 +277,7 @@ L(syse1):
bne a3, zero, 99b; \
L(syse1):
#endif
-/* MIPS NPTL - end sysdeps/unix/mips32/sysdep.h */
+/* NPTL - end sysdeps/unix/mips32/sysdep.h */
/* For Linux we can use the system call table in the header file
/usr/include/asm/unistd.h