]> git.ipfire.org Git - pakfire.git/commitdiff
linter: Use the new strip check for debug information
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 1 Jan 2025 17:25:35 +0000 (17:25 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 1 Jan 2025 17:25:35 +0000 (17:25 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/linter-file.c

index 2ee0ca041e36d9f1f79c4a1c2c426074b2b7cf44..dfc984b37cf5de681328d56007ae4e9532c98212 100644 (file)
@@ -947,30 +947,13 @@ static int pakfire_linter_file_has_build_id(struct pakfire_linter_file* lfile) {
 
 // Checks if files in /usr/lib/debug are correct
 static int pakfire_linter_file_check_debug(struct pakfire_linter_file* lfile) {
-       Elf_Scn* symtab = NULL;
-       int r;
-
        // Fail if this file is not an ELF file
        if (!lfile->_elf)
                return pakfire_linter_file_error(lfile, "File is not in ELF format");
 
-       switch (pakfire_linter_file_get_elf_type(lfile)) {
-               // Do not check Relocatable Objects
-               case ET_REL:
-                       return 0;
-
-               // Check everything else
-               default:
-                       break;
-       }
-
-       // Fetch the symbol table
-       r = pakfire_linter_file_get_elf_section(lfile, SHT_SYMTAB, &symtab, NULL, NULL);
-       if (r < 0)
-               return r;
-
-       else if (r > 0)
-               pakfire_linter_file_error(lfile, "Is Stripped");
+       // Fail if there is no debugging information in the file
+       if (pakfire_elf_is_stripped(lfile->_elf))
+               return pakfire_linter_file_error(lfile, "Has no debug information");
 
        return 0;
 }