GElf_Sym symbol;
const char* name = NULL;
+ // Count any global functions
+ size_t counter = 0;
+
// Walk through all sections
for (;;) {
section = elf_nextscn(elf, section);
// Exit if there is a symbol called "__stack_chk_fail"
if (pakfire_string_startswith(name, "__stack_chk_fail"))
return 0;
+
+ // Count any global functions
+ if ((ELF64_ST_BIND(symbol.st_info) == STB_GLOBAL) &&
+ (ELF64_ST_TYPE(symbol.st_info) == STT_FUNC))
+ counter++;
+ }
+
+ // We do not perform the check for libraries that do not contain any functions.
+ // Some packages use shared libraries to provide data.
+ if (!counter) {
+ DEBUG(file->pakfire, "%s: File has no functions. Skipping SSP check.\n", file->path);
+ return 0;
}
// The file does not seem to have SSP enabled