From 03f01548ea1d0a87d0d3f26757f6cf81ee62abcf Mon Sep 17 00:00:00 2001 From: marxin Date: Wed, 2 Jan 2019 09:34:56 +0100 Subject: [PATCH] Backport from trunk 5761ef718536d94bc8ab283972efcfc1c75054f0: Come up with lto-bytecode check for ELF files. --- BinariesCheck.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/BinariesCheck.py b/BinariesCheck.py index 21a0cf8..7cd5253 100644 --- a/BinariesCheck.py +++ b/BinariesCheck.py @@ -71,6 +71,7 @@ chdir_call_regex = create_regexp_call('chdir') mktemp_call_regex = create_regexp_call('mktemp') + lto_section_name_prefix = '.gnu.lto_.' def __init__(self, pkg, path, file, is_ar, is_shlib): self.readelf_error = False @@ -90,6 +91,7 @@ self.debuginfo = False self.symtab = False self.tail = '' + self.lto_sections = False self.setgid = False self.setuid = False @@ -513,6 +515,9 @@ for ec in bin_info.exit_calls: printWarning(pkg, 'shared-lib-calls-exit', fname, ec) + if bin_info.lto_sections: + printError(pkg, 'lto-bytecode', fname) + for ec in bin_info.forbidden_calls: printWarning(pkg, ec, fname, BinaryInfo.forbidden_functions[ec]['f_name']) @@ -835,7 +840,11 @@ '''This executable should be stripped from debugging symbols, in order to take less space and be loaded faster. This is usually done automatically at buildtime by rpm. Check the build logs and the permission on the file (some -implementations only strip if the permission is 0755).''' +implementations only strip if the permission is 0755).''', + +'lto-bytecode', +'''This executable contains a LTO section. LTO bytecode is not portable +and should not be distributes in static libraries or e.g. Python modules.''', ) # BinariesCheck.py ends here