]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
libdwfl: Use realpath (name, NULL) instead of canonicalize_file_name (name).
authorMark Wielaard <mark@klomp.org>
Mon, 5 Mar 2018 13:23:14 +0000 (14:23 +0100)
committerMark Wielaard <mark@klomp.org>
Fri, 9 Mar 2018 23:17:39 +0000 (00:17 +0100)
Some systems apparently don't provide canonicalize_file_name. Since
canonicalize_file_name (path) is defined as realpath(path, NULL) just
use realpath everywhere.

https://sourceware.org/bugzilla/show_bug.cgi?id=21009

Signed-off-by: Mark Wielaard <mark@klomp.org>
libdwfl/ChangeLog
libdwfl/dwfl_build_id_find_elf.c
libdwfl/find-debuginfo.c

index b2a74971627e19f200eccec0d711c2d3c72591e5..1515c410481a7b8fdd9941b8380a442a97935c88 100644 (file)
@@ -1,3 +1,9 @@
+2018-03-05  Mark Wielaard  <mark@klomp.org>
+
+       * dwfl_build_id_find_elf.c (__libdwfl_open_by_build_id): Use
+       realpath (name, NULL) instead of canonicalize_file_name (name).
+       * find-debuginfo.c (dwfl_standard_find_debuginfo): Likewise.
+
 2018-01-29  Mark Wielaard  <mark@klomp.org>
 
        * cu.c (cudie_offset): Use __libdw_first_die_off_from_cu instead of
index ee0c16468e85b1626db70dc2f459c778a387c0d6..cc6c3f62d276f9f325f4f37ebb60230c970a8cd9 100644 (file)
@@ -99,7 +99,7 @@ __libdwfl_open_by_build_id (Dwfl_Module *mod, bool debug, char **file_name,
        {
          if (*file_name != NULL)
            free (*file_name);
-         *file_name = canonicalize_file_name (name);
+         *file_name = realpath (name, NULL);
          if (*file_name == NULL)
            {
              *file_name = name;
index 6d5a42a6dd0cd1cbe1b9a81f1dbbe3b76c0c18d3..9267788d2d190233e138551262921d73c47b236e 100644 (file)
@@ -389,7 +389,7 @@ dwfl_standard_find_debuginfo (Dwfl_Module *mod,
       /* 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);
+      char *canon = realpath (file_name, NULL);
       if (canon != NULL && strcmp (file_name, canon))
        fd = find_debuginfo_in_path (mod, canon,
                                     debuglink_file, debuglink_crc,