]> git.ipfire.org Git - pakfire.git/commitdiff
ELF: Don't fail if we could not parse some DWARF information
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 16 Feb 2025 13:30:15 +0000 (13:30 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 16 Feb 2025 13:30:15 +0000 (13:30 +0000)
This is in line with what has been recommended from upstream.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/pakfire/elf.c

index 1a1b75795f1653c64dd9ca4fe7fd54ee4ee8b980..6c97b18c32beaa58e281f14ae140ae67ab6f1261 100644 (file)
@@ -1132,10 +1132,6 @@ int pakfire_elf_requires(struct pakfire_elf* self, char*** requires) {
 #define DWARF_E_NO_DWARF 6
 #endif
 
-#ifndef DWARF_E_INVALID_DWARF
-#define DWARF_E_INVALID_DWARF 16
-#endif
-
 int pakfire_elf_foreach_source_file(struct pakfire_elf* self,
                pakfire_elf_foreach_source_file_callback callback, void* data) {
        const char* filename = NULL;
@@ -1180,19 +1176,8 @@ int pakfire_elf_foreach_source_file(struct pakfire_elf* self,
 
                // Fetch the source files
                r = dwarf_getsrcfiles(die, &files, &count);
-               if (r < 0) {
-                       switch (dwarf_errno()) {
-                               // Skip any invalid DWARF sections
-                               case DWARF_E_INVALID_DWARF:
-                                       goto NEXT;
-
-                               default:
-                                       ERROR(self->ctx, "Could not fetch the source files for %s: %s\n",
-                                               self->path, dwarf_errmsg(-1));
-                                       r = -ENOTSUP;
-                                       goto ERROR;
-                       }
-               }
+               if (r < 0)
+                       goto NEXT;
 
                // Iterate over all files...
                for (unsigned int i = 0; i < count; i++) {