]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
debuginfod-find: Support compressed (kernel) ELF images.
authorMark Wielaard <mark@klomp.org>
Tue, 15 Sep 2020 13:43:10 +0000 (15:43 +0200)
committerMark Wielaard <mark@klomp.org>
Tue, 15 Sep 2020 13:43:10 +0000 (15:43 +0200)
By using dwelf_elf_begin instead of elf_begin we automatically get
support for determining the build-id of compressed (kernel) images.

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

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

index db8a76a76de19adf731fa95478a07c590f20bd27..41897a3aa9cf8a996e307a2b45ae49c7a5532420 100644 (file)
@@ -1,3 +1,7 @@
+2020-09-15  Mark Wielaard  <mark@klomp.org>
+
+       * debuginfod-find.c (main): Use dwelf_elf_begin.
+
 2020-07-03  Alice Zhang <alizhang@redhat.com>
 
        * debuginfod-client.c (debuginfod_query_server): Use strncasecmp
index 83a43ce4be2eb06f2f6d156a5cdab8a6bc02a7f3..214256da38afd9dc778a2a51bef87ec981c16bc0 100644 (file)
@@ -138,9 +138,10 @@ main(int argc, char** argv)
     }
   if (fd >= 0)
     {
-      elf = elf_begin (fd, ELF_C_READ_MMAP_PRIVATE, NULL);
+      elf = dwelf_elf_begin (fd);
       if (elf == NULL)
-        fprintf (stderr, "Cannot elf_begin %s: %s\n", build_id, elf_errmsg(-1));
+        fprintf (stderr, "Cannot open as ELF file %s: %s\n", build_id,
+                elf_errmsg (-1));
     }
   if (elf != NULL)
     {