(_dl_signal_error): When testing for executable being relocated, take
authordrepper <drepper>
Thu, 7 Jul 2005 06:01:24 +0000 (06:01 +0000)
committerdrepper <drepper>
Thu, 7 Jul 2005 06:01:24 +0000 (06:01 +0000)
into account that nothing might even be loaded.

elf/dl-error.c

index a63d801..3a0d9bb 100644 (file)
@@ -98,8 +98,9 @@ _dl_signal_error (int errcode, const char *objname, const char *occation,
          /* If the main executable is relocated it means the libc's malloc
             is used.  */
 #ifdef SHARED
-         lcatch->malloced = (GL(dl_ns)[LM_ID_BASE]._ns_loaded->l_relocated
-                             != 0);
+         lcatch->malloced = (GL(dl_ns)[LM_ID_BASE]._ns_loaded != NULL
+                             && (GL(dl_ns)[LM_ID_BASE]._ns_loaded->l_relocated
+                                 != 0));
 #else
          lcatch->malloced = true;
 #endif