summaryrefslogtreecommitdiffstats
path: root/libexec
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2006-03-28 06:09:24 +0000
committerdavidxu <davidxu@FreeBSD.org>2006-03-28 06:09:24 +0000
commitf8168da7cf95cc9e1082de2f92593fa9e40bbde5 (patch)
treeac985a06120dcffc30366f910f16d1483f8eccad /libexec
parentb99f1961b8b3456fa23cc4113117f8f1139d5c60 (diff)
downloadFreeBSD-src-f8168da7cf95cc9e1082de2f92593fa9e40bbde5.zip
FreeBSD-src-f8168da7cf95cc9e1082de2f92593fa9e40bbde5.tar.gz
Allocate space for thread pointer, this allows thread library to access
its pointer from begin, and simplifies _get_curthread() in libthr.
Diffstat (limited to 'libexec')
-rw-r--r--libexec/rtld-elf/amd64/reloc.c2
-rw-r--r--libexec/rtld-elf/i386/reloc.c2
-rw-r--r--libexec/rtld-elf/rtld.c2
-rw-r--r--libexec/rtld-elf/sparc64/reloc.c2
4 files changed, 4 insertions, 4 deletions
diff --git a/libexec/rtld-elf/amd64/reloc.c b/libexec/rtld-elf/amd64/reloc.c
index 8f25278..8a32adf 100644
--- a/libexec/rtld-elf/amd64/reloc.c
+++ b/libexec/rtld-elf/amd64/reloc.c
@@ -384,7 +384,7 @@ allocate_initial_tls(Obj_Entry *objs)
*/
tls_static_space = tls_last_offset + RTLD_STATIC_TLS_EXTRA;
amd64_set_fsbase(allocate_tls(objs, 0,
- 2*sizeof(Elf_Addr), sizeof(Elf_Addr)));
+ 3*sizeof(Elf_Addr), sizeof(Elf_Addr)));
}
void *__tls_get_addr(tls_index *ti)
diff --git a/libexec/rtld-elf/i386/reloc.c b/libexec/rtld-elf/i386/reloc.c
index 809f16e..ec83bff 100644
--- a/libexec/rtld-elf/i386/reloc.c
+++ b/libexec/rtld-elf/i386/reloc.c
@@ -336,7 +336,7 @@ allocate_initial_tls(Obj_Entry *objs)
* use.
*/
tls_static_space = tls_last_offset + RTLD_STATIC_TLS_EXTRA;
- tls = allocate_tls(objs, NULL, 2*sizeof(Elf_Addr), sizeof(Elf_Addr));
+ tls = allocate_tls(objs, NULL, 3*sizeof(Elf_Addr), sizeof(Elf_Addr));
i386_set_gsbase(tls);
}
diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c
index e164ef8..9824c3e 100644
--- a/libexec/rtld-elf/rtld.c
+++ b/libexec/rtld-elf/rtld.c
@@ -2707,7 +2707,7 @@ allocate_tls(Obj_Entry *objs, void *oldtls, size_t tcbsize, size_t tcbalign)
size = tls_static_space;
- tls = malloc(size);
+ tls = calloc(1, size);
dtv = calloc(1, (tls_max_index + 2) * sizeof(Elf_Addr));
*(Elf_Addr**) tls = dtv;
diff --git a/libexec/rtld-elf/sparc64/reloc.c b/libexec/rtld-elf/sparc64/reloc.c
index f264860..dc0d830 100644
--- a/libexec/rtld-elf/sparc64/reloc.c
+++ b/libexec/rtld-elf/sparc64/reloc.c
@@ -731,7 +731,7 @@ allocate_initial_tls(Obj_Entry *objs)
* use.
*/
tls_static_space = tls_last_offset + RTLD_STATIC_TLS_EXTRA;
- tp = allocate_tls(objs, NULL, 2*sizeof(Elf_Addr), sizeof(Elf_Addr));
+ tp = allocate_tls(objs, NULL, 3*sizeof(Elf_Addr), sizeof(Elf_Addr));
}
void *__tls_get_addr(tls_index *ti)
OpenPOWER on IntegriCloud