From: Mark Wielaard Date: Mon, 31 Oct 2011 14:33:49 +0000 (+0100) Subject: dwfl_module_addrsym update sizeless_sym only if closer to desired addr. X-Git-Tag: elfutils-0.153~19 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=75ee33f4eee8570d3cf1abf778413276184eea18;p=thirdparty%2Felfutils.git dwfl_module_addrsym update sizeless_sym only if closer to desired addr. --- diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog index adf3efac4..97caf0bc5 100644 --- a/libdwfl/ChangeLog +++ b/libdwfl/ChangeLog @@ -1,3 +1,8 @@ +2011-11-31 Mark Wielaard + + * dwfl_module_addrsym.c (dwfl_module_addrsym): Only update + sizeless_sym if needed and closer to desired addr. + 2011-10-20 Mark Wielaard * derelocate.c (cache_sections): Intern mod->reloc_info check. diff --git a/libdwfl/dwfl_module_addrsym.c b/libdwfl/dwfl_module_addrsym.c index a9f98f448..41ff46541 100644 --- a/libdwfl/dwfl_module_addrsym.c +++ b/libdwfl/dwfl_module_addrsym.c @@ -138,7 +138,9 @@ dwfl_module_addrsym (Dwfl_Module *mod, GElf_Addr addr, closest_shndx = shndx; closest_name = name; } - else if (same_section (&sym, shndx)) + else if (closest_name == NULL + && sym.st_value >= min_label + && same_section (&sym, shndx)) { /* Handwritten assembly symbols sometimes have no st_size. If no symbol with proper size includes