summaryrefslogtreecommitdiffstats
path: root/libexec
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2005-04-26 20:38:44 +0000
committerpeter <peter@FreeBSD.org>2005-04-26 20:38:44 +0000
commit55bba67087a9f496e46e0307aaba162c9a099b0f (patch)
treed10b0b522df80b4babff2d386784c90833596633 /libexec
parent3f77e18f9b94a43481ad88f443208b20edbfbdc8 (diff)
downloadFreeBSD-src-55bba67087a9f496e46e0307aaba162c9a099b0f.zip
FreeBSD-src-55bba67087a9f496e46e0307aaba162c9a099b0f.tar.gz
Stop calling _amd64_set_gsbase() for COMPAT_32BIT. The amd64 kernel
implements i386_set_gsbase(), so there is no need for the variation.
Diffstat (limited to 'libexec')
-rw-r--r--libexec/rtld-elf/i386/reloc.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/libexec/rtld-elf/i386/reloc.c b/libexec/rtld-elf/i386/reloc.c
index 846b643..9323a6f 100644
--- a/libexec/rtld-elf/i386/reloc.c
+++ b/libexec/rtld-elf/i386/reloc.c
@@ -327,10 +327,8 @@ void
allocate_initial_tls(Obj_Entry *objs)
{
void* tls;
-#ifndef COMPAT_32BIT
union descriptor ldt;
int error, sel;
-#endif
/*
* Fix the size of the static TLS block by using the maximum
@@ -338,11 +336,9 @@ 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));
-
-#ifndef COMPAT_32BIT
+ tls = alloca_tls(objs, NULL, 2*sizeof(Elf_Addr), sizeof(Elf_Addr));
error = i386_set_gsbase(tls);
- if (error) {
+ if (error < 0) {
memset(&ldt, 0, sizeof(ldt));
ldt.sd.sd_lolimit = 0xffff; /* 4G limit */
ldt.sd.sd_lobase = ((Elf_Addr)tls) & 0xffffff;
@@ -356,9 +352,6 @@ allocate_initial_tls(Obj_Entry *objs)
sel = i386_set_ldt(LDT_AUTO_ALLOC, &ldt, 1);
__asm __volatile("movl %0,%%gs" : : "rm" ((sel << 3) | 7));
}
-#else
- _amd64_set_gsbase(tls);
-#endif
}
/* GNU ABI */
OpenPOWER on IntegriCloud