1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-12 14:29:28 +00:00

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)
This commit is contained in:
Marcel Moolenaar 2007-07-15 22:52:15 +00:00
parent 88cc6a490c
commit 99227f1ec4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=171462

View File

@ -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 * The dynamic loader may be called from a thread, we have
* limited amounts of stack available so we cannot use alloca(). * limited amounts of stack available so we cannot use alloca().
*/ */
cache = mmap(NULL, bytes, PROT_READ|PROT_WRITE, MAP_ANON, -1, 0); if (obj != obj_rtld) {
if (cache == MAP_FAILED) cache = mmap(NULL, bytes, PROT_READ|PROT_WRITE, MAP_ANON,
-1, 0);
if (cache == MAP_FAILED)
cache = NULL;
} else
cache = NULL; cache = NULL;
/* /*