Merge with XORG-RELEASE-1 (69)

This commit is contained in:
Alexander Gottwald 2004-04-02 19:38:01 +00:00
parent 1d888be479
commit c6141d65a9

View file

@ -1096,6 +1096,18 @@ ELFCreatePLT(ELFModulePtr elffile)
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);