// 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;
}