]> git.ipfire.org Git - people/ric9/pakfire.git/commitdiff
linter: Use the ELF strip check
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 1 Jan 2025 17:19:00 +0000 (17:19 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 1 Jan 2025 17:19:00 +0000 (17:19 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/linter-file.c

index 73e65d61e1e25df816b24a882665cca4a4d66216..2bac4a9f776d64c25317193255c878134762e425 100644 (file)
@@ -907,10 +907,7 @@ static int pakfire_linter_file_check_cf_protection(struct pakfire_linter_file* l
 }
 
 static int pakfire_linter_file_is_stripped(struct pakfire_linter_file* lfile) {
-       Elf_Scn* symtab = NULL;
-       int r;
-
-       switch (pakfire_linter_file_get_elf_type(lfile)) {
+       switch (pakfire_elf_type(lfile->_elf)) {
                // Do not check Relocatable Objects
                case ET_REL:
                        return 0;
@@ -920,13 +917,7 @@ static int pakfire_linter_file_is_stripped(struct pakfire_linter_file* lfile) {
                        break;
        }
 
-       // Fetch the symbol table
-       r = pakfire_linter_file_get_elf_section(lfile, SHT_SYMTAB, &symtab, NULL, NULL);
-       if (r < 0)
-               return r;
-
-       // If we have found the symbol table we are not stripped
-       else if (r == 0)
+       if (!pakfire_elf_is_stripped(lfile->_elf))
                return pakfire_linter_file_error(lfile, "Not Stripped");
 
        return 0;