Update.
authorUlrich Drepper <drepper@redhat.com>
Thu, 8 Jun 2000 01:50:04 +0000 (01:50 +0000)
committerUlrich Drepper <drepper@redhat.com>
Thu, 8 Jun 2000 01:50:04 +0000 (01:50 +0000)
* elf/dl-addr.c (_dl_addr): Do exact testing of address range
using l_map_start and l_map_end.

ChangeLog
elf/dl-addr.c

index 409528a..1079ab0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2000-06-07  Ulrich Drepper  <drepper@redhat.com>
 
+       * elf/dl-addr.c (_dl_addr): Do exact testing of address range
+       using l_map_start and l_map_end.
+
        * elf/dl-version.c: Add __builtin_expect in many places.
 
        * sysdeps/unix/sysv/linux/i386/dl-procinfo.h (x86_cap_flags):
index b0b864f..3932a65 100644 (file)
@@ -34,12 +34,13 @@ _dl_addr (const void *address, Dl_info *info)
   /* Find the highest-addressed object that ADDRESS is not below.  */
   match = NULL;
   for (l = _dl_loaded; l; l = l->l_next)
-    if (l->l_addr != 0 /* Make sure we do not currently set this map up
-                          in this moment.  */
-       && addr >= l->l_addr && (!match || match->l_addr < l->l_addr))
-      match = l;
+    if (addr >= l->l_map_start && addr < l->l_map_end)
+      {
+       match = l;
+       break;
+      }
 
-  if (match)
+  if (__builtin_expect (match != NULL, 1))
     {
       /* We know ADDRESS lies within MATCH if in any shared object.
         Make sure it isn't past the end of MATCH's segments.  */