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

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
* 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;
/*