summaryrefslogtreecommitdiffstats
path: root/libexec
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2007-07-15 22:52:15 +0000
committermarcel <marcel@FreeBSD.org>2007-07-15 22:52:15 +0000
commit127adac725e070acdc5a2070275fca584e0ae62d (patch)
tree4e2b7a9ef626dd78de7ac32e7e37c0b4383def00 /libexec
parenta4cd4d6af35d413762a438debbc475b53efc567b (diff)
downloadFreeBSD-src-127adac725e070acdc5a2070275fca584e0ae62d.zip
FreeBSD-src-127adac725e070acdc5a2070275fca584e0ae62d.tar.gz
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)
Diffstat (limited to 'libexec')
-rw-r--r--libexec/rtld-elf/powerpc/reloc.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libexec/rtld-elf/powerpc/reloc.c b/libexec/rtld-elf/powerpc/reloc.c
index 94606ec..ed3b6fa 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;
/*
OpenPOWER on IntegriCloud