]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Fix libdwfl segment bugs breaking core-file support.
authorRoland McGrath <roland@redhat.com>
Thu, 22 Jan 2009 12:52:56 +0000 (04:52 -0800)
committerRoland McGrath <roland@redhat.com>
Thu, 22 Jan 2009 12:52:56 +0000 (04:52 -0800)
libdwfl/ChangeLog
libdwfl/dwfl_segment_report_module.c
libdwfl/segment.c

index ef00a0cff513f28174fc283a94e053d0582a3239..87e2b48d7ea822a272dfc1de3d5327cf4ddbb1db 100644 (file)
@@ -1,3 +1,10 @@
+2009-01-22  Roland McGrath  <roland@redhat.com>
+
+       * dwfl_segment_report_module.c (addr_segndx): Remove bogus adjustments
+       after address-matching loop.
+
+       * segment.c (lookup): Fix fencepost in checking for HINT match.
+
 2009-01-14  Roland McGrath  <roland@redhat.com>
 
        * gzip.c [!BZLIB] (mapped_zImage): New function.
index 50ed140ef65f0cf0d86af87a5d2ae864bf3dc633..a6639be57f05c9c596c55b76497db5f0e345a485 100644 (file)
@@ -1,5 +1,5 @@
 /* Sniff out modules from ELF headers visible in memory segments.
-   Copyright (C) 2008 Red Hat, Inc.
+   Copyright (C) 2008, 2009 Red Hat, Inc.
    This file is part of Red Hat elfutils.
 
    Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -87,13 +87,6 @@ addr_segndx (Dwfl *dwfl, size_t segment, GElf_Addr addr)
   while (segment < dwfl->lookup_elts - 1
         && dwfl->lookup_addr[segment] < addr);
 
-  while (dwfl->lookup_segndx[segment] < 0
-        && segment < dwfl->lookup_elts - 1)
-      ++segment;
-
-  if (dwfl->lookup_segndx[segment] >= 0)
-    ndx = dwfl->lookup_segndx[segment];
-
   return ndx;
 }
 
index cb520e64e435bebf0629ecaae12e6f728f1f16b2..36c850f0898ff5faeeef6eed03397d1c08d35d18 100644 (file)
@@ -1,5 +1,5 @@
 /* Manage address space lookup table for libdwfl.
-   Copyright (C) 2008 Red Hat, Inc.
+   Copyright (C) 2008, 2009 Red Hat, Inc.
    This file is part of Red Hat elfutils.
 
    Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -142,7 +142,7 @@ lookup (Dwfl *dwfl, GElf_Addr address, int hint)
   if (hint >= 0
       && address >= dwfl->lookup_addr[hint]
       && ((size_t) hint + 1 == dwfl->lookup_elts
-         || address <= dwfl->lookup_addr[hint + 1]))
+         || address < dwfl->lookup_addr[hint + 1]))
     return hint;
 
   /* Do binary search on the array indexed by module load address.  */