From: Roland McGrath Date: Thu, 22 Jan 2009 12:52:56 +0000 (-0800) Subject: Fix libdwfl segment bugs breaking core-file support. X-Git-Tag: elfutils-0.139~6^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=74afbeed7d5d83a4336d8455507bc39ce6dce13c;p=thirdparty%2Felfutils.git Fix libdwfl segment bugs breaking core-file support. --- diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog index ef00a0cff..87e2b48d7 100644 --- a/libdwfl/ChangeLog +++ b/libdwfl/ChangeLog @@ -1,3 +1,10 @@ +2009-01-22 Roland McGrath + + * 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 * gzip.c [!BZLIB] (mapped_zImage): New function. diff --git a/libdwfl/dwfl_segment_report_module.c b/libdwfl/dwfl_segment_report_module.c index 50ed140ef..a6639be57 100644 --- a/libdwfl/dwfl_segment_report_module.c +++ b/libdwfl/dwfl_segment_report_module.c @@ -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; } diff --git a/libdwfl/segment.c b/libdwfl/segment.c index cb520e64e..36c850f08 100644 --- a/libdwfl/segment.c +++ b/libdwfl/segment.c @@ -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. */