Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Nov 2004 23:23:21 GMT
From:      Peter Wemm <peter@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 64389 for review
Message-ID:  <200411052323.iA5NNLIh040663@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=64389

Change 64389 by peter@peter_daintree on 2004/11/05 23:23:09

	Invade rtld-elf for i386 as well, so it can run on amd64 machines.

Affected files ...

.. //depot/projects/hammer/libexec/rtld-elf/i386/reloc.c#5 edit

Differences ...

==== //depot/projects/hammer/libexec/rtld-elf/i386/reloc.c#5 (text+ko) ====

@@ -327,8 +327,10 @@
 allocate_initial_tls(Obj_Entry *objs)
 {
     void* tls;
+#ifndef COMPAT_32BIT
     union descriptor ldt;
     int sel;
+#endif
 
     /*
      * Fix the size of the static TLS block by using the maximum
@@ -338,6 +340,7 @@
     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
     memset(&ldt, 0, sizeof(ldt));
     ldt.sd.sd_lolimit = 0xffff;	/* 4G limit */
     ldt.sd.sd_lobase = ((Elf_Addr)tls) & 0xffffff;
@@ -350,6 +353,9 @@
     ldt.sd.sd_hibase = (((Elf_Addr)tls) >> 24) & 0xff;
     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 */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200411052323.iA5NNLIh040663>