]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
2.3.3-68 cvs/fedora-glibc-2_3_3-68
authorJakub Jelinek <jakub@redhat.com>
Thu, 14 Oct 2004 12:33:58 +0000 (12:33 +0000)
committerJakub Jelinek <jakub@redhat.com>
Thu, 14 Oct 2004 12:33:58 +0000 (12:33 +0000)
dlfcn/dlinfo.c
include/errno.h
sysdeps/mips/dl-machine.h
sysdeps/powerpc/powerpc32/dl-machine.c

index 4e755ad04417706a92b0183a6b91b33ddc10f648..d54a13259a5be18461e489bffcea8d372bf51b46 100644 (file)
@@ -39,13 +39,15 @@ dlinfo_doit (void *argsblock)
 #if 0
   if (args->handle == RTLD_SELF)
     {
+      Lmid_t nsid;
 
       /* Find the highest-addressed object that CALLER is not below.  */
-      for (l = GL(dl_loaded); l != NULL; l = l->l_next)
-       if (caller >= l->l_map_start && caller < l->l_map_end)
-         /* There must be exactly one DSO for the range of the virtual
-            memory.  Otherwise something is really broken.  */
-         break;
+      for (nsid = 0; nsid < DL_NNS; ++nsid)
+       for (l = GL(dl_ns)[nsid]._ns_loaded; l != NULL; l = l->l_next)
+         if (caller >= l->l_map_start && caller < l->l_map_end)
+           /* There must be exactly one DSO for the range of the virtual
+              memory.  Otherwise something is really broken.  */
+           break;
 
       if (l == NULL)
        GLRO(dl_signal_error) (0, NULL, NULL, N_("\
index d9f95aa9826ed2b4084bc0caaf79bf5f952b20fb..9865903b86196dac517d28a317aede64ecd8ded0 100644 (file)
@@ -37,7 +37,7 @@ extern __thread int errno attribute_tls_model_ie;
 
 # ifndef __ASSEMBLER__
 extern int *__errno_location (void) __THROW __attribute__ ((__const__))
-#  ifdef RTLD_PRIVATE_ERRNO
+#  if RTLD_PRIVATE_ERRNO
      attribute_hidden
 #  endif
 ;
index 944f3c10a5f6517e7d06ddac7ffd205fa2461486..49fdffb93dc678857d98ea4e9d33e7d4bb4fc23f 100644 (file)
@@ -231,10 +231,11 @@ elf_machine_runtime_link_map (ElfW(Addr) gpreg, ElfW(Addr) stub_pc)
        }
     }
 
-    {
-      struct link_map *l = GL(dl_loaded);
+    struct link_map *l;
+    Lmid_t nsid;
 
-      while (l)
+    for (nsid = 0; nsid < DL_NNS; ++nsid)
+      for (l = GL(dl_ns)[nsid]._ns_loaded; l != NULL; l = l->l_next)
        {
          ElfW(Addr) base, limit;
          const ElfW(Phdr) *p = l->l_phdr;
@@ -250,9 +251,7 @@ elf_machine_runtime_link_map (ElfW(Addr) gpreg, ElfW(Addr) stub_pc)
                    return l;
                }
            }
-         l = l->l_next;
        }
-    }
 
   _dl_signal_error (0, NULL, NULL, "cannot find runtime link map");
   return NULL;
index 0dce04088b54bdf4d1d51b4f526f0eef19cf696f..606a1dd043fc030bb64bb3716564e43695984cf4 100644 (file)
@@ -106,6 +106,7 @@ __elf_preferred_address(struct link_map *loader, size_t maplength,
 {
   ElfW(Addr) low, high;
   struct link_map *l;
+  Lmid_t nsid;
 
   /* If the object has a preference, load it there!  */
   if (mapstartpref != 0)
@@ -117,29 +118,30 @@ __elf_preferred_address(struct link_map *loader, size_t maplength,
      be superceded by the program's load address).  */
   low =  0x0003FFFF;
   high = 0x70000000;
-  for (l = GL(dl_loaded); l; l = l->l_next)
-    {
-      ElfW(Addr) mapstart, mapend;
-      mapstart = l->l_map_start & ~(GLRO(dl_pagesize) - 1);
-      mapend = l->l_map_end | (GLRO(dl_pagesize) - 1);
-      assert (mapend > mapstart);
-
-      /* Prefer gaps below the main executable, note that l ==
-        _dl_loaded does not work for static binaries loading
-        e.g. libnss_*.so.  */
-      if ((mapend >= high || l->l_type == lt_executable)
-         && high >= mapstart)
-       high = mapstart;
-      else if (mapend >= low && low >= mapstart)
-       low = mapend;
-      else if (high >= mapend && mapstart >= low)
-       {
-         if (high - mapend >= mapstart - low)
-           low = mapend;
-         else
-           high = mapstart;
-       }
-    }
+  for (nsid = 0; nsid < DL_NNS; ++nsid)
+    for (l = GL(dl_ns)[nsid]._ns_loaded; l; l = l->l_next)
+      {
+       ElfW(Addr) mapstart, mapend;
+       mapstart = l->l_map_start & ~(GLRO(dl_pagesize) - 1);
+       mapend = l->l_map_end | (GLRO(dl_pagesize) - 1);
+       assert (mapend > mapstart);
+
+       /* Prefer gaps below the main executable, note that l ==
+          _dl_loaded does not work for static binaries loading
+          e.g. libnss_*.so.  */
+       if ((mapend >= high || l->l_type == lt_executable)
+           && high >= mapstart)
+         high = mapstart;
+       else if (mapend >= low && low >= mapstart)
+         low = mapend;
+       else if (high >= mapend && mapstart >= low)
+         {
+           if (high - mapend >= mapstart - low)
+             low = mapend;
+           else
+             high = mapstart;
+         }
+      }
 
   high -= 0x10000; /* Allow some room between objects.  */
   maplength = (maplength | (GLRO(dl_pagesize) - 1)) + 1;