public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/maskray/lld] hurd: Drop fmh kludge
@ 2021-08-16 17:15 Fangrui Song
  0 siblings, 0 replies; only message in thread
From: Fangrui Song @ 2021-08-16 17:15 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=cbb2aa337bc3a5f1cb9936781c3a7f5036d4262e

commit cbb2aa337bc3a5f1cb9936781c3a7f5036d4262e
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Mon Aug 16 11:20:38 2021 +0200

    hurd: Drop fmh kludge
    
    Gnumach's 0650a4ee30e3 implements support for high bits being set in the
    mask parameter of vm_map. This allows to remove the fmh kludge that was
    masking away the address range by mapping a dumb area there.

Diff:
---
 sysdeps/mach/hurd/dl-sysdep.c | 35 -----------------------------------
 1 file changed, 35 deletions(-)

diff --git a/sysdeps/mach/hurd/dl-sysdep.c b/sysdeps/mach/hurd/dl-sysdep.c
index 4b2072e5d5..968a58f668 100644
--- a/sysdeps/mach/hurd/dl-sysdep.c
+++ b/sysdeps/mach/hurd/dl-sysdep.c
@@ -66,37 +66,6 @@ void *_dl_random attribute_relro = NULL;
 
 struct hurd_startup_data *_dl_hurd_data;
 
-#define FMH defined(__i386__)
-#if ! FMH
-# define fmh()		((void)0)
-# define unfmh()	((void)0)
-#else
-/* XXX loser kludge for vm_map kernel bug, fixed by gnumach's 0650a4ee30e3 */
-#undef	ELF_MACHINE_USER_ADDRESS_MASK
-#define ELF_MACHINE_USER_ADDRESS_MASK	0
-static vm_address_t fmha;
-static vm_size_t fmhs;
-static void unfmh(void){
-__vm_deallocate(__mach_task_self(),fmha,fmhs);}
-static void fmh(void) {
-    error_t err;int x;vm_offset_t o;mach_port_t p;
-    vm_address_t a=0x08000000U,max=VM_MAX_ADDRESS;
-    while (!(err=__vm_region(__mach_task_self(),&a,&fmhs,&x,&x,&x,&x,&p,&o))){
-      __mach_port_deallocate(__mach_task_self(),p);
-      if (a+fmhs>=0x80000000U){
-	max=a; break;}
-      fmha=a+=fmhs;}
-    if (err) assert(err==KERN_NO_SPACE);
-    if (!fmha)fmhs=0;else{
-    fmhs=max-fmha;
-    err = __vm_map (__mach_task_self (),
-		    &fmha, fmhs, 0, 0, MACH_PORT_NULL, 0, 1,
-		    VM_PROT_NONE, VM_PROT_NONE, VM_INHERIT_COPY);
-    assert_perror(err);}
-  }
-/* XXX loser kludge for vm_map kernel bug */
-#endif
-
 
 ElfW(Addr)
 _dl_sysdep_start (void **start_argptr,
@@ -147,8 +116,6 @@ _dl_sysdep_start (void **start_argptr,
 	  && _dl_hurd_data->user_entry == 0)
 	_dl_hurd_data->user_entry = (vm_address_t) ENTRY_POINT;
 
-unfmh();			/* XXX */
-
 #if 0				/* XXX make this work for real someday... */
       if (_dl_hurd_data->user_entry == (vm_address_t) ENTRY_POINT)
 	/* We were invoked as a command, not as the program interpreter.
@@ -257,8 +224,6 @@ unfmh();			/* XXX */
   /* Initialize frequently used global variable.  */
   GLRO(dl_pagesize) = __getpagesize ();
 
-fmh();				/* XXX */
-
   /* See hurd/hurdstartup.c; this deals with getting information
      from the exec server and slicing up the arguments.
      Then it will call `go', above.  */


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-16 17:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-16 17:15 [glibc/maskray/lld] hurd: Drop fmh kludge Fangrui Song

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).