2013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com>
+ * core-file.c (dwfl_core_file_report): Replaced variable sniffed by
+ retval. Fix one forgotten LISTED increase.
+
+2013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com>
+
Fix core files for re-prelink-ed files.
* core-file.c (dynamic_vaddr_get): New function.
(dwfl_core_file_report): New variable file_dynamic_vaddr. Call
struct r_debug_info r_debug_info;
memset (&r_debug_info, 0, sizeof r_debug_info);
- int listed = dwfl_link_map_report (dwfl, auxv, auxv_size,
+ int retval = dwfl_link_map_report (dwfl, auxv, auxv_size,
dwfl_elf_phdr_memory_callback, elf,
&r_debug_info);
+ int listed = MAX (0, retval);
/* Now sniff segment contents for modules hinted by information gathered
from DT_DEBUG. */
- int sniffed = 0;
ndx = 0;
do
{
if (seg > ndx)
{
ndx = seg;
- ++sniffed;
+ ++listed;
}
else
++ndx;
true, true);
if (mod == NULL)
continue;
+ ++listed;
module->elf = NULL;
module->fd = -1;
/* Move this module to the end of the list, so that we end
/* We return the number of modules we found if we found any.
If we found none, we return -1 instead of 0 if there was an
error rather than just nothing found. */
- return sniffed || listed >= 0 ? listed + sniffed : listed;
+ return listed > 0 ? listed : retval;
}
INTDEF (dwfl_core_file_report)
NEW_VERSION (dwfl_core_file_report, ELFUTILS_0.158)