From: Michael Tremer Date: Wed, 1 Jan 2025 17:25:35 +0000 (+0000) Subject: linter: Use the new strip check for debug information X-Git-Tag: 0.9.30~600 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cfdb48bc3dc4ec14021807a19e58d0a75d820070;p=pakfire.git linter: Use the new strip check for debug information Signed-off-by: Michael Tremer --- diff --git a/src/libpakfire/linter-file.c b/src/libpakfire/linter-file.c index 2ee0ca041..dfc984b37 100644 --- a/src/libpakfire/linter-file.c +++ b/src/libpakfire/linter-file.c @@ -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; }