[PATCH] Fix prelinking with dlopen
Jakub Jelinek
jakub@redhat.com
Mon Sep 2 13:12:00 GMT 2002
Hi!
The following patch fixes various crashes when successfully prelinked program
calls dynamically loads other libraries. Finally prelinked OpenOffice.org
works.
2002-09-02 Jakub Jelinek <jakub@redhat.com>
* elf/rtld.c (dl_main): If prelinking succeeded, mark all objects
as relocated.
--- libc/elf/rtld.c.jj 2002-08-28 17:08:14.000000000 +0200
+++ libc/elf/rtld.c 2002-09-02 21:32:11.000000000 +0200
@@ -1405,6 +1405,8 @@ cannot allocate TLS data structures for
if (prelinked)
{
+ struct link_map *l;
+
if (GL(dl_loaded)->l_info [ADDRIDX (DT_GNU_CONFLICT)] != NULL)
{
ElfW(Rela) *conflict, *conflictend;
@@ -1425,6 +1427,10 @@ cannot allocate TLS data structures for
HP_TIMING_DIFF (relocate_time, start, stop);
}
+ /* Mark all the objects so we know they have been already relocated. */
+ for (l = GL(dl_loaded); l; l = l->l_next)
+ l->l_relocated = 1;
+
_dl_sysdep_start_cleanup ();
}
else
Jakub
More information about the Libc-hacker
mailing list