+2008-05-06 Roland McGrath <roland@frob.com>
+
+ * linux-kernel-modules.c (dwfl_linux_kernel_report_offline): Use
+ FTS_LOGICAL here too.
+ (dwfl_linux_kernel_find_elf): Likewise.
+
+2008-04-29 Roland McGrath <roland@redhat.com>
+
+ * find-debuginfo.c (dwfl_standard_find_debuginfo): Try path search
+ based on canonicalize_file_name if it differs from the supplied name.
+
+ * linux-kernel-modules.c (check_module_notes): Use FTS_LOGICAL so
+ we accept symlinks.
+
2008-04-27 Roland McGrath <roland@redhat.com>
* linux-kernel-modules.c (report_kernel): Fix crash when
/* Standard find_debuginfo callback for libdwfl.
- Copyright (C) 2005, 2006, 2007 Red Hat, Inc.
+ Copyright (C) 2005, 2006, 2007, 2008 Red Hat, Inc.
This file is part of Red Hat elfutils.
Red Hat elfutils is free software; you can redistribute it and/or modify
}
/* Failing that, search the path by name. */
- return find_debuginfo_in_path (mod, file_name, debuglink_file, debuglink_crc,
- debuginfo_file_name);
+ int fd = find_debuginfo_in_path (mod, file_name,
+ debuglink_file, debuglink_crc,
+ debuginfo_file_name);
+
+ if (fd < 0 && errno == 0)
+ {
+ /* If FILE_NAME is a symlink, the debug file might be associated
+ with the symlink target name instead. */
+
+ char *canon = canonicalize_file_name (file_name);
+ if (canon != NULL && strcmp (file_name, canon))
+ fd = find_debuginfo_in_path (mod, canon,
+ debuglink_file, debuglink_crc,
+ debuginfo_file_name);
+ free (canon);
+ }
+
+ return fd;
}
INTDEF (dwfl_standard_find_debuginfo)
return errno;
}
- FTS *fts = fts_open (modulesdir, FTS_NOSTAT, NULL);
+ FTS *fts = fts_open (modulesdir, FTS_NOSTAT | FTS_LOGICAL, NULL);
if (modulesdir[0] == (char *) release)
modulesdir[0] = NULL;
if (fts == NULL)
switch (f->fts_info)
{
case FTS_F:
+ case FTS_SL:
case FTS_NSOK:
/* See if this file name matches "*.ko". */
if (f->fts_namelen > 3
result = f->fts_errno;
break;
+ case FTS_SLNONE:
default:
continue;
}
if (asprintf (&dirs[0], MODNOTESFMT, mod->name) < 0)
return ENOMEM;
- FTS *fts = fts_open (dirs, FTS_NOSTAT, NULL);
+ FTS *fts = fts_open (dirs, FTS_NOSTAT | FTS_LOGICAL, NULL);
if (fts == NULL)
{
free (dirs[0]);
switch (f->fts_info)
{
case FTS_F:
+ case FTS_SL:
case FTS_NSOK:
result = check_notes (mod, f->fts_accpath, 0, f->fts_name);
if (result > 0) /* Nothing found. */
break;
case FTS_NS:
+ case FTS_SLNONE:
default:
continue;
}
if (asprintf (&modulesdir[0], MODULEDIRFMT, release) < 0)
return -1;
- FTS *fts = fts_open (modulesdir, FTS_NOSTAT, NULL);
+ FTS *fts = fts_open (modulesdir, FTS_NOSTAT | FTS_LOGICAL, NULL);
if (fts == NULL)
{
free (modulesdir[0]);
switch (f->fts_info)
{
case FTS_F:
+ case FTS_SL:
case FTS_NSOK:
/* See if this file name is "MODULE_NAME.ko". */
if (f->fts_namelen == namelen + 3
error = f->fts_errno;
break;
+ case FTS_SLNONE:
default:
break;
}