diff options
author | kensmith <kensmith@FreeBSD.org> | 2007-07-13 16:18:43 +0000 |
---|---|---|
committer | kensmith <kensmith@FreeBSD.org> | 2007-07-13 16:18:43 +0000 |
commit | bd3c8bf640143f7777551f9f5ee674635684da96 (patch) | |
tree | 3a95825e0690cf74e548c84b3961f5f5f31b2c4b /libexec/rtld-elf/sparc64/reloc.c | |
parent | 8f8854b459c223757a69e6a82853c6c695025fdd (diff) | |
download | FreeBSD-src-bd3c8bf640143f7777551f9f5ee674635684da96.zip FreeBSD-src-bd3c8bf640143f7777551f9f5ee674635684da96.tar.gz |
Cache does not serve any purpose when rtld is relocating itself, do
not bother allocating one.
Submitted by: kan
Approved by: re (bmah)
Diffstat (limited to 'libexec/rtld-elf/sparc64/reloc.c')
-rw-r--r-- | libexec/rtld-elf/sparc64/reloc.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libexec/rtld-elf/sparc64/reloc.c b/libexec/rtld-elf/sparc64/reloc.c index 225322e..33eab79 100644 --- a/libexec/rtld-elf/sparc64/reloc.c +++ b/libexec/rtld-elf/sparc64/reloc.c @@ -260,8 +260,12 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld) * The dynamic loader may be called from a thread, we have * 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 (obj != obj_rtld) { + cache = mmap(NULL, bytes, PROT_READ|PROT_WRITE, MAP_ANON, + -1, 0); + if (cache == MAP_FAILED) + cache = NULL; + } else cache = NULL; relalim = (const Elf_Rela *)((caddr_t)obj->rela + obj->relasize); |