LIST="$(find -L /proc/*/exe -xtype l -exec test -e {} \; -print)"
# waiting on temp processes to end
sleep 1
# verify existence of files and ELF format
for elfformat in ${LIST}; do
if [[ "$(file ${elfformat})" == "*ELF*" ]]; then
if [[ "$(readelf -h ${elfformat} | grep "Type")" != "*DYN*" ]]; then
echo "ELF file which is not in ET_DYN ELF format - ${elfformat}" >> ${SECURIXVAR}/elf-format.warn
fi
fi
done
idea (dirty code):