No need to zero fill memory, mmapped anonymously. Kernel will

return pre-zeroed pages itself.

Noticed by:     jake
This commit is contained in:
Alexander Kabaev 2003-03-14 21:10:13 +00:00
parent fb5caa50ab
commit 605f36fc1e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=112242
6 changed files with 1 additions and 15 deletions

View File

@ -162,8 +162,6 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld)
cache = mmap(NULL, bytes, PROT_READ|PROT_WRITE, MAP_ANON, -1, 0);
if (cache == MAP_FAILED)
cache = NULL;
if (cache != NULL)
memset(cache, 0, bytes);
/* Perform relocations without addend if there are any: */
rellim = (const Elf_Rel *) ((caddr_t) obj->rel + obj->relsize);

View File

@ -125,8 +125,6 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld)
cache = mmap(NULL, bytes, PROT_READ|PROT_WRITE, MAP_ANON, -1, 0);
if (cache == MAP_FAILED)
cache = NULL;
if (cache != NULL)
memset(cache, 0, bytes);
rellim = (const Elf_Rel *) ((caddr_t) obj->rel + obj->relsize);
for (rel = obj->rel; rel < rellim; rel++) {

View File

@ -125,8 +125,6 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld)
cache = mmap(NULL, bytes, PROT_READ|PROT_WRITE, MAP_ANON, -1, 0);
if (cache == MAP_FAILED)
cache = NULL;
if (cache != NULL)
memset(cache, 0, bytes);
rellim = (const Elf_Rel *) ((caddr_t) obj->rel + obj->relsize);
for (rel = obj->rel; rel < rellim; rel++) {

View File

@ -231,8 +231,6 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld)
cache = mmap(NULL, bytes, PROT_READ|PROT_WRITE, MAP_ANON, -1, 0);
if (cache == MAP_FAILED)
cache = NULL;
if (cache != NULL)
memset(cache, 0, bytes);
/*
* When relocating rtld itself, we need to avoid using malloc.

View File

@ -233,12 +233,8 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld)
* limited amounts of stack available so we cannot use alloca().
*/
cache = mmap(NULL, bytes, PROT_READ|PROT_WRITE, MAP_ANON, -1, 0);
if (cache == MAP_FAILED) {
if (cache == MAP_FAILED)
cache = NULL;
}
if (cache != NULL) {
memset(cache, 0, obj->nchains * sizeof(SymCache));
}
/*
* From the SVR4 PPC ABI:

View File

@ -261,8 +261,6 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld)
cache = mmap(NULL, bytes, PROT_READ|PROT_WRITE, MAP_ANON, -1, 0);
if (cache == MAP_FAILED)
cache = NULL;
if (cache != NULL)
memset(cache, 0, obj->nchains * sizeof(SymCache));
relalim = (const Elf_Rela *)((caddr_t)obj->rela + obj->relasize);
for (rela = obj->rela; rela < relalim; rela++) {