[xorg-commit-diffs] xc/programs/Xserver/hw/xfree86/loader elfloader.c, 1.1.4.1.2.2, 1.1.4.1.2.3

Alexander Gottwald xorg-commit at pdx.freedesktop.org
Fri Apr 2 11:38:14 PST 2004


Committed by: ago

Update of /cvs/xorg/xc/programs/Xserver/hw/xfree86/loader
In directory pdx:/home/ago/xc/programs/Xserver/hw/xfree86/loader

Modified Files:
      Tag: CYGWIN
	elfloader.c 
Log Message:
Merge with XORG-RELEASE-1 (69)

Index: elfloader.c
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/loader/elfloader.c,v
retrieving revision 1.1.4.1.2.2
retrieving revision 1.1.4.1.2.3
diff -u -d -r1.1.4.1.2.2 -r1.1.4.1.2.3
--- a/elfloader.c	18 Mar 2004 12:00:23 -0000	1.1.4.1.2.2
+++ b/elfloader.c	2 Apr 2004 19:38:01 -0000	1.1.4.1.2.3
@@ -1096,6 +1096,18 @@
 	ErrorF("ELFCreatePLT() Unable to allocate memory!!!!\n");
 	return;
     }
+#   if defined(linux) || defined(__OpenBSD__)
+    {
+	unsigned long page_size = getpagesize();
+	unsigned long round;
+
+	round = (unsigned long)elffile->plt & (page_size - 1);
+	mprotect(elffile->plt - round,
+		 (elffile->pltsize + round + page_size - 1) & ~(page_size - 1),
+		 PROT_READ | PROT_WRITE | PROT_EXEC);
+    }
+#   endif
+									      
     elffile->sections[elffile->pltndx].sh_size = elffile->pltsize;
 # ifdef ELFDEBUG
     ELFDEBUG("ELFCreatePLT: PLT address %lx\n", elffile->plt);




More information about the xorg-commit-diffs mailing list