scripts: add MACHO NOUNDEFS check to security-check.py

This commit is contained in:
fanquake committed 2020-01-02 14:42:23 +08:00
1 parent 4ca92dc6d3
commit 7c9e821c4e
1 file changed
+10
+10
View File
@@ -188,6 +188,15 @@ def check_MACHO_PIE(executable) -> bool:
return True
return False
def check_MACHO_NOUNDEFS(executable) -> bool:
'''
Check for no undefined references.
'''
flags = get_MACHO_executable_flags(executable)
if 'NOUNDEFS' in flags:
return True
return False
CHECKS = {
'ELF': [
('PIE', check_ELF_PIE),
@@ -202,6 +211,7 @@ CHECKS = {
],
'MACHO': [
('PIE', check_MACHO_PIE),
('NOUNDEFS', check_MACHO_NOUNDEFS),
]
}