From 99227f1ec435d520c2350883a07acc98e248fc7d Mon Sep 17 00:00:00 2001 From: Marcel Moolenaar Date: Sun, 15 Jul 2007 22:52:15 +0000 Subject: Unbreak the dynamic linker by not creating a cache for rtld-elf itself. It needs mmap(2), which now needs getosreldate(3) and which in turn uses a global variable to cache the result. This cannot be done before linking is done. See also: ../sparc64/reloc.c:1.15 Approved by: re (kensmith) --- libexec/rtld-elf/powerpc/reloc.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'libexec/rtld-elf') diff --git a/libexec/rtld-elf/powerpc/reloc.c b/libexec/rtld-elf/powerpc/reloc.c index 94606ec4c9b7..ed3b6fab6e4a 100644 --- a/libexec/rtld-elf/powerpc/reloc.c +++ b/libexec/rtld-elf/powerpc/reloc.c @@ -286,8 +286,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; /* -- cgit v1.3