]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
elf-util: pass exectable path to dwfl_core_file_report
authorAmbareesh Balaji <ambareeshbalaji@gmail.com>
Sun, 10 May 2026 23:25:13 +0000 (23:25 +0000)
committerLuca Boccassi <luca.boccassi@gmail.com>
Mon, 11 May 2026 09:57:31 +0000 (10:57 +0100)
Without it, stack trace symbols fail to resolve with .gnu_debuglink
split debug info.

src/shared/elf-util.c

index 97188ca41483ef8d3031110a5badf725298ebb6a..7c3d10f9e33748611fd003051ec98f11e0ea50c1 100644 (file)
@@ -619,6 +619,7 @@ static int module_callback(Dwfl_Module *mod, void **userdata, const char *name,
 
 static int parse_core(
                 int fd,
+                const char *executable,
                 const char *root,
                 char **ret,
                 sd_json_variant **ret_package_metadata,
@@ -667,7 +668,7 @@ static int parse_core(
                 log_warning("Compiled without dwfl_set_sysroot() support, ignoring provided root directory.");
 #endif
 
-        if (sym_dwfl_core_file_report(c.dwfl, c.elf, NULL) < 0)
+        if (sym_dwfl_core_file_report(c.dwfl, c.elf, executable) < 0)
                 return log_warning_errno(SYNTHETIC_ERRNO(EINVAL), "Could not parse core file, dwfl_core_file_report() failed: %s", sym_dwfl_errmsg(sym_dwfl_errno()));
 
         if (sym_dwfl_report_end(c.dwfl, NULL, NULL) != 0)
@@ -734,7 +735,7 @@ static int parse_elf(
         if (elf_header.e_type == ET_CORE) {
                 _cleanup_free_ char *out = NULL;
 
-                r = parse_core(fd, root, ret ? &out : NULL, &package_metadata, &dlopen_metadata);
+                r = parse_core(fd, executable, root, ret ? &out : NULL, &package_metadata, &dlopen_metadata);
                 if (r < 0)
                         return log_warning_errno(r, "Failed to inspect core file: %m");