--- xc/programs/Xserver/hw/xfree86/loader/elfloader.c.orig 2004-03-30 13:03:00.000000000 -0500 +++ xc/programs/Xserver/hw/xfree86/loader/elfloader.c 2004-03-30 13:13:52.000000000 -0500 @@ -1096,6 +1096,20 @@ 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);